* gdbserver 7.1 unable to read registers
@ 2010-09-23 17:17 William Wagner
2010-09-24 7:47 ` Jan Kratochvil
2010-09-24 12:58 ` Ulrich Weigand
0 siblings, 2 replies; 12+ messages in thread
From: William Wagner @ 2010-09-23 17:17 UTC (permalink / raw)
To: 'gdb@sourceware.org'
Hello All,
I have built up a cross toolchain for an arm target with an x64 host. I
have compiled gdb/gdbserver 7.1.
When I try to debug my application I can connect to gdbserver fine but I
get an error when gdb tries to read the registers:
Remote 'g' packet reply is too long:
00000000b07edbbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c07ddbbe00000000a007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
As far as I can tell the error is because the target and the host
disagree as to how many registers there are on the target, however I
compiled gdb and gdbserver with the same options.
How can I tell what register information gdb is expecting? Is there some
either a compile time or runtime option I need to set with gdb so they
agree on numbers of registers?
Thanks
Will
--
------------------------------------------------------------------------
Will Wagner will_wagner@carallon.com
Development Manager Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-23 17:17 gdbserver 7.1 unable to read registers William Wagner
@ 2010-09-24 7:47 ` Jan Kratochvil
2010-09-24 7:54 ` William Wagner
2010-09-24 13:30 ` Jon Smirl
2010-09-24 12:58 ` Ulrich Weigand
1 sibling, 2 replies; 12+ messages in thread
From: Jan Kratochvil @ 2010-09-24 7:47 UTC (permalink / raw)
To: William Wagner; +Cc: 'gdb@sourceware.org'
On Thu, 23 Sep 2010 19:16:58 +0200, William Wagner wrote:
> Remote 'g' packet reply is too long: 00000000b07edbbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c07ddbbe00000000a007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>
> As far as I can tell the error is because the target and the host
> disagree as to how many registers there are on the target,
While I have seen it only on i386<->x86_64 it should be the same problem:
http://sourceware.org/gdb/wiki/FAQ#line-53
15. When connecting to gdbserver I get Remote register badly formatted, g packet
reply to long etc.
Your gdb 32bit/64bit architecture setting may not match that of gdbserver. Try
to load the executable by file first. You may also check set/show architecture.
Regards,
Jan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 7:47 ` Jan Kratochvil
@ 2010-09-24 7:54 ` William Wagner
2010-09-24 13:30 ` Jon Smirl
1 sibling, 0 replies; 12+ messages in thread
From: William Wagner @ 2010-09-24 7:54 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: 'gdb@sourceware.org'
On 24/09/2010 08:47, Jan Kratochvil wrote:
> On Thu, 23 Sep 2010 19:16:58 +0200, William Wagner wrote:
>> Remote 'g' packet reply is too long: 00000000b07edbbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c07ddbbe00000000a007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>>
>> As far as I can tell the error is because the target and the host
>> disagree as to how many registers there are on the target,
> While I have seen it only on i386<->x86_64 it should be the same problem:
> http://sourceware.org/gdb/wiki/FAQ#line-53
> 15. When connecting to gdbserver I get Remote register badly formatted, g packet
> reply to long etc.
> Your gdb 32bit/64bit architecture setting may not match that of gdbserver. Try
> to load the executable by file first. You may also check set/show architecture.
>
Thanks, I had seen that also. I am already passing in the unstripped
executable when I call gdb so I think it should have been set already. I
try showing the architecture but it just reports arm which is not
specific enough to give me a clue what is wrong, I assume it is some
mismatch in expected floating point registers.
Will
--
------------------------------------------------------------------------
Will Wagner will_wagner@carallon.com
Development Manager Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-23 17:17 gdbserver 7.1 unable to read registers William Wagner
2010-09-24 7:47 ` Jan Kratochvil
@ 2010-09-24 12:58 ` Ulrich Weigand
2010-09-24 13:36 ` Pedro Alves
1 sibling, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2010-09-24 12:58 UTC (permalink / raw)
To: William Wagner; +Cc: 'gdb@sourceware.org'
William Wagner wrote:
> I have built up a cross toolchain for an arm target with an x64 host. I
> have compiled gdb/gdbserver 7.1.
>
> When I try to debug my application I can connect to gdbserver fine but I
> get an error when gdb tries to read the registers:
>
> Remote 'g' packet reply is too long:
> 00000000b07edbbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c07ddbbe00000000a007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>
> As far as I can tell the error is because the target and the host
> disagree as to how many registers there are on the target, however I
> compiled gdb and gdbserver with the same options.
>
> How can I tell what register information gdb is expecting? Is there some
> either a compile time or runtime option I need to set with gdb so they
> agree on numbers of registers?
Usually, gdbserver will inform GDB via the remote protocol about the
set of registers supported on the platform, and GDB is supposed to
automatically take that information into account.
However, this requires that GDB is built to include XML support to
parse this configuration information; if the expat libraries were
not available when you built GDB, the configure process might have
decided to build GDB without XML support instead ...
Can you try rebuilding with the --with-expat configure option?
This will cause the build to fail if XML support is not available.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 7:47 ` Jan Kratochvil
2010-09-24 7:54 ` William Wagner
@ 2010-09-24 13:30 ` Jon Smirl
1 sibling, 0 replies; 12+ messages in thread
From: Jon Smirl @ 2010-09-24 13:30 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: William Wagner, gdb
On Fri, Sep 24, 2010 at 3:47 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Thu, 23 Sep 2010 19:16:58 +0200, William Wagner wrote:
>> Remote 'g' packet reply is too long: 00000000b07edbbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c07ddbbe00000000a007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>>
>> As far as I can tell the error is because the target and the host
>> disagree as to how many registers there are on the target,
>
> While I have seen it only on i386<->x86_64 it should be the same problem:
> http://sourceware.org/gdb/wiki/FAQ#line-53
> 15. When connecting to gdbserver I get Remote register badly formatted, g packet
> reply to long etc.
> Your gdb 32bit/64bit architecture setting may not match that of gdbserver. Try
> to load the executable by file first. You may also check set/show architecture.
I couldn't figure out a solution to this error for months until I
stumbled onto this conversation:
http://old.nabble.com/Switching-architectures-from-a-remote-target-td27458511.html
I gave up on 64b qemu kernel debugging and went back to 32b.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 12:58 ` Ulrich Weigand
@ 2010-09-24 13:36 ` Pedro Alves
2010-09-24 13:44 ` William Wagner
2010-09-24 14:05 ` Ulrich Weigand
0 siblings, 2 replies; 12+ messages in thread
From: Pedro Alves @ 2010-09-24 13:36 UTC (permalink / raw)
To: gdb; +Cc: Ulrich Weigand, William Wagner
On Friday 24 September 2010 13:58:08, Ulrich Weigand wrote:
> Usually, gdbserver will inform GDB via the remote protocol about the
> set of registers supported on the platform, and GDB is supposed to
> automatically take that information into account.
>
> However, this requires that GDB is built to include XML support to
> parse this configuration information; if the expat libraries were
> not available when you built GDB, the configure process might have
> decided to build GDB without XML support instead ...
> Can you try rebuilding with the --with-expat configure option?
> This will cause the build to fail if XML support is not available.
Note that GDB issues a warning at connect time in that case:
"Can not parse XML target description; XML support was disabled at compile time"
--
Pedro Alves
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 13:36 ` Pedro Alves
@ 2010-09-24 13:44 ` William Wagner
2010-09-24 14:05 ` Ulrich Weigand
1 sibling, 0 replies; 12+ messages in thread
From: William Wagner @ 2010-09-24 13:44 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, Ulrich Weigand
On 24/09/2010 14:36, Pedro Alves wrote:
> On Friday 24 September 2010 13:58:08, Ulrich Weigand wrote:
>
>> Usually, gdbserver will inform GDB via the remote protocol about the
>> set of registers supported on the platform, and GDB is supposed to
>> automatically take that information into account.
>>
>> However, this requires that GDB is built to include XML support to
>> parse this configuration information; if the expat libraries were
>> not available when you built GDB, the configure process might have
>> decided to build GDB without XML support instead ...
>> Can you try rebuilding with the --with-expat configure option?
>> This will cause the build to fail if XML support is not available.
> Note that GDB issues a warning at connect time in that case:
>
> "Can not parse XML target description; XML support was disabled at compile time"
When I run gdb I see that warning, did not realise what the consequence
of not having XML support was. Will recompile with expat and see if that
fixes it.
Thanks everyone for the help.
Will
--
------------------------------------------------------------------------
Will Wagner will_wagner@carallon.com
Development Manager Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 13:36 ` Pedro Alves
2010-09-24 13:44 ` William Wagner
@ 2010-09-24 14:05 ` Ulrich Weigand
2010-09-24 14:39 ` Pedro Alves
1 sibling, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2010-09-24 14:05 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, William Wagner
Pedro Alves wrote:
> On Friday 24 September 2010 13:58:08, Ulrich Weigand wrote:
>
> > Usually, gdbserver will inform GDB via the remote protocol about the
> > set of registers supported on the platform, and GDB is supposed to
> > automatically take that information into account.
> >
> > However, this requires that GDB is built to include XML support to
> > parse this configuration information; if the expat libraries were
> > not available when you built GDB, the configure process might have
> > decided to build GDB without XML support instead ...
> > Can you try rebuilding with the --with-expat configure option?
> > This will cause the build to fail if XML support is not available.
>
> Note that GDB issues a warning at connect time in that case:
>
> "Can not parse XML target description; XML support was disabled at compile time"
As we have more and more platforms where gdbserver simply will not work
correctly without XML support, maybe we should make --with-expat the
default mode at some point in time? Users would still be able to
build with --without-expat if they really want to ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 14:05 ` Ulrich Weigand
@ 2010-09-24 14:39 ` Pedro Alves
2010-09-27 10:25 ` Steffen Dettmer
2010-10-07 17:16 ` Ulrich Weigand
0 siblings, 2 replies; 12+ messages in thread
From: Pedro Alves @ 2010-09-24 14:39 UTC (permalink / raw)
To: gdb; +Cc: Ulrich Weigand, William Wagner
On Friday 24 September 2010 15:05:11, Ulrich Weigand wrote:
> Pedro Alves wrote:
> > On Friday 24 September 2010 13:58:08, Ulrich Weigand wrote:
> >
> > > Usually, gdbserver will inform GDB via the remote protocol about the
> > > set of registers supported on the platform, and GDB is supposed to
> > > automatically take that information into account.
> > >
> > > However, this requires that GDB is built to include XML support to
> > > parse this configuration information; if the expat libraries were
> > > not available when you built GDB, the configure process might have
> > > decided to build GDB without XML support instead ...
> > > Can you try rebuilding with the --with-expat configure option?
> > > This will cause the build to fail if XML support is not available.
> >
> > Note that GDB issues a warning at connect time in that case:
> >
> > "Can not parse XML target description; XML support was disabled at compile time"
>
> As we have more and more platforms where gdbserver simply will not work
> correctly without XML support, maybe we should make --with-expat the
> default mode at some point in time? Users would still be able to
> build with --without-expat if they really want to ...
I guess. Most native targets don't need it though.
On the other hand, there's scope for improvement in those warnings.
It's not surprising that users don't know the consequences of not
being able to parse a "XML target description" are. Making
those clearer in terms of consequences would probably already go a long way
in avoiding surprises. Something along the lines of:
"Can not parse XML target description; XML support was disabled at compile time. "
"GDB may not be able to read registers correctly."
?
--
Pedro Alves
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 14:39 ` Pedro Alves
@ 2010-09-27 10:25 ` Steffen Dettmer
2010-09-27 14:44 ` Daniel Jacobowitz
2010-10-07 17:16 ` Ulrich Weigand
1 sibling, 1 reply; 12+ messages in thread
From: Steffen Dettmer @ 2010-09-27 10:25 UTC (permalink / raw)
To: gdb
On Fri, Sep 24, 2010 at 4:39 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> On the other hand, there's scope for improvement in those warnings.
> It's not surprising that users don't know the consequences of not
> being able to parse a "XML target description" are. Making
> those clearer in terms of consequences would probably already
> go a long way in avoiding surprises. Something along the lines
> of:
>
> "Can not parse XML target description; XML support was
> disabled at compile time."
> "GDB may not be able to read registers correctly."
Yes, at least for me I never guessed that XML support is needed
to read registers... BTW, where can I learn more why XML is
suited and needed to read registers? XML remembers me to complex
stuff like parsers needing 10 MB source code, Unicode with
chinese characters, OpenOffice documents...
I do not see an XML warning message when gdb tries to connect,
but I have a problem with "call" in remote debugging
(arm-elf-nonlinux-gdb-7.20):
(gdb) p strlen("")
Could not write register "cpsr"; remote failure reply 'E00'
An error occurred while in a function called from GDB.
Evaluation of the expression containing the function
(malloc) will be abandoned.
When the function is done executing, GDB will silently stop.
Could this be caused by missing expat support, or would I
definitely see a XML warning message in case?
oki,
Steffen
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-27 10:25 ` Steffen Dettmer
@ 2010-09-27 14:44 ` Daniel Jacobowitz
0 siblings, 0 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2010-09-27 14:44 UTC (permalink / raw)
To: Steffen Dettmer; +Cc: gdb
On Mon, Sep 27, 2010 at 12:25:38PM +0200, Steffen Dettmer wrote:
> I do not see an XML warning message when gdb tries to connect,
> but I have a problem with "call" in remote debugging
> (arm-elf-nonlinux-gdb-7.20):
>
> (gdb) p strlen("")
> Could not write register "cpsr"; remote failure reply 'E00'
> An error occurred while in a function called from GDB.
> Evaluation of the expression containing the function
> (malloc) will be abandoned.
> When the function is done executing, GDB will silently stop.
>
> Could this be caused by missing expat support, or would I
> definitely see a XML warning message in case?
No, this will not be related. GDB always warns if it needs XML but
doesn't have expat.
This looks like a problem with your remote stub, specifically, what it
says on the cover: failed to write to cpsr.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gdbserver 7.1 unable to read registers
2010-09-24 14:39 ` Pedro Alves
2010-09-27 10:25 ` Steffen Dettmer
@ 2010-10-07 17:16 ` Ulrich Weigand
1 sibling, 0 replies; 12+ messages in thread
From: Ulrich Weigand @ 2010-10-07 17:16 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, William Wagner
Pedro Alves wrote:
> On Friday 24 September 2010 15:05:11, Ulrich Weigand wrote:
> > As we have more and more platforms where gdbserver simply will not work
> > correctly without XML support, maybe we should make --with-expat the
> > default mode at some point in time? Users would still be able to
> > build with --without-expat if they really want to ...
>
> I guess. Most native targets don't need it though.
OK, I see.
> On the other hand, there's scope for improvement in those warnings.
> It's not surprising that users don't know the consequences of not
> being able to parse a "XML target description" are. Making
> those clearer in terms of consequences would probably already go a long way
> in avoiding surprises. Something along the lines of:
>
> "Can not parse XML target description; XML support was disabled at compile time. "
> "GDB may not be able to read registers correctly."
This would certainly be helpful.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-10-07 17:16 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 17:17 gdbserver 7.1 unable to read registers William Wagner
2010-09-24 7:47 ` Jan Kratochvil
2010-09-24 7:54 ` William Wagner
2010-09-24 13:30 ` Jon Smirl
2010-09-24 12:58 ` Ulrich Weigand
2010-09-24 13:36 ` Pedro Alves
2010-09-24 13:44 ` William Wagner
2010-09-24 14:05 ` Ulrich Weigand
2010-09-24 14:39 ` Pedro Alves
2010-09-27 10:25 ` Steffen Dettmer
2010-09-27 14:44 ` Daniel Jacobowitz
2010-10-07 17:16 ` Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox