* problems debugging an uml skas kernel with gdb
@ 2005-06-08 12:35 marco ghidinelli
2005-06-08 15:11 ` [uml-user] " Blaisorblade
0 siblings, 1 reply; 3+ messages in thread
From: marco ghidinelli @ 2005-06-08 12:35 UTC (permalink / raw)
To: gdb ml; +Cc: uml users
hello,
i've problems debugging a UML SKAS kernel.
the host is an x86 kernel 2.6.12-rc4-skas3-v9-pre4
the guest is a kernel 2.6.12-rc4.
GNU gdb 6.3.50.20050606-cvs,
gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
the problems are:
1) a pointer to a struct was not seen by the debugger:
example session:
Breakpoint 4, yoghi_init (sch=0x9d1b830, opt=0x9d1b400)
at net/sched/sch_yoghi.c:235
235 printk(KERN_DEBUG "Yoghi 0.0.3 Initiaziled\n");
(gdb) n
Yoghi 0.0.3 Initiaziled
236 if(q != NULL)
(gdb) n
237 printk(KERN_DEBUG "yoghi_init: q =
0x%x\n",(u32)q);
(gdb) n
yoghi_init: q = 0x9d1b480
238 return 0;
(gdb) p q
No symbol "q" in current context.
this is quite annoying but i can get my info in another way:
(gdb) p (struct yoghi_sched_data)*0x9d1b480
2) sometimes the debugger get lost:
Breakpoint 3, yoghi_bind (sch=0xa8bcf20, parent=0, classid=176934688)
at net/sched/sch_yoghi.c:271
271 return yoghi_get(sch, classid);
(gdb) s
yoghi_get (sch=0x10003, classid=65539) at net/sched/sch_yoghi.c:257
note that sch was changed!!
and sometimes it get completly lost:
Breakpoint 1, yoghi_get (sch=0x10013, classid=65555)
at net/sched/sch_yoghi.c:259
259 u32 band = TC_H_MIN(classid);
(gdb) n
261 printk(KERN_DEBUG "yoghi_get: classid = %d ; band = %d ;
band2 = %d\n",classid,band,band2);
(gdb) p band
$8 = 19
(gdb) n
yoghi_get: classid = 65555 ; band = 19 ; band2 = 19
262 if (band -1 > q->bands)
(gdb) n
263 return 0; /* means not found */
(gdb) n
265 }
(gdb) n
0x0a8846d2 in ?? ()
(gdb) bt
#0 0x0a8846d2 in ?? ()
#1 0x09d1b000 in ?? ()
#2 0x00010013 in ?? ()
#3 0x00010013 in ?? ()
#4 0x00000000 in ?? ()
bye!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [uml-user] problems debugging an uml skas kernel with gdb
2005-06-08 12:35 problems debugging an uml skas kernel with gdb marco ghidinelli
@ 2005-06-08 15:11 ` Blaisorblade
2005-06-08 19:54 ` Ramana Radhakrishnan
0 siblings, 1 reply; 3+ messages in thread
From: Blaisorblade @ 2005-06-08 15:11 UTC (permalink / raw)
To: user-mode-linux-user; +Cc: marco ghidinelli, gdb ml
On Wednesday 08 June 2005 14:34, marco ghidinelli wrote:
> hello,
>
> i've problems debugging a UML SKAS kernel.
> the host is an x86 kernel 2.6.12-rc4-skas3-v9-pre4
> the guest is a kernel 2.6.12-rc4.
>
> GNU gdb 6.3.50.20050606-cvs,
> gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
>
> the problems are:
>
> 1) a pointer to a struct was not seen by the debugger:
>
> example session:
>
> Breakpoint 4, yoghi_init (sch=0x9d1b830, opt=0x9d1b400)
> at net/sched/sch_yoghi.c:235
> 235 printk(KERN_DEBUG "Yoghi 0.0.3 Initiaziled\n");
> (gdb) n
> Yoghi 0.0.3 Initiaziled
> 236 if(q != NULL)
> (gdb) n
> 237 printk(KERN_DEBUG "yoghi_init: q =
> 0x%x\n",(u32)q);
> (gdb) n
> yoghi_init: q = 0x9d1b480
> 238 return 0;
> (gdb) p q
> No symbol "q" in current context.
>
> this is quite annoying but i can get my info in another way:
> (gdb) p (struct yoghi_sched_data)*0x9d1b480
Probably the variable was optimized out by the compiler...
> 2) sometimes the debugger get lost:
>
> Breakpoint 3, yoghi_bind (sch=0xa8bcf20, parent=0, classid=176934688)
> at net/sched/sch_yoghi.c:271
> 271 return yoghi_get(sch, classid);
> (gdb) s
> yoghi_get (sch=0x10003, classid=65539) at net/sched/sch_yoghi.c:257
>
> note that sch was changed!!
>
> and sometimes it get completly lost:
>
> Breakpoint 1, yoghi_get (sch=0x10013, classid=65555)
> at net/sched/sch_yoghi.c:259
> 259 u32 band = TC_H_MIN(classid);
> (gdb) n
> 261 printk(KERN_DEBUG "yoghi_get: classid = %d ; band = %d ;
> band2 = %d\n",classid,band,band2);
> (gdb) p band
> $8 = 19
> (gdb) n
> yoghi_get: classid = 65555 ; band = 19 ; band2 = 19
> 262 if (band -1 > q->bands)
> (gdb) n
> 263 return 0; /* means not found */
> (gdb) n
> 265 }
> (gdb) n
> 0x0a8846d2 in ?? ()
> (gdb) bt
> #0 0x0a8846d2 in ?? ()
> #1 0x09d1b000 in ?? ()
> #2 0x00010013 in ?? ()
> #3 0x00010013 in ?? ()
> #4 0x00000000 in ?? ()
>
> bye!
Sadly gdb is not very reliable, and I can confirm all this is normal... you
could try compiling the kernel (or at least the modules of your interest, but
you'd better patch the Makefiles) with -O1 instead of -O2...
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [uml-user] problems debugging an uml skas kernel with gdb
2005-06-08 15:11 ` [uml-user] " Blaisorblade
@ 2005-06-08 19:54 ` Ramana Radhakrishnan
0 siblings, 0 replies; 3+ messages in thread
From: Ramana Radhakrishnan @ 2005-06-08 19:54 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-user, marco ghidinelli, gdb ml
Hey,
>> the problems are:
>>
>> 1) a pointer to a struct was not seen by the debugger:
>>
>> example session:
>>
>> Breakpoint 4, yoghi_init (sch=0x9d1b830, opt=0x9d1b400)
>> at net/sched/sch_yoghi.c:235
>> 235 printk(KERN_DEBUG "Yoghi 0.0.3 Initiaziled\n");
>> (gdb) n
>> Yoghi 0.0.3 Initiaziled
>> 236 if(q != NULL)
>> (gdb) n
>> 237 printk(KERN_DEBUG "yoghi_init: q =
>> 0x%x\n",(u32)q);
>> (gdb) n
>> yoghi_init: q = 0x9d1b480
>> 238 return 0;
>> (gdb) p q
>> No symbol "q" in current context.
You might want to show the entire source and the assembly generated as
well. Even better see if you can narrow it down to a testcase . We dont
have enough information to know whats going on here. Maybe you can try and
pare it down to a smaller testcase (better) or send the disassembly over
(of the affected function) with its source if possible .There are a couple
of situations when gdb can get lost.
cheers
Ramana
----
Ramana Radhakrishnan
Codito Technologies
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-08 19:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-08 12:35 problems debugging an uml skas kernel with gdb marco ghidinelli
2005-06-08 15:11 ` [uml-user] " Blaisorblade
2005-06-08 19:54 ` Ramana Radhakrishnan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox