Good morning,
It shouldn't matter in this case.. Even if I supplied -O2, a gdb
"next" command shouldn't step into the vprintk() function and step
through that implementation. And a -O2 compile option is not going
to inline th vprintk() call either.
The ENTER() macro is basically:
#define ENTER(format, args...) \
do { printk(KERN_INFO "ENTER[%p]: %s() " format "\n", \
current_thread_info(), __FUNCTION__ , ## args); } while (0)
And the source code of the function I broke into reads:
ENTER("%p", q);
while (!blk_queue_plugged(q))
{
...
So nexting through this should be about two lines, for the
current_thread_info() and the printk() in the ENTER() macro and then it
should move on to the while statement. But that's not what happens; the
debugger steps into the printk() and wont let me jump through or out of
it. It's like every next operation is the same as a step operation,
which is definitely not what I want.
Thanks,
-derek
PS: for the record I don't specify anything; I use whatever the default
options are.
Caz Yokoyama <[email protected]> writes:
> Hello Derek,
> What compile option do you give for your driver? -O2? Prologue of a function
> is something mysterious on -O2. I always give -O0 for the driver I want to
> debug.
> -caz
>
> -----Original Message-----
> From: Derek Atkins [mailto:[email protected]]
> Sent: Thursday, April 30, 2009 11:30 AM
> To: Caz Yokoyama
> Cc: [email protected]
> Subject: Problems with "next" and "fin" debugging 2.6.27
>
> Caz,
>
> Using your gdb-6.8-kgdblight and 2.6.27 I'm having some single-stepping
> problems that I didn't have with my pervious gdb-6.8 with kgdb-2.6.23.
>
> I was able to set a breakpoint just fine. The breakpoint hit.
> Then I wanted to step through the program but when I try I have
> issues. It seems like 'next' is acting just like 'step'.. And
> 'fin' just doesn't work at all. The "Unknown error" looks suspiciously
> like "(signed long)-1" -- I'm working on a 32-bit Host with a 32-bit
> target.
>
> Below is the gdb info...
>
> -derek
>
> (gdb) c
> Continuing.
> [Switching to Thread 1028]
>
> Breakpoint 2, mydriver_do_requests (q=0xde0857e8)
> at my-driver.c:699
> 699 {
> (gdb) n
> 701 struct mydriver_config *cfg = q->queuedata;
> (gdb)
> 704 ENTER("%p", q);
> (gdb)
> 701 struct mydriver_config *cfg = q->queuedata;
> (gdb)
> 704 ENTER("%p", q);
> (gdb)
> printk (fmt=0x14cc2 <Address 0x14cc2 out of bounds>) at kernel/printk.c:599
> 599 {
> (gdb) n
> 604 r = vprintk(fmt, args);
> (gdb)
> vprintk (fmt=0x8957e589 <Address 0x8957e589 out of bounds>,
> args=0x80be56c7 <Address 0x80be56c7 out of bounds>) at
> kernel/printk.c:666
> 666 {
> (gdb)
> vprintk (fmt=0xe09bfc23 "<6>ENTER[%p]: %s() %p\n", args=0xde54ebd4 "")
> at kernel/printk.c:210
> 210 if (boot_delay == 0 || system_state != SYSTEM_BOOTING)
> (gdb)
> 668 int current_log_level = default_message_loglevel;
> (gdb) fin
> Run till exit from #0 vprintk (fmt=0xe09bfc23 "<6>ENTER[%p]: %s() %p\n",
> args=0xde54ebd4 "") at kernel/printk.c:668
> Warning:
> Cannot insert breakpoint 0.
> Error accessing memory address 0xc06409b5: Unknown error 4294967295.
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
[email protected] PGP key available
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport