[K42-discussion] Problem debugging linux user mode apps with K42 remote gdb
Patrick Bozeman
PEBozeman at lbl.gov
Tue Aug 29 07:06:13 EST 2006
The tests below were run using the gdb from the UNM devkit. Keep in
mind that I can debug native K42 apps like baseservers and procfsserver
just fine.
Are you able to use gdb on a basic hello-world type linux app using
DEBUGPROC at your site?
powerpc64-linux-gdb --version
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=powerpc64-linux".
Also, in case it is relevant, the console complains when I try to do
things like backtrace or continue in gdb. I assume that the access to
addr 0x0 can't be good. From the k42 console:
/home/peb/src/k42-devel/k42/kitchsrc/os/kernel/proc/ProcessReplicated.C,565:
>>
>> Invalid memory access: processID 0x1f addr 0x0, type 200000 vp=0
>> this=0x8002000020790a00 myRoot=0x8002000000376a00
>> myRef=0x8000000010001f50
>> WARNING: file
>> "/home/peb/src/k42-devel/k42/kitchsrc/os/kernel/exception/ExceptionLocal.C",
>>
>> line 352
>> User-mode bad-address fault: commID 0x1f00000000, pc 0x1000702e852c,
>> addr 0, rc 8000000005cd6416.
>> /home/peb/src/k42-devel/k42/kitchsrc/os/kernel/proc/ProcessReplicated.C,565:
>>
>> Invalid memory access: processID 0x1f addr 0x0, type 200000 vp=0
>> this=0x8002000020790a00 myRoot=0x8002000000376a00
>> myRef=0x8000000010001f50
>> WARNING: file
>> "/home/peb/src/k42-devel/k42/kitchsrc/os/kernel/exception/ExceptionLocal.C",
>>
>> line 352
>> User-mode bad-address fault: commID 0x1f00000000, pc 0x1000702e852c,
>> addr 0, rc 8000000005cd6416.
Bryan S Rosenburg wrote:
>
> That all looks completely normal. So the problem is with how gdb is
> interpreting the machine state, not with the machine state itself.
> What version of gdb are you using? And how was it built? Is it a
> cross-debugger (x86 to powerpc)?
>
> - Bryan
>
>
>
> *Patrick Bozeman <PEBozeman at lbl.gov>*
> Sent by: k42-discussion-bounces+rosnbrg=us.ibm.com at ozlabs.org
>
> 08/28/2006 04:22 PM
> Please respond to
> Discussion about K42 <k42-discussion at ozlabs.org>
>
>
>
> To
> Discussion about K42 <k42-discussion at ozlabs.org>
> cc
>
> Subject
> Re: [K42-discussion] Problem debugging linux user mode apps with K42
> remote gdb
>
>
>
>
>
>
>
>
>
> This is from an early break in the process via DEBUGPROC
>
> (gdb) print/x $pc
> $1 = 0x1000702e1a08
> (gdb) print/x $lr
> $2 = 0x1000702e19d4
> (gdb) print/x $r1
> $3 = 0x100000029b70
> (gdb) print/x $r2
> $4 = 0x10008009fb38
> (gdb) x/i $pc
> 0x1000702e1a08 <breakpoint+108>: ld r31,-32736(r30)
> (gdb) x/i $lr
> 0x1000702e19d4 <breakpoint+56>: nop
> (gdb) x/4xg $r1
> 0x100000029b70: 0x0000100000029bf0 0x000000000003e000
> 0x100000029b80: 0x00001000702e19d4 0x000000000003e000
> (gdb) x/4xg (*((unsigned long long *) $r1))
> 0x100000029bf0: 0x0000100000029ef0 0x0000100000029e30
> 0x100000029c00: 0x00001000702e6b3c 0x000010000002aba0
>
>
> This is from a tassertMsg(0, ...) in dup2.C
>
> (gdb) print/x $pc
> $1 = 0x1000702e1a08
> (gdb) print/x $lr
> $2 = 0x1000702e19d4
> (gdb) print/x $r1
> $3 = 0x10000002a8d0
> (gdb) print/x $r2
> $4 = 0x10008009fb38
> (gdb) x/i $pc
> 0x1000702e1a08 <breakpoint+108>: ld r31,-32736(r30)
> (gdb) x/i $lr
> 0x1000702e19d4 <breakpoint+56>: nop
> (gdb) x/4xg $r1
> 0x10000002a8d0: 0x000010000002a950 0x0000000000000000
> 0x10000002a8e0: 0x00001000702e19d4 0x000000000000ffff
> (gdb) x/4xg (*((unsigned long long *) $r1))
> 0x10000002a950: 0x000010000002ab70 0x00001000066425c0
> 0x10000002a960: 0x00001000702dcd4c 0x0000100006683c80
>
>
> Bryan S Rosenburg wrote:
> >
> > Patrick,
> >
> > I can't think of anything you're doing wrong. Next time you connect,
> > would you collect and publish some of the machine state? To start
> > with, I'd like to see the output of:
> >
> > print/x $pc
> > print/x $lr
> > print/x $r1
> > print/x $r2
> > x/i $pc
> > x/i $lr
> > x/4xg $r1
> > x/4xg (*((unsigned long long *) $r1))
> >
> > - Bryan
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > K42-discussion mailing list
> > K42-discussion at ozlabs.org
> > https://ozlabs.org/mailman/listinfo/k42-discussion
> >
>
> _______________________________________________
> K42-discussion mailing list
> K42-discussion at ozlabs.org
> https://ozlabs.org/mailman/listinfo/k42-discussion
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> K42-discussion mailing list
> K42-discussion at ozlabs.org
> https://ozlabs.org/mailman/listinfo/k42-discussion
>
More information about the K42-discussion
mailing list