Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Why can't I use "info line *address" in canned scripts?
@ 2003-01-30 15:50 Alex Bennee
  2003-01-30 17:22 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Bennee @ 2003-01-30 15:50 UTC (permalink / raw)
  To: gdb

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-30 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-30 15:50 Why can't I use "info line *address" in canned scripts? Alex Bennee
2003-01-30 17:22 ` Andreas Schwab
2003-01-30 17:42   ` Alex Bennee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox