Skip to contentSkip to conversation

gdbserver

DISCUSSION dony 3 participants 8 messages Jan 22, 2000 – Jan 27, 2000

lore
Share & tools
lore

dony

author
#0 lore raw

Hello,

Now I want to use gdbserver to debug my test app.
Running "gdbserver :6666 ./mytest" on the target (Powerpc 860)
show a message:
Process ./mytest created :pid=8
But I don't know how to run gdb on the host (X86). The README
doesn't seem to explain
clearly . It says first running "gdb mytest" on the host and then "target remote mytarget:6666".
But I don't understand something about "gdb mytest" . At this time should I run a x86 "gdb" or something like "powerpc-linux-gdb"? And the "mytest"? Is it compiled with x86 gcc or cross-compiled with "powerpc-linux-gcc"? Really I am very confused at this point:-((
Do you have any experience to share with me about how to build
and run gdbserver?
Or do you have any other debug tools which can be used in embedded-linux environment?
The README for gdbserver is written by Stu Grossman and Fred
Fish.
Does someone know their email address?
Thank you very much:-)
dony

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"dony" == dony <[email protected]> writes:

dony> Hello,

dony> Now I want to use gdbserver to debug my test app.
dony> Running "gdbserver :6666 ./mytest" on the target (Powerpc 860) dony> show a message: Process ./mytest created :pid=8 But I don't know dony> how to run gdb on the host (X86). The README doesn't seem to dony> explain clearly . It says first running "gdb mytest" on the host dony> and then "target remote mytarget:6666". But I don't understand dony> something about "gdb mytest" . At this time should I run a x86 dony> "gdb" or something like "powerpc-linux-gdb"? And the "mytest"?

mytest is the same executable you run on the target. gdb you run on the host would be powerpc-linux-gdb (i.e., cross-debugger), thus:

target:> gdbserver :6666 ./mytest

host:> powerpc-linux-gdb mytest
[...]
(gdb) target remote mytarget:6666

dony> Is it compiled with x86 gcc or cross-compiled with dony> "powerpc-linux-gcc"? Really I am very confused at this point:-((

mytest is compiled with powerpc-linux-gcc.

dony> Do you have any experience to share with me about how to build dony> and run gdbserver? Or do you have any other debug tools which dony> can be used in embedded-linux environment? The README for dony> gdbserver is written by Stu Grossman and Fred Fish. Does dony> someone know their email address? Thank you very much:-) dony

Yes I know their email addresses. But you don't want to hassle them with this. Trust me :)

Jesper

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#2 lore raw
Quoted 18 lines · Jesper Skov
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"dony" == dony <[email protected]> writes:

dony> Hello,

dony> Now I want to use gdbserver to debug my test app.
dony> Running "gdbserver :6666 ./mytest" on the target (Powerpc 860) dony> show a message: Process ./mytest created :pid=8 But I don't know dony> how to run gdb on the host (X86). The README doesn't seem to dony> explain clearly . It says first running "gdb mytest" on the host dony> and then "target remote mytarget:6666". But I don't understand dony> something about "gdb mytest" . At this time should I run a x86 dony> "gdb" or something like "powerpc-linux-gdb"? And the "mytest"?

mytest is the same executable you run on the target. gdb you run on the host would be powerpc-linux-gdb (i.e., cross-debugger), thus:

target:> gdbserver :6666 ./mytest

Quoted 8 lines

host:> powerpc-linux-gdb mytest
[...]
(gdb) target remote mytarget:6666

dony> Is it compiled with x86 gcc or cross-compiled with dony> "powerpc-linux-gcc"? Really I am very confused at this point:-((

mytest is compiled with powerpc-linux-gcc.

"powerpc-linux-gdb" is compiled with gcc or powerpc-linux-gcc?

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"dony" == dony <[email protected]> writes:

Quoted 2 lines · dony> Jesper Skov wrote:
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"dony" == dony <[email protected]> writes:

dony> Hello,

Quoted 1 line
Quoted 1 line

dony> Now I want to use gdbserver to debug my test app. Running dony> "gdbserver :6666 ./mytest" on the target (Powerpc 860) show a dony> message: Process ./mytest created :pid=8 But I don't know how to dony> run gdb on the host (X86). The README doesn't seem to explain dony> clearly . It says first running "gdb mytest" on the host and dony> then "target remote mytarget:6666". But I don't understand dony> something about "gdb mytest" . At this time should I run a x86 dony> "gdb" or something like "powerpc-linux-gdb"? And the "mytest"?

Quoted 9 lines
Quoted 9 lines

mytest is the same executable you run on the target. gdb you run
on the host would be powerpc-linux-gdb (i.e., cross-debugger), thus:

target:> gdbserver :6666 ./mytest

host:> powerpc-linux-gdb mytest [...] (gdb) target remote mytarget:6666

dony> Is it compiled with x86 gcc or cross-compiled with dony> "powerpc-linux-gcc"? Really I am very confused at this point:-((

Quoted 1 line
Quoted 1 line

mytest is compiled with powerpc-linux-gcc.

dony> "powerpc-linux-gdb" is compiled with gcc or powerpc-linux-gcc?

gcc. You should look at one of the FAQ/HOWTO/READMEs/Home pages on the sucject of embedded development. I think there was posted a small howto on compiling the components a few days back. Check the archive.

One question: you are using an x86 host, right? If you use a PPC host, you can just use the preinstalled GDB/GCC when building/debugging the target binary.

dony>How do you build you powerpc-linux-gdb?
dony>I copy a gdb-4.17.tar.gz from LinuxPPC R4 CD.
dony>When I untar and decompress it, I type the following under gdb-4.17/gdb dony>directory:
dony>
dony> ./configure --target=powerpc-linux
dony> make
dony>
dony> It fails to compile and say:
dony> make:*** No rule to make target ../bfd/bfd.h, needed by blockframe.o.Stop. dony>
dony>Yes, there is not bfd.h under gdb-4.17/bfd directory.
dony>Do you know why?
dony>Thank you very much.

I don't know why. It's an old debugger. I think we keep a more recent version / CVS tree on sourceware.cygnus.com. It may work better. The howto I mentioned before included links to the archives used, as far as I remember.

Jesper

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#4 lore raw

How to gdbserver...

In reply to Jesper Skov
Quoted 13 lines · Jesper Skov
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"dony" == dony <[email protected]> writes:

dony> Hello,

dony> Now I want to use gdbserver to debug my test app.
dony> Running "gdbserver :6666 ./mytest" on the target (Powerpc 860) dony> show a message: Process ./mytest created :pid=8 But I don't know dony> how to run gdb on the host (X86). The README doesn't seem to dony> explain clearly . It says first running "gdb mytest" on the host dony> and then "target remote mytarget:6666". But I don't understand dony> something about "gdb mytest" . At this time should I run a x86 dony> "gdb" or something like "powerpc-linux-gdb"? And the "mytest"?

Quoted 8 lines

mytest is the same executable you run on the target. gdb you run on the host would be powerpc-linux-gdb (i.e., cross-debugger), thus:

target:> gdbserver :6666 ./mytest

host:> powerpc-linux-gdb mytest
[...]
(gdb) target remote mytarget:6666

Hi, Jesper:
Following the above steps, now my host can connect with target.
Because I can see the following messages from host and target respectively:

[target] IP=10.11.27.244
./gdbserver :6666 ./mytest
Process ./mytest created; pid=19
Remote debugging using :6666

[host] which is a x86 box
powerpc-linux-gdb --baud 9600 mytest
(gdb)target remote 10.11.27.244:6666
Remote debugging using 10.11.27.244:6666
0x30016a7c in ??()
(gdb)

Has the host and the target been connected via network yet? If so, I type "run" after (gdb) at host side, then (gdb)run
The program being debugged has been started already Start it from the begging?(y or n) y
Starting program: /mytest/mytest
Don't know how to run. Try "help target".

I don't know why the program is running at this time. type "list" can show my source code.
type "b main" can set breakpoint .
(gdb) b main
Breakpoint 1 at 0x10000328:file mytest.c, line 4. (gdb) s
Cannot find bounds of current function

I don't know why I cannot run the program at host side. Am I missing something?
I am pretty new with "GDB" debug.
Can some gurus give me some advices?
Thanks very much.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw

Re: How to gdbserver...

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"dony" == dony <[email protected]> writes:

dony> Has the host and the target been connected via network yet? If

They have,

dony> so, I type "run" after (gdb) at host side, then (gdb)run The dony> program being debugged has been started already Start it from dony> the begging?(y or n) y Starting program: /mytest/mytest Don't dony> know how to run. Try "help target".

You need to use 'continue'.

dony> I don't know why the program is running at this time. type dony> "list" can show my source code. type "b main" can set dony> breakpoint . (gdb) b main Breakpoint 1 at 0x10000328:file dony> mytest.c, line 4. (gdb) s Cannot find bounds of current dony> function

dony> I don't know why I cannot run the program at host side. Am I dony> missing something? I am pretty new with "GDB" debug. Can some dony> gurus give me some advices? Thanks very much.

info gdb
man gdb

Jesper

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#6 lore raw

Looking for a better debug tool for embed-environment...

Hi,
Now I am looking for a friendly GUI debug tool for our
embed-linux-environment.
Do you know other debug tools which can be used in embed-environment?
The "gdbserver" and "powerpc-linux-gdb" are not friendly for debug,
especially in a large project.

Dony

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#7 lore raw

Re: Looking for a better debug tool for embed-environment...

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"dony" == dony <[email protected]> writes:

dony> Hi, Now I am looking for a friendly GUI debug tool for our dony> embed-linux-environment. Do you know other debug tools which dony> can be used in embed-environment? The "gdbserver" and dony> "powerpc-linux-gdb" are not friendly for debug, especially in a dony> large project.

DDD or Insight are the ones I know of. I think Insight is now available from sourceware.cygnus.com.

Jesper

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/