From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25152 invoked by alias); 30 Jan 2003 15:50:01 -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 25122 invoked from network); 30 Jan 2003 15:50:00 -0000 Received: from unknown (HELO nimbus19.internetters.co.uk) (209.61.216.65) by 172.16.49.205 with SMTP; 30 Jan 2003 15:50:00 -0000 Received: (qmail 12407 invoked from network); 30 Jan 2003 15:49:59 -0000 Received: from unknown (HELO cambridge.braddahead.) (81.152.26.185) by nimbus19.internetters.co.uk with SMTP; 30 Jan 2003 15:49:59 -0000 Subject: Why can't I use "info line *address" in canned scripts? From: Alex Bennee To: gdb@sources.redhat.com Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 30 Jan 2003 15:50:00 -0000 Message-Id: <1043941567.1948.8.camel@cambridge.braddahead> Mime-Version: 1.0 X-SW-Source: 2003-01/txt/msg00517.txt.bz2 Hi, I'm trying to get a command script to run to unwind the linux kernel stack on a gdb remote target. I can do it manually by hand but when I try and resolve the symbols using the "info line" command I get the error "No line number information available for address". I've scratched my head and can't figure out whats going on. The script looks like this: # # Poor mans stack trace - trace the call history of a function given # the current stack pointer (or assume r15 is it) # # It uses the same approach as the stack trace code in the kernel # define sym info line *$arg0 end define pmst if $arg0 == 0 set $sstack = $r15 else set $sstack = $arg0 end # set the bounds of text segment - can't seem to get section # headers so I cheat set $stext = &empty_zero_page set $etext = 0x881c6c68 # and set the end of stack set $estack = $sstack + 1024 printf "Doing stack strace from:%x to %x\n", $sstack, $estack printf "Text Segment assumed to go from:%x to %x\n", $stext, $etext # Now go through the stack and print out any # addresses (and where they point) that are in the # .text section (and therfore function returns) while $sstack < $estack set $address = *$sstack if $address>$stext if $address<$etext printf "0x%lx:", $address sym ($address) end end set $sstack = $sstack + 4 end end And when I run it I get the following output.... (gdb) pmst $62 Doing stack strace from:881d5ec8 to 881d62c8 Text Segment assumed to go from:88001000 to 881c6c68 0x880157e8:No line number information available for address 0x880157e8 0x8801554a:No line number information available for address 0x8801554a .. .. 0x8819c550:No line number information available for address 0x8819c550 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? -- Alex, homepage: http://www.bennee.com/~alex/ The speed of anything depends on the flow of everything.