2003-01-02 Andrew Cagney * gdb_mbuild.sh: Edit the output of `maint print architecture' replacing hex constants with function names and stripping leading file name directory prefixes. Index: gdb_mbuild.sh =================================================================== RCS file: /cvs/src/src/gdb/gdb_mbuild.sh,v retrieving revision 1.3 diff -u -r1.3 gdb_mbuild.sh --- gdb_mbuild.sh 2 Jan 2003 16:40:33 -0000 1.3 +++ gdb_mbuild.sh 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 </<${func}>/g +w +q +EOF + done + + # Strip out the leading string from any file names that + # contain a prefix. + ed -s Gdb.log <