From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7157 invoked by alias); 2 Jan 2003 19:48:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7144 invoked from network); 2 Jan 2003 19:48:17 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by 209.249.29.67 with SMTP; 2 Jan 2003 19:48:17 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 63CDB3DE5 for ; Thu, 2 Jan 2003 19:47:54 +0000 (GMT) Message-ID: <3E14976A.9060906@redhat.com> Date: Thu, 02 Jan 2003 19:48:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/rfc] post-process the `maint print architecture' from gdb_mbuild.sh Content-Type: multipart/mixed; boundary="------------050001040108050805060306" X-SW-Source: 2003-01/txt/msg00016.txt.bz2 This is a multi-part message in MIME format. --------------050001040108050805060306 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 531 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 --------------050001040108050805060306 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1266 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 <