From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14141 invoked by alias); 30 Jan 2003 17:42:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14134 invoked from network); 30 Jan 2003 17:42:28 -0000 Received: from unknown (HELO nimbus19.internetters.co.uk) (209.61.216.65) by 172.16.49.205 with SMTP; 30 Jan 2003 17:42:28 -0000 Received: (qmail 5794 invoked from network); 30 Jan 2003 17:42:25 -0000 Received: from unknown (HELO cambridge.braddahead.) (81.152.26.185) by nimbus19.internetters.co.uk with SMTP; 30 Jan 2003 17:42:25 -0000 Subject: Re: Why can't I use "info line *address" in canned scripts? From: Alex Bennee To: Andreas Schwab Cc: gdb@sources.redhat.com In-Reply-To: References: <1043941567.1948.8.camel@cambridge.braddahead> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 30 Jan 2003 17:42:00 -0000 Message-Id: <1043948314.5288.23.camel@cambridge.braddahead> Mime-Version: 1.0 X-SW-Source: 2003-01/txt/msg00521.txt.bz2 On Thu, 2003-01-30 at 17:22, Andreas Schwab wrote: > Alex Bennee writes: > > |> But manually doing the info line works. > |> > |> (gdb) info line *0x880157e8 > |> Line 524 of "printk.c" starts at address 0x880157e4 > |> and ends at 0x88015800 > |> . > |> > |> Any ideas? Have I missed something obvious or triggered a bug? > > What do you get when you type "info line *(0x880157e8)"? No problems from the command line, its in the canned scripts is causes the problem. (gdb) info line *0x8801b151 Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . (gdb) info line *(0x8801b151) Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . (gdb) define sym >info line *($arg0) >end (gdb) pmst $1 Doing stack strace from:881d5f2c to 881d632c Text Segment assumed to go from:88001000 to 881c6c68 0x8801b15a:No line number information available for address 0x8801b15a I originally thought it might be something to do with evaluation order but the error message generated by "info line" does seem to indicate its got the right address. If fact experimenting further sym can be called from the command line in many ways and still work: (gdb) sym 0x8801b151 Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . (gdb) sym (0x8801b151) Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . (gdb) set $addr=0x8801b151 (gdb) sym $addr Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . (gdb) sym ($addr) Line 89 of "softirq.c" starts at address 0x8801b14c and ends at 0x8801b156 . But call it from within the script and it fails. I think I must be going mad :-( -- Alex, homepage: http://www.bennee.com/~alex/ All things that are, are with more spirit chased than enjoyed. -- Shakespeare, "Merchant of Venice"