Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* patch to send telnet BREAK for remote-over-tcp
@ 2008-08-29 22:53 Angela Marie Thomas
  2008-09-03  4:36 ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Angela Marie Thomas @ 2008-08-29 22:53 UTC (permalink / raw)
  To: gdb-patches


Hoping this falls under "obvious" as I don't currently have an assigment
on file.  Simply put, this changes the current noop behavior to using the
telnet BREAK sequence instead.  This allows remote debugging of kgdb
enabled BSD kernels through a TCP serial connection (e.g. Portmaster).
Built and tested for --host=i686-pc-linux-gnu --target=mips64-linux

2008-08-29  Angela Marie Thomas <angela@releasedominatrix.com>

	* ser-tcp.c (ser_tcp_send_break): New function.
	(_initialize_ser_tcp): Use ser_tcp_send_break.
	* ser-tcp.h (ser_tcp_send_break): New prototype.

Index: gdb/ser-tcp.c
===================================================================
RCS file: /services/cvs/cvsroot/gnusense/gdb/gdb/ser-tcp.c,v
retrieving revision 1.1.1.4
diff -b -t -w -u -p -r1.1.1.4 ser-tcp.c
--- gdb/ser-tcp.c	7 Jul 2006 16:06:15 -0000	1.1.1.4
+++ gdb/ser-tcp.c	29 Aug 2008 17:29:02 -0000
@@ -278,7 +278,7 @@ _initialize_ser_tcp (void)
   ops->write = ser_base_write;
   ops->flush_output = ser_base_flush_output;
   ops->flush_input = ser_base_flush_input;
-  ops->send_break = ser_base_send_break;
+  ops->send_break = ser_tcp_send_break;
   ops->go_raw = ser_base_raw;
   ops->get_tty_state = ser_base_get_tty_state;
   ops->set_tty_state = ser_base_set_tty_state;
@@ -292,4 +292,11 @@ _initialize_ser_tcp (void)
   ops->write_prim = net_write_prim;
   serial_add_interface (ops);
 #endif /* USE_WIN32API */
+}
+
+int
+ser_tcp_send_break (struct serial *scb)
+{
+  /* Send telnet IAC and BREAK characters. */
+  return(serial_write(scb, "\377\363", 2));
 }
Index: gdb/ser-tcp.h
===================================================================
RCS file: /services/cvs/cvsroot/gnusense/gdb/gdb/ser-tcp.h,v
retrieving revision 1.1.1.1
diff -b -t -w -u -p -r1.1.1.1 ser-tcp.h
--- gdb/ser-tcp.h	7 Jul 2006 16:05:44 -0000	1.1.1.1
+++ gdb/ser-tcp.h	29 Aug 2008 17:29:02 -0000
@@ -28,5 +28,6 @@ extern int net_open (struct serial *scb,
 extern void net_close (struct serial *scb);
 extern int net_read_prim (struct serial *scb, size_t count);
 extern int net_write_prim (struct serial *scb, const void *buf, size_t count);
+extern int ser_tcp_send_break (struct serial *scb);
 
 #endif


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-08-29 22:53 patch to send telnet BREAK for remote-over-tcp Angela Marie Thomas
@ 2008-09-03  4:36 ` Michael Snyder
  2008-09-03 13:12   ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2008-09-03  4:36 UTC (permalink / raw)
  To: angela; +Cc: gdb-patches


I think this looks right, but I'd love to get another opinion.

Daniel?  Anybody?

On Fri, 2008-08-29 at 15:52 -0700, Angela Marie Thomas wrote:
> Hoping this falls under "obvious" as I don't currently have an assigment
> on file.  Simply put, this changes the current noop behavior to using the
> telnet BREAK sequence instead.  This allows remote debugging of kgdb
> enabled BSD kernels through a TCP serial connection (e.g. Portmaster).
> Built and tested for --host=i686-pc-linux-gnu --target=mips64-linux
> 
> 2008-08-29  Angela Marie Thomas <angela@releasedominatrix.com>
> 
> 	* ser-tcp.c (ser_tcp_send_break): New function.
> 	(_initialize_ser_tcp): Use ser_tcp_send_break.
> 	* ser-tcp.h (ser_tcp_send_break): New prototype.
> 
> Index: gdb/ser-tcp.c
> ===================================================================
> RCS file: /services/cvs/cvsroot/gnusense/gdb/gdb/ser-tcp.c,v
> retrieving revision 1.1.1.4
> diff -b -t -w -u -p -r1.1.1.4 ser-tcp.c
> --- gdb/ser-tcp.c	7 Jul 2006 16:06:15 -0000	1.1.1.4
> +++ gdb/ser-tcp.c	29 Aug 2008 17:29:02 -0000
> @@ -278,7 +278,7 @@ _initialize_ser_tcp (void)
>    ops->write = ser_base_write;
>    ops->flush_output = ser_base_flush_output;
>    ops->flush_input = ser_base_flush_input;
> -  ops->send_break = ser_base_send_break;
> +  ops->send_break = ser_tcp_send_break;
>    ops->go_raw = ser_base_raw;
>    ops->get_tty_state = ser_base_get_tty_state;
>    ops->set_tty_state = ser_base_set_tty_state;
> @@ -292,4 +292,11 @@ _initialize_ser_tcp (void)
>    ops->write_prim = net_write_prim;
>    serial_add_interface (ops);
>  #endif /* USE_WIN32API */
> +}
> +
> +int
> +ser_tcp_send_break (struct serial *scb)
> +{
> +  /* Send telnet IAC and BREAK characters. */
> +  return(serial_write(scb, "\377\363", 2));
>  }
> Index: gdb/ser-tcp.h
> ===================================================================
> RCS file: /services/cvs/cvsroot/gnusense/gdb/gdb/ser-tcp.h,v
> retrieving revision 1.1.1.1
> diff -b -t -w -u -p -r1.1.1.1 ser-tcp.h
> --- gdb/ser-tcp.h	7 Jul 2006 16:05:44 -0000	1.1.1.1
> +++ gdb/ser-tcp.h	29 Aug 2008 17:29:02 -0000
> @@ -28,5 +28,6 @@ extern int net_open (struct serial *scb,
>  extern void net_close (struct serial *scb);
>  extern int net_read_prim (struct serial *scb, size_t count);
>  extern int net_write_prim (struct serial *scb, const void *buf, size_t count);
> +extern int ser_tcp_send_break (struct serial *scb);
>  
>  #endif


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03  4:36 ` Michael Snyder
@ 2008-09-03 13:12   ` Daniel Jacobowitz
  2008-09-03 17:13     ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2008-09-03 13:12 UTC (permalink / raw)
  To: Michael Snyder; +Cc: angela, gdb-patches

On Tue, Sep 02, 2008 at 09:35:29PM -0700, Michael Snyder wrote:
> 
> I think this looks right, but I'd love to get another opinion.
> 
> Daniel?  Anybody?

It seems fine (aside from the parenthesis formatting :-P), though I
think it would be much more useful if added to the manual.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03 13:12   ` Daniel Jacobowitz
@ 2008-09-03 17:13     ` Michael Snyder
  2008-09-03 17:30       ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2008-09-03 17:13 UTC (permalink / raw)
  To: Michael Snyder, angela, gdb-patches

Daniel Jacobowitz wrote:
> On Tue, Sep 02, 2008 at 09:35:29PM -0700, Michael Snyder wrote:
>> I think this looks right, but I'd love to get another opinion.
>>
>> Daniel?  Anybody?
> 
> It seems fine (aside from the parenthesis formatting :-P), though I
> think it would be much more useful if added to the manual.

OK, since I don't know if Angela has write privs, I'll fix
the parens and check it in later today.

Should this change be propagated to ser-mingw.c?  It shares
some code with this module but makes up its own serial_ops
struct.

If not, I'll just make the new function a static, shall I?


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03 17:13     ` Michael Snyder
@ 2008-09-03 17:30       ` Daniel Jacobowitz
  2008-09-03 20:29         ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2008-09-03 17:30 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Michael Snyder, angela, gdb-patches

On Wed, Sep 03, 2008 at 10:12:22AM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
>> On Tue, Sep 02, 2008 at 09:35:29PM -0700, Michael Snyder wrote:
>>> I think this looks right, but I'd love to get another opinion.
>>>
>>> Daniel?  Anybody?
>>
>> It seems fine (aside from the parenthesis formatting :-P), though I
>> think it would be much more useful if added to the manual.
>
> OK, since I don't know if Angela has write privs, I'll fix
> the parens and check it in later today.
>
> Should this change be propagated to ser-mingw.c?  It shares
> some code with this module but makes up its own serial_ops
> struct.
>
> If not, I'll just make the new function a static, shall I?

Yes, it should be used by tcp connections from mingw hosts too.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03 17:30       ` Daniel Jacobowitz
@ 2008-09-03 20:29         ` Michael Snyder
  2008-09-03 20:41           ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2008-09-03 20:29 UTC (permalink / raw)
  To: eliz, Michael Snyder, angela, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

Daniel Jacobowitz wrote:
> On Wed, Sep 03, 2008 at 10:12:22AM -0700, Michael Snyder wrote:
>> Daniel Jacobowitz wrote:
>>> On Tue, Sep 02, 2008 at 09:35:29PM -0700, Michael Snyder wrote:
>>>> I think this looks right, but I'd love to get another opinion.
>>>>
>>>> Daniel?  Anybody?
>>> It seems fine (aside from the parenthesis formatting :-P), though I
>>> think it would be much more useful if added to the manual.
>> OK, since I don't know if Angela has write privs, I'll fix
>> the parens and check it in later today.
>>
>> Should this change be propagated to ser-mingw.c?  It shares
>> some code with this module but makes up its own serial_ops
>> struct.
>>
>> If not, I'll just make the new function a static, shall I?
> 
> Yes, it should be used by tcp connections from mingw hosts too.

All right, I think I've addressed everything.

Eli, is the doc ok?


[-- Attachment #2: break.txt --]
[-- Type: text/plain, Size: 4323 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.9719
diff -u -p -r1.9719 ChangeLog
--- ChangeLog	3 Sep 2008 19:19:41 -0000	1.9719
+++ ChangeLog	3 Sep 2008 20:26:08 -0000
@@ -1,3 +1,9 @@
+2008-09-03  Angela Marie Thomas <angela@releasedominatrix.com>
+
+	* ser-tcp.c (ser_tcp_send_break): New function.
+	(_initialize_ser_tcp): Use ser_tcp_send_break.
+	* ser-tcp.h (ser_tcp_send_break): New prototype.
+
 2008-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
 
 	* spu-tdep.c (spu_frame_unwind_cache): Do not attempt to unwind
Index: ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.13
diff -u -p -r1.13 ser-mingw.c
--- ser-mingw.c	28 Mar 2008 17:30:45 -0000	1.13
+++ ser-mingw.c	3 Sep 2008 20:26:08 -0000
@@ -1256,7 +1256,7 @@ _initialize_ser_windows (void)
   ops->write = ser_base_write;
   ops->flush_output = ser_base_flush_output;
   ops->flush_input = ser_base_flush_input;
-  ops->send_break = ser_base_send_break;
+  ops->send_break = ser_tcp_send_break;
   ops->go_raw = ser_base_raw;
   ops->get_tty_state = ser_base_get_tty_state;
   ops->set_tty_state = ser_base_set_tty_state;
Index: ser-tcp.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-tcp.c,v
retrieving revision 1.29
diff -u -p -r1.29 ser-tcp.c
--- ser-tcp.c	1 Jan 2008 22:53:12 -0000	1.29
+++ ser-tcp.c	3 Sep 2008 20:26:08 -0000
@@ -257,6 +257,13 @@ net_write_prim (struct serial *scb, cons
   return send (scb->fd, buf, count, 0);
 }
 
+int
+ser_tcp_send_break (struct serial *scb)
+{
+  /* Send telnet IAC and BREAK characters. */
+  return (serial_write (scb, "\377\363", 2));
+}
+
 void
 _initialize_ser_tcp (void)
 {
@@ -276,7 +283,7 @@ _initialize_ser_tcp (void)
   ops->write = ser_base_write;
   ops->flush_output = ser_base_flush_output;
   ops->flush_input = ser_base_flush_input;
-  ops->send_break = ser_base_send_break;
+  ops->send_break = ser_tcp_send_break;
   ops->go_raw = ser_base_raw;
   ops->get_tty_state = ser_base_get_tty_state;
   ops->set_tty_state = ser_base_set_tty_state;
Index: ser-tcp.h
===================================================================
RCS file: /cvs/src/src/gdb/ser-tcp.h,v
retrieving revision 1.4
diff -u -p -r1.4 ser-tcp.h
--- ser-tcp.h	1 Jan 2008 22:53:12 -0000	1.4
+++ ser-tcp.h	3 Sep 2008 20:26:08 -0000
@@ -26,5 +26,6 @@ extern int net_open (struct serial *scb,
 extern void net_close (struct serial *scb);
 extern int net_read_prim (struct serial *scb, size_t count);
 extern int net_write_prim (struct serial *scb, const void *buf, size_t count);
+extern int ser_tcp_send_break (struct serial *scb);
 
 #endif
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.814
diff -u -p -r1.814 ChangeLog
--- doc/ChangeLog	26 Aug 2008 17:30:35 -0000	1.814
+++ doc/ChangeLog	3 Sep 2008 20:26:08 -0000
@@ -1,3 +1,8 @@
+2008-09-03  Angela Marie Thomas <angela@releasedominatrix.com>
+
+	* gdb.texinfo (Interrupts): Remove obsolete statement about
+	network interfaces.
+
 2008-08-26  Ulrich Weigand  <uweigand@de.ibm.com>
 
 	* gdb.texinfo (Commands to Specify Files): Document "remote:"
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.520
diff -u -p -r1.520 gdb.texinfo
--- doc/gdb.texinfo	26 Aug 2008 17:30:35 -0000	1.520
+++ doc/gdb.texinfo	3 Sep 2008 20:26:09 -0000
@@ -26054,9 +26054,10 @@ control of which is specified via @value
 setting (@pxref{set remotebreak}).
 
 The precise meaning of @code{BREAK} is defined by the transport
-mechanism and may, in fact, be undefined.  @value{GDBN} does
-not currently define a @code{BREAK} mechanism for any of the network
-interfaces.
+mechanism and may, in fact, be undefined.  @value{GDBN} does not
+currently define a @code{BREAK} mechanism for any of the network
+interfaces except for TCP, in which case @value{GDBN} sends the
+@code{telnet} BREAK sequence.
 
 @samp{Ctrl-C}, on the other hand, is defined and implemented for all
 transport mechanisms.  It is represented by sending the single byte

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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03 20:29         ` Michael Snyder
@ 2008-09-03 20:41           ` Eli Zaretskii
  2008-09-03 23:55             ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2008-09-03 20:41 UTC (permalink / raw)
  To: Michael Snyder; +Cc: msnyder, angela, gdb-patches

> Date: Wed, 03 Sep 2008 13:29:02 -0700
> From: Michael Snyder <msnyder@vmware.com>
> 
> Eli, is the doc ok?

Yes, thanks.


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

* Re: patch to send telnet BREAK for remote-over-tcp
  2008-09-03 20:41           ` Eli Zaretskii
@ 2008-09-03 23:55             ` Michael Snyder
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2008-09-03 23:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: msnyder, angela, gdb-patches

Eli Zaretskii wrote:
>> Date: Wed, 03 Sep 2008 13:29:02 -0700
>> From: Michael Snyder <msnyder@vmware.com>
>>
>> Eli, is the doc ok?
> 
> Yes, thanks.

Right then -- committing.
Thanks Angela, and reviewers.



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

end of thread, other threads:[~2008-09-03 23:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-29 22:53 patch to send telnet BREAK for remote-over-tcp Angela Marie Thomas
2008-09-03  4:36 ` Michael Snyder
2008-09-03 13:12   ` Daniel Jacobowitz
2008-09-03 17:13     ` Michael Snyder
2008-09-03 17:30       ` Daniel Jacobowitz
2008-09-03 20:29         ` Michael Snyder
2008-09-03 20:41           ` Eli Zaretskii
2008-09-03 23:55             ` Michael Snyder

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