This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why can't I use "info line *address" in canned scripts?


On Thu, 2003-01-30 at 17:22, Andreas Schwab wrote:
> Alex Bennee <kernel-hacker@bennee.com> writes:
> 
> |> 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?
> 
> 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 <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.
(gdb) info line *(0x8801b151)
Line 89 of "softirq.c" starts at address 0x8801b14c <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.
(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
<snip>

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 <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.
(gdb) sym (0x8801b151)
Line 89 of "softirq.c" starts at address 0x8801b14c <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.
(gdb) set $addr=0x8801b151
(gdb) sym $addr
Line 89 of "softirq.c" starts at address 0x8801b14c <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.
(gdb) sym ($addr)
Line 89 of "softirq.c" starts at address 0x8801b14c <do_softirq+108> and
ends at 0x8801b156 <do_softirq+118>.

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"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]