This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/rfc] post-process the `maint print architecture' from


The attached patch modifies the so that it post-processes the output from each target's `maint print architecture' command.

The post processing does two things:

- (using addr2line) replaces <0xNNNN> with the name of the corresponding function / variable

- strips off any leading path info included in any file name paths

Doing this makes the task of comparing the `maint print architecture' output from separate runs easier - functions and file names are identical.



2003-01-02  Andrew Cagney  <>

	* Edit the output of `maint print architecture'
	replacing hex constants with function names and stripping leading
	file name directory prefixes.

RCS file: /cvs/src/src/gdb/,v
retrieving revision 1.3
diff -u -r1.3
---	2 Jan 2003 16:40:33 -0000	1.3
+++	2 Jan 2003 19:16:23 -0000
@@ -279,6 +279,31 @@
     fail "gdb printed no output" ! -s Gdb.log
     grep -e internal-error Gdb.log && fail "gdb panic" 1
+    # Parse the architecture dump replacing any <0xNNNN> with the
+    # corresponding function.
+    sed -n \
+	-e '/<0x0*>/d' \
+	-e 's/^.*<0x\([0-9a-f]*\)>.*$/0x\1/p' \
+	Gdb.log | sort -u | while read addr
+    do
+	func="`addr2line -f -e ./gdb/gdb -s ${addr} | sed -n -e 1p`"
+	echo ${addr} ${func}
+	ed -s Gdb.log <<EOF
+, s/<${addr}>/<${func}>/g
+    done
+    # Strip out the leading string from any file names that
+    # contain a prefix.
+    ed -s Gdb.log <<EOF
+, s/"\/.*\/gdb\//"gdb\//g
     # Replace the build directory with a file as semaphore that stops
     # a rebuild. (should the logs be saved?)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]