gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gdb] Remote debugging problems with gdbserver


From: Bob Furber
Subject: [Gdb] Remote debugging problems with gdbserver
Date: Fri, 29 Dec 2006 19:08:15 -0800

I am having intermittent problems debugging applications running under
uClinux-2.6.17 (uDebugging) on a M5208EVB target: GDB shows the wrong the
start address on startup and it misbehaves. Then on a subsequent uDebug
attempt, the correct start address shows up and uDebugging proceeds as
expected.

My impression is that when GDB misbehaves it is confused: It has knowledge
of symbols and absolute addresses, but it claims otherwise when asked to
step. Stepi results in the program being terminated, which makes no sense.
Run results in gdbserver killing the program:

C:\SBCToolsV3\workspace\uTestuClinuxInit\Debug>m68k-bdm-elf-gdb
uTestuClinuxInit.gdb
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
        :
This GDB was configured as "--host=i686-pc-mingw32 --target=m68k-bdm-elf"...
(gdb) target remote 192.168.2.128:3000
Remote debugging using 192.168.2.128:3000
0x41cb702e in ?? ()                             <-- wrong start address
(gdb) x $pc
0x41cb702e:     0x2a007082
(gdb) x _start
0x4032c048 <_start>:    0x2a4541f9              <-- knows symbols & addresses
(gdb) set $pc=_start
(gdb) x $pc
0x4032c048 <_start>:    0x2a4541f9
(gdb) disas 0x4032c040 0x4032c06e
Dump of assembler code from 0x4032c040 to 0x4032c06e:
0x4032c040:     orib #0,%d0
0x4032c044 <_stext+0>:  nop
0x4032c046 <_stext+2>:  nop
0x4032c048 <_start+0>:  moveal %d5,%a5  <-- looks reasonable
0x4032c04a <_start+2>:  lea 0x826,%a0
0x4032c050 <_start+8>:  jsr %pc@(0x4032c052 <_start+10>,%a0:l)
0x4032c054 <__exit+0>:  movel address@hidden,%d1
0x4032c056 <__exit+2>:  moveq #1,%d0
0x4032c058 <__exit+4>:  trap #0
0x4032c05a <atexit+0>:  rts
0x4032c05c <main+0>:    linkw %fp,#-32
0x4032c060 <main+4>:    movel %a5,address@hidden
0x4032c062 <main+6>:    lea 0x2872,%a1
0x4032c068 <main+12>:   jsr %pc@(0x4032c06a <main+14>,%a1:l)
0x4032c06c <main+16>:   moveq #3,%d0
End of assembler dump.
(gdb) s
Cannot find bounds of current function  <-- yet it can disassemble!
(gdb) stepi
Program exited normally.
(gdb)


Attempt to run, after correcting PC, fails, showing gdbserver and gdb
transactions:

# gdbserver :3000 /mnt/workspace/uTestuClinuxInit/Debug/uTestuClinuxInit
Process /mnt/workspace/uTestuClinuxInit/Debug/uTestuClinuxInit created; pid
= 86
code at 0x4032c040 - 0x4032fee0, data at 0x41f1a004
Remote debugging using :3000                            <-- gdbserver

   (gdb) target remote 192.168.2.128:3000               <-- gdb
   Remote debugging using 192.168.2.128:3000
   0x41cb702e in ?? ()
   (gdb) set $pc=_start
   (gdb) x $pc
   0x4032c048 <_start>:    0x2a4541f9
   (gdb) run
   Starting program:
C:\SBCToolsV3\workspace\uTestuClinuxInit\Debug/uTestuClinuxInit.gdb
   Not attached to the target. Use `target bdm <DEVICE-NAME>' command to
attach.
   (gdb)

Killing inferior                                        <-- gdbserver
#

Has anyone run into this kind of problem?

Thanks,

BobF






reply via email to

[Prev in Thread] Current Thread [Next in Thread]