Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdbserver with X86_64
@ 2006-09-01 12:44 Cai Qian
  2006-09-01 12:51 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Cai Qian @ 2006-09-01 12:44 UTC (permalink / raw)
  To: gdb

Hi,

I tried to use gdbserver in AMD64 machine. I have done the following,

1)  # Compile example C code to generate a 64bit binary.
cat > hello.c<<EOF

#include <stdio.h>

int
main (void)
{
    printf ("Hello World\n");
    return 0;
}

EOF
gcc -g hello.c -o hello

2)  # Run gdbserver in localhost.
gdbserver localhost:22222 hello

3) # Connect to gdbserver locally.
gdb
...
"This GDB was configured as x86_64-linux-gun"
(gdb) target remote localhost:22222

OUTPUT:
on client side, I have gotten,

Remote debugging using localhost:22222
Remote register badly formatted:
T0506:0000000000000000;07:50619fffff7f0000;10:70ea33b3202b0000;
here: 0000000;07:c0e095ffff7f0000;10:700a3d4b192b0000;

on server side, I have gotten,

Remote debugging from host 127.0.0.1
readchar: Got EOF
Remote side has terminated connection. GDBserver will reopen the connection
Listening on port 22222

I have also tried on a i386 box. I works fine. Is it a bug or I have
done something wrong?

Qian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gdbserver with X86_64
  2006-09-01 12:44 gdbserver with X86_64 Cai Qian
@ 2006-09-01 12:51 ` Daniel Jacobowitz
  2006-09-01 13:31   ` Cai Qian
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-09-01 12:51 UTC (permalink / raw)
  To: Cai Qian; +Cc: gdb

On Fri, Sep 01, 2006 at 01:44:06PM +0100, Cai Qian wrote:
> 3) # Connect to gdbserver locally.
> gdb
> ...
> "This GDB was configured as x86_64-linux-gun"
> (gdb) target remote localhost:22222

You need to give GDB a binary file before you connect.  Otherwise, 
it is defaulting to 32-bit registers.

You should always do this, on every platform.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gdbserver with X86_64
  2006-09-01 12:51 ` Daniel Jacobowitz
@ 2006-09-01 13:31   ` Cai Qian
  2006-09-01 14:13     ` Daniel Jacobowitz
  2006-09-01 21:01     ` Michael Snyder
  0 siblings, 2 replies; 6+ messages in thread
From: Cai Qian @ 2006-09-01 13:31 UTC (permalink / raw)
  To: Cai Qian, gdb

Hi,

On 9/1/06, Daniel Jacobowitz <drow@false.org> wrote:
> On Fri, Sep 01, 2006 at 01:44:06PM +0100, Cai Qian wrote:
> > 3) # Connect to gdbserver locally.
> > gdb
> > ...
> > "This GDB was configured as x86_64-linux-gun"
> > (gdb) target remote localhost:22222
>
> You need to give GDB a binary file before you connect.  Otherwise,
> it is defaulting to 32-bit registers.
>
> You should always do this, on every platform.
>

Oh, I see. Just realised

set architecture i386:x86-64

also work for me. However, it seems there is a problem with single step,

(gdb) s
Cannot find bounds of current function

"si" do work though.

> --
> Daniel Jacobowitz
> CodeSourcery
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gdbserver with X86_64
  2006-09-01 13:31   ` Cai Qian
@ 2006-09-01 14:13     ` Daniel Jacobowitz
  2006-09-01 14:27       ` Andrew STUBBS
  2006-09-01 21:01     ` Michael Snyder
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-09-01 14:13 UTC (permalink / raw)
  To: Cai Qian; +Cc: gdb

On Fri, Sep 01, 2006 at 02:31:50PM +0100, Cai Qian wrote:
> Oh, I see. Just realised
> 
> set architecture i386:x86-64
> 
> also work for me. However, it seems there is a problem with single step,
> 
> (gdb) s
> Cannot find bounds of current function

This is the standard error when you aren't somewhere with source
debugging information; if you have a symbol file loaded, and are
stopped in it (instead of in the startup code) it should go away.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gdbserver with X86_64
  2006-09-01 14:13     ` Daniel Jacobowitz
@ 2006-09-01 14:27       ` Andrew STUBBS
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew STUBBS @ 2006-09-01 14:27 UTC (permalink / raw)
  To: Cai Qian, gdb

Daniel Jacobowitz wrote:
> On Fri, Sep 01, 2006 at 02:31:50PM +0100, Cai Qian wrote:
>> Oh, I see. Just realised
>>
>> set architecture i386:x86-64
>>
>> also work for me. However, it seems there is a problem with single step,
>>
>> (gdb) s
>> Cannot find bounds of current function
> 
> This is the standard error when you aren't somewhere with source
> debugging information; if you have a symbol file loaded, and are
> stopped in it (instead of in the startup code) it should go away.

Perhaps the message ought to be improved. I doubt this is the first time 
a user has not understood it. There are probably other examples of 'I 
can't do that' with only a cryptic internal reason given.

It might be enough to change it to "Not enough information to step a 
source line (cannot find bounds of current function)."

Otherwise, GDB should either try to find out why there were no function 
bounds (e.g "You can't do this without a program loaded"), or else it 
should add an extra message "This usually means there is no debug info 
for this part of the program."

Just a thought.

Andrew


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gdbserver with X86_64
  2006-09-01 13:31   ` Cai Qian
  2006-09-01 14:13     ` Daniel Jacobowitz
@ 2006-09-01 21:01     ` Michael Snyder
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2006-09-01 21:01 UTC (permalink / raw)
  To: Cai Qian; +Cc: gdb

On Fri, 2006-09-01 at 14:31 +0100, Cai Qian wrote:
> Hi,
> 
> On 9/1/06, Daniel Jacobowitz <drow@false.org> wrote:
> > On Fri, Sep 01, 2006 at 01:44:06PM +0100, Cai Qian wrote:
> > > 3) # Connect to gdbserver locally.
> > > gdb
> > > ...
> > > "This GDB was configured as x86_64-linux-gun"
> > > (gdb) target remote localhost:22222
> >
> > You need to give GDB a binary file before you connect.  Otherwise,
> > it is defaulting to 32-bit registers.
> >
> > You should always do this, on every platform.
> >
> 
> Oh, I see. Just realised
> 
> set architecture i386:x86-64
> 
> also work for me. However, it seems there is a problem with single step,
> 
> (gdb) s
> Cannot find bounds of current function
> 
> "si" do work though.

"Step" is a source-level command.  It can't work without 
line number symbols.  Load up a symbol file before trying
to use "step".  

Of course stepi (step by instruction) will most always work.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-09-01 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-01 12:44 gdbserver with X86_64 Cai Qian
2006-09-01 12:51 ` Daniel Jacobowitz
2006-09-01 13:31   ` Cai Qian
2006-09-01 14:13     ` Daniel Jacobowitz
2006-09-01 14:27       ` Andrew STUBBS
2006-09-01 21:01     ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox