public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Interrupt packets in the remote protocol
@ 2007-11-03 17:25 Simon Kagstrom
  2007-11-04  3:08 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Kagstrom @ 2007-11-03 17:25 UTC (permalink / raw)
  To: gdb

Hello!

I'm developing a binary translator that translates MIPS binaries into
Java bytecode [1], which enables C/C++ programs to be executed on J2ME
platforms. To get good debugging support, I'm developing a GDB server
that connects to the Java JDB debugger and "translates" commands in the
GDB remote protocol to JDB commands.

The server mostly works now except for interrupts (Ctrl-C in GDB). It looks
like the interrupt packets (plain 0x03) are never sent. A log with
'set debug remote 1' looks as follows:

   (gdb) c
   Continuing.
   Sending packet: $m1000000,4#1e...Ack
   Packet received: 3c020000
   Sending packet: $Z0,1000004,4#6b...Ack
   Packet received: OK
   Packet Z0 (software-breakpoint) is supported
   Sending packet: $vCont?#49...Ack
   Packet received: vCont;c
   Packet vCont (verbose-resume) is NOT supported
   Sending packet: $Hc0#db...Ack
   Packet received:
   Sending packet: $c#63...Ack
   Packet received: T0525:01000004;
   Sending packet: $z0,1000004,4#8b...Ack
   Packet received: OK
   Sending packet: $Z0,1000000,4#67...Ack
   Packet received: OK
   Sending packet: $Hc0#db...Ack
   Packet received:
   Sending packet: $c#63...Ack

   remote_interrupt called
   remote_stop called

My server has two threads, one that receives messages from GDB and one that
handles packets, controls JDB and sends replies back to GDB. The "receiver"
thread is waiting for messages when Ctrl-C is sent in GDB.

Did I miss some GDB configuration option or some other obvious thing?

--
// Simon

[1] http://cibyl.googlecode.com

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

* Re: Interrupt packets in the remote protocol
  2007-11-03 17:25 Interrupt packets in the remote protocol Simon Kagstrom
@ 2007-11-04  3:08 ` Daniel Jacobowitz
  2007-11-04  7:23   ` Simon Kagstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-11-04  3:08 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: gdb

On Sat, Nov 03, 2007 at 06:28:47PM +0100, Simon Kagstrom wrote:
> The server mostly works now except for interrupts (Ctrl-C in GDB). It looks
> like the interrupt packets (plain 0x03) are never sent. A log with
> 'set debug remote 1' looks as follows:

How sure are you of this?  The Ctrl-C packet won't show up directly in
the log, because it's not a "packet" as such.  It doesn't get the $ or
#CHECKSUM; it's just a \003.

It's sent here:

>    remote_interrupt called
>    remote_stop called

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Interrupt packets in the remote protocol
  2007-11-04  3:08 ` Daniel Jacobowitz
@ 2007-11-04  7:23   ` Simon Kagstrom
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Kagstrom @ 2007-11-04  7:23 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

On Sat, 3 Nov 2007 23:08:09 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> On Sat, Nov 03, 2007 at 06:28:47PM +0100, Simon Kagstrom wrote:
> > The server mostly works now except for interrupts (Ctrl-C in GDB).
> > It looks like the interrupt packets (plain 0x03) are never sent. A
> > log with 'set debug remote 1' looks as follows:
> 
> How sure are you of this?  The Ctrl-C packet won't show up directly in
> the log, because it's not a "packet" as such.  It doesn't get the $ or
> #CHECKSUM; it's just a \003.

OK, I ran wireshark and dumped the traffic, and I can see now that 0x03
is sent. So the problem is on my side.

Thanks for the help!
-- 
// Simon

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

end of thread, other threads:[~2007-11-04  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-03 17:25 Interrupt packets in the remote protocol Simon Kagstrom
2007-11-04  3:08 ` Daniel Jacobowitz
2007-11-04  7:23   ` Simon Kagstrom

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).