[K42-discussion] Problem debugging linux user mode apps with K42 remote gdb

Dilma DaSilva dilma at watson.ibm.com
Mon Aug 28 12:26:17 EST 2006


Hi Patrick,

The steps you took seem ok to me.
I don't remember ever seeing the signal hander msg at 
 > "/home/peb/src/k42-devel/k42/powerpc/partDeb/lib/libk42sys.so.1.dbg" at
 > <signal handler called>

My gdb init has also set "single-step-mode 0" as part of the script to
attach to hardware, but I thought it was not really necessary.

I'm trying to do the same experiment here (adding tassert to dup2),
but I'm having trouble booting :-) I'll report when I get it running.

dilma

Patrick Bozeman writes:
 > I can debug native K42 apps just fine, e.g. baseServers, but am having a 
 > problem with debugging linux user mode apps.  Hopefully, someone can 
 > point out what I am doing wrong.
 > 
 > Thanks.
 > 
 > #
 > # I compile the app with debug support.  This is a small program that 
 > triggers
 > # a problem between dup2 and some other code I added to K42 file
 > # system layers.
 > #
 > console>  powerpc64-linux-gcc -g null-dup.c -o null-dup
 > 
 > #
 > # I run the app..
 > #
 > k42> /tmp/null-dup
 > 
 > #
 > # An asert I added to dup2.C gets triggered.  (Note, nothing about the
 > # process should be corrupt, this is just to serve as a condidtional
 > # break point to kick off debugging.)
 > #
 > # K42 hw console output...
 > #
 > breakpoint pid 0x1f, progName /tmp/null-dup
 > GDB got trap: Program Interrupt
 > vector=0x700, sr=0x900000000002f032, pc=0x1000702e18b4 lr=0x1000702e1880
 > User program pid=31(0x1f) connecting to GDB via port 2223
 > 
 > #
 > # I attach via gdb and it complains a litte bit..
 > # note that the symbol files for exec.so.dbg and libk42sys.so.1.dbg are 
 > added.
 > #
 > console> powerpc64-linux-gdb null-dup
 > (gdb) hw-debug 10.0.0.2:2223
 > The target architecture is assumed to be powerpc:a35
 > add symbol table from file 
 > "/home/peb/src/k42-devel/k42/powerpc/partDeb/lib/exec.so.dbg" at
 > add symbol table from file 
 > warning: Unable to find dynamic linker breakpoint function.
 > GDB will be unable to debug shared library initializers
 > and track explicitly loaded dynamic code.
 > Current language:  auto; currently c++
 > 
 > #
 > # I try to get a back trace and both gdb and the k42 hw console complain
 > #
 > (gdb) bt
 > #0  <signal handler called>
 > #1  0x2fa0000040be001c in ?? ()
 > #2  0x2fad000040be001c in ?? ()
 > Previous frame identical to this frame (corrupt stack?)
 > 
 > #
 > # hw console output as a result of the bt
 > #
 > /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.
 > 
 > _______________________________________________
 > K42-discussion mailing list
 > K42-discussion at ozlabs.org
 > https://ozlabs.org/mailman/listinfo/k42-discussion



More information about the K42-discussion mailing list