* GDB stub - connection from 32 bit GDB or 64 bit GDB
@ 2006-09-27 17:34 Mitchell Fang
2006-09-27 17:51 ` Daniel Jacobowitz
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Mitchell Fang @ 2006-09-27 17:34 UTC (permalink / raw)
To: gdb
Hi,
How can the gdb stub know if a 32 bit GDB is connecting to the stub
or a 64 bit GDB is connecting to the stub? Is it even possible? It
doesn't seem possible to me looking at the current gdb remote
commands, but hopefully I overlooked something.
I have tried different combinations with 32-bit and 64-bit GDBs and
gdbservers and it seems like a 32 bit GDB will not work with a 64 bit
gdbserver and vice versa.
Thanks for you help.
Mitchell
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: GDB stub - connection from 32 bit GDB or 64 bit GDB
2006-09-27 17:34 GDB stub - connection from 32 bit GDB or 64 bit GDB Mitchell Fang
@ 2006-09-27 17:51 ` Daniel Jacobowitz
2006-09-27 18:17 ` Mitchell Fang
2006-09-27 18:27 ` Michael Snyder
2006-09-27 19:58 ` Jim Blandy
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-09-27 17:51 UTC (permalink / raw)
To: Mitchell Fang; +Cc: gdb
It always amazes me how a problem will be known but quiet for a couple
of years, and then half a dozen people will look at it at once :-)
On Wed, Sep 27, 2006 at 10:34:45AM -0700, Mitchell Fang wrote:
> Hi,
>
> How can the gdb stub know if a 32 bit GDB is connecting to the stub
> or a 64 bit GDB is connecting to the stub? Is it even possible? It
> doesn't seem possible to me looking at the current gdb remote
> commands, but hopefully I overlooked something.
It's not possible.
> I have tried different combinations with 32-bit and 64-bit GDBs and
> gdbservers and it seems like a 32 bit GDB will not work with a 64 bit
> gdbserver and vice versa.
The stub shouldn't adapt: the GDB client should. This may be of
interest:
http://sourceware.org/ml/gdb-patches/2006-09/msg00187.html
http://sourceware.org/ml/gdb-patches/2006-09/msg00188.html
I'm less optimistic I'll have my code out this week, but I'm still
trying. What architecture are you using?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub - connection from 32 bit GDB or 64 bit GDB
2006-09-27 17:51 ` Daniel Jacobowitz
@ 2006-09-27 18:17 ` Mitchell Fang
2006-09-27 18:22 ` Jan Kratochvil
0 siblings, 1 reply; 6+ messages in thread
From: Mitchell Fang @ 2006-09-27 18:17 UTC (permalink / raw)
To: gdb
On 9/27/06, Daniel Jacobowitz <drow@false.org> wrote:
> It always amazes me how a problem will be known but quiet for a couple
> of years, and then half a dozen people will look at it at once :-)
>
> On Wed, Sep 27, 2006 at 10:34:45AM -0700, Mitchell Fang wrote:
> > Hi,
> >
> > How can the gdb stub know if a 32 bit GDB is connecting to the stub
> > or a 64 bit GDB is connecting to the stub? Is it even possible? It
> > doesn't seem possible to me looking at the current gdb remote
> > commands, but hopefully I overlooked something.
>
> It's not possible.
>
> > I have tried different combinations with 32-bit and 64-bit GDBs and
> > gdbservers and it seems like a 32 bit GDB will not work with a 64 bit
> > gdbserver and vice versa.
>
> The stub shouldn't adapt: the GDB client should. This may be of
> interest:
> http://sourceware.org/ml/gdb-patches/2006-09/msg00187.html
> http://sourceware.org/ml/gdb-patches/2006-09/msg00188.html
>
> I'm less optimistic I'll have my code out this week, but I'm still
> trying. What architecture are you using?
The target architecture is PowerPC and the host architecture is i686 cygwin.
Thanks for your help and I will await your patch.
Mitchell
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub - connection from 32 bit GDB or 64 bit GDB
2006-09-27 17:34 GDB stub - connection from 32 bit GDB or 64 bit GDB Mitchell Fang
2006-09-27 17:51 ` Daniel Jacobowitz
@ 2006-09-27 18:27 ` Michael Snyder
2006-09-27 19:58 ` Jim Blandy
2 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2006-09-27 18:27 UTC (permalink / raw)
To: Mitchell Fang; +Cc: gdb
On Wed, 2006-09-27 at 10:34 -0700, Mitchell Fang wrote:
> Hi,
>
> How can the gdb stub know if a 32 bit GDB is connecting to the stub
> or a 64 bit GDB is connecting to the stub? Is it even possible? It
> doesn't seem possible to me looking at the current gdb remote
> commands, but hopefully I overlooked something.
> I have tried different combinations with 32-bit and 64-bit GDBs and
> gdbservers and it seems like a 32 bit GDB will not work with a 64 bit
> gdbserver and vice versa.
In general, a stub is built for a single architecture, while gdb
may be built to handle several architecture variants (such as 32 bit
and 64 bit versions of the same processor family). Therefore in
practice, to my knowledge, it's never the stub that adapts to gdb,
it's gdb that adapts to the stub.
That's not to say that it's prohibited, but there's currently
no provision for it in the remote protocol.
However, there *is* provision for a general purpose query
(get/set) request. You could use that to, say, tell your
(custom) stub which version of the architecture you wanted
to talk to.
See the "Q"/"q" messages.
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub - connection from 32 bit GDB or 64 bit GDB
2006-09-27 17:34 GDB stub - connection from 32 bit GDB or 64 bit GDB Mitchell Fang
2006-09-27 17:51 ` Daniel Jacobowitz
2006-09-27 18:27 ` Michael Snyder
@ 2006-09-27 19:58 ` Jim Blandy
2 siblings, 0 replies; 6+ messages in thread
From: Jim Blandy @ 2006-09-27 19:58 UTC (permalink / raw)
To: Mitchell Fang; +Cc: gdb
"Mitchell Fang" <mitchell.fang@gmail.com> writes:
> How can the gdb stub know if a 32 bit GDB is connecting to the stub
> or a 64 bit GDB is connecting to the stub? Is it even possible? It
> doesn't seem possible to me looking at the current gdb remote
> commands, but hopefully I overlooked something.
> I have tried different combinations with 32-bit and 64-bit GDBs and
> gdbservers and it seems like a 32 bit GDB will not work with a 64 bit
> gdbserver and vice versa.
You haven't provided enough information for us to help you.
I assume you're having some troubles connecting a particular GDB with
a particular stub, but when you wrote your message, you guessed that
the problem was a 32-bit vs. 64-bit problem, and then wrote your
message to provide only enough information for us to help you *if*
your guess was right.
Instead, simply describe to us the problem you're having, without
guessing about the underlying cause:
- What is the program you're trying to debug running on? What
processor architecture? Is it an evaluation board?
- What kind of machine is GDB running on? What operating system is it
running?
- How is GDB connecting to the program you're trying to debug? The
remote protocol? gdbserver? RedBoot? A custom stub built into the
eval board?
- What happened when you tried to connect? What was the exact error
message? Can you cut and paste the session from your terminal?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-27 19:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-27 17:34 GDB stub - connection from 32 bit GDB or 64 bit GDB Mitchell Fang
2006-09-27 17:51 ` Daniel Jacobowitz
2006-09-27 18:17 ` Mitchell Fang
2006-09-27 18:22 ` Jan Kratochvil
2006-09-27 18:27 ` Michael Snyder
2006-09-27 19:58 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox