public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb tcp connection closing
@ 2018-09-20 22:49 Bill Morgan
  2018-09-21  4:49 ` Christo
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Morgan @ 2018-09-20 22:49 UTC (permalink / raw)
  To: gdb

I'm trying to write a GDB stub for an embedded application

For some reason the GDB host is closing the TCP connection after it
requests qOffsets, and the stub sends an empty reply.

Is that expected?

Here is the entire conversation:

Host:
.+$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df

Target: +$PacketSize=3fff;QPassSignals+;qXfer:features:read+#8f

Host: +$vMustReplyEmpty#3a

Target: +$#00

Host: +$Hg0#df

Target: +$OK#9a

Host: +$qXfer:features:read:target.xml:0,fff#7d

Target: +$l<target><architecture>arm</architecture></target>#06

Host: +$qTStatus#49

Target: +$#00

Host: +$?#3f

Target: +$T050b:0*"00;0d:e07f2030;0f:10533060;thread:9#24

Host: +$qfThreadInfo#bb

Target: +$m9#a6

Host: +$qsThreadInfo#c8

Target: +$me#d2

Host: +$qsThreadInfo#c8

Target: +$mf#d3

Host: +$qsThreadInfo#c8

Target: +$m13#d1

Host: +$qsThreadInfo#c8

Target: +$l#6c

Host: +$qAttached#8f

Target: +$1#31

Host: +$Hc-1#09

Target: +$OK#9a

Host: +$qOffsets#4b

Target: +$#00

Host: +

Host closes connection

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

* Re: gdb tcp connection closing
  2018-09-20 22:49 gdb tcp connection closing Bill Morgan
@ 2018-09-21  4:49 ` Christo
  2018-09-21 12:57   ` Bill Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Christo @ 2018-09-21  4:49 UTC (permalink / raw)
  To: gdb; +Cc: Bill Morgan

On Thu, 2018-09-20 at 17:48 -0500, Bill Morgan wrote:
> I'm trying to write a GDB stub for an embedded application
> 
> For some reason the GDB host is closing the TCP connection after it
> requests qOffsets, and the stub sends an empty reply.
> 
> Is that expected?

Have you activated the debug remote option in gdb (set debug remote 1)? This is sometimes useful
in pinpointing rsp problems.

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

* Re: gdb tcp connection closing
  2018-09-21  4:49 ` Christo
@ 2018-09-21 12:57   ` Bill Morgan
  2018-09-21 13:16     ` Bill Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Morgan @ 2018-09-21 12:57 UTC (permalink / raw)
  To: christo.crause; +Cc: gdb

On Thu, Sep 20, 2018 at 11:49 PM Christo <christo.crause@gmail.com> wrote:

> On Thu, 2018-09-20 at 17:48 -0500, Bill Morgan wrote:
> > I'm trying to write a GDB stub for an embedded application
> >
> > For some reason the GDB host is closing the TCP connection after it
> > requests qOffsets, and the stub sends an empty reply.
> >
> > Is that expected?
>
> Have you activated the debug remote option in gdb (set debug remote 1)?
> This is sometimes useful
> in pinpointing rsp problems.
>

Thanks. It is saying the remote register packet is badly formatted.

Which part of the packet is wrong?

gdb.error: Remote register badly formatted:
T050b:00000000;0d:d87e2030;0f:d4523060;thread:9

signal: 05
reg 0b (r11):00000000
reg 0d (sp):d87e2030
reg 0f: (pc): d4523060
thread: 9

full output:

Sending packet:
$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df...Ack
Packet received: PacketSize=3fff;QPassSignals+;qXfer:features:read+
Packet qSupported (supported-packets) is supported
Sending packet: $vMustReplyEmpty#3a...Ack
Packet received:
Sending packet: $Hg0#df...Ack
Packet received: OK
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Ack
Packet received: l<target><architecture>arm</architecture></target>
Sending packet: $qTStatus#49...Ack
Packet received:
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Ack
Packet received: T050b:00000000;0d:d87e2030;0f:d4523060;thread:9
Sending packet: $qfThreadInfo#bb...Ack
Packet received: m9
Sending packet: $qsThreadInfo#c8...Ack
Packet received: me
Sending packet: $qsThreadInfo#c8...Ack
Packet received: mf
Sending packet: $qsThreadInfo#c8...Ack
Packet received: m13
Sending packet: $qsThreadInfo#c8...Ack
Packet received: l
Sending packet: $qAttached#8f...Ack
Packet received: 1
Packet qAttached (query-attached) is supported
Sending packet: $Hc-1#09...Ack
Packet received: OK
Sending packet: $qOffsets#4b...Ack
Packet received:
Traceback (most recent call last):
  File "gdbinit_hosted_apps.py", line 92, in <module>
    gdb.execute( 'target remote ' + target_path )
gdb.error: Remote register badly formatted:
T050b:00000000;0d:d87e2030;0f:d4523060;thread:9
here:
(gdb)

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

* Re: gdb tcp connection closing
  2018-09-21 12:57   ` Bill Morgan
@ 2018-09-21 13:16     ` Bill Morgan
  0 siblings, 0 replies; 4+ messages in thread
From: Bill Morgan @ 2018-09-21 13:16 UTC (permalink / raw)
  To: christo.crause; +Cc: gdb

On Fri, Sep 21, 2018 at 7:56 AM Bill Morgan <arthurwilliammorgan@gmail.com>
wrote:

>
> On Thu, Sep 20, 2018 at 11:49 PM Christo <christo.crause@gmail.com> wrote:
>
>> On Thu, 2018-09-20 at 17:48 -0500, Bill Morgan wrote:
>> > I'm trying to write a GDB stub for an embedded application
>> >
>> > For some reason the GDB host is closing the TCP connection after it
>> > requests qOffsets, and the stub sends an empty reply.
>> >
>> > Is that expected?
>>
>> Have you activated the debug remote option in gdb (set debug remote 1)?
>> This is sometimes useful
>> in pinpointing rsp problems.
>>
>
> Thanks. It is saying the remote register packet is badly formatted.
>
> Which part of the packet is wrong?
>
> gdb.error: Remote register badly formatted:
> T050b:00000000;0d:d87e2030;0f:d4523060;thread:9
>

I was missing the trailing semicolon ';'

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

end of thread, other threads:[~2018-09-21 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 22:49 gdb tcp connection closing Bill Morgan
2018-09-21  4:49 ` Christo
2018-09-21 12:57   ` Bill Morgan
2018-09-21 13:16     ` Bill Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).