This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Why can't I use "info line *address" in canned scripts?
- From: Alex Bennee <kernel-hacker at bennee dot com>
- To: gdb at sources dot redhat dot com
- Date: 30 Jan 2003 15:46:05 +0000
- Subject: Why can't I use "info line *address" in canned scripts?
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
..
<snip>
..
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
<release_console_sem+100> and ends at 0x88015800
<release_console_sem+128>.
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.