Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [patch/rfc] post-process the `maint print architecture' from gdb_mbuild.sh
Date: Thu, 02 Jan 2003 19:48:00 -0000	[thread overview]
Message-ID: <3E14976A.9060906@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Hello,

The attached patch modifies the gdb_mbuild.sh 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 gdb_mbuild.sh runs easier - functions and file 
names are identical.

thoughts?

Andrew



[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1266 bytes --]

2003-01-02  Andrew Cagney  <ac131313@redhat.com>

	* 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 <<EOF
+, s/<${addr}>/<${func}>/g
+w
+q
+EOF
+    done
+
+    # Strip out the leading string from any file names that
+    # contain a prefix.
+    ed -s Gdb.log <<EOF
+, s/"\/.*\/gdb\//"gdb\//g
+w
+q
+EOF
+
     # Replace the build directory with a file as semaphore that stops
     # a rebuild. (should the logs be saved?)
 

             reply	other threads:[~2003-01-02 19:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-02 19:48 Andrew Cagney [this message]
2003-01-02 20:04 Michael Elizabeth Chastain
2003-01-07 15:12 ` Andrew Cagney
2003-01-07 15:54   ` Daniel Jacobowitz
2003-01-08 23:59     ` Andrew Cagney
2003-01-09  0:05       ` Daniel Jacobowitz
2003-01-07 15:48 Michael Elizabeth Chastain
2003-01-07 16:01 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E14976A.9060906@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox