From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10918 invoked by alias); 1 Oct 2009 23:04:08 -0000 Received: (qmail 10900 invoked by uid 22791); 1 Oct 2009 23:04:07 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f225.google.com (HELO mail-fx0-f225.google.com) (209.85.220.225) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Oct 2009 23:04:03 +0000 Received: by fxm25 with SMTP id 25so627005fxm.0 for ; Thu, 01 Oct 2009 16:04:00 -0700 (PDT) Received: by 10.86.247.18 with SMTP id u18mr1707411fgh.43.1254438240447; Thu, 01 Oct 2009 16:04:00 -0700 (PDT) Received: from xpjpn (pool-71-111-147-240.ptldor.dsl-w.verizon.net [71.111.147.240]) by mx.google.com with ESMTPS id d4sm131634fga.22.2009.10.01.16.03.55 (version=SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 16:03:59 -0700 (PDT) From: Caz Yokoyama To: "'Joel Brobecker'" Cc: "'Eli Zaretskii'" , , "'Daniel Jacobowitz'" , "'Pedro Alves'" References: <20090929163910.GO9003@adacore.com> <20091001204624.GP10338@adacore.com> <20091001211015.GA17752@caradoc.them.org> <200910012313.43368.pedro@codesourcery.com> Subject: RE: symbolic debug of loadable modules with kgdb light Date: Thu, 01 Oct 2009 23:04:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_016E_01CA42B0.CF981B90" In-Reply-To: <200910012313.43368.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00038.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_016E_01CA42B0.CF981B90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 1277 Here is the updated patch. - Use Ctrl-C, BREAK and BREAK-g - Use tab only in gdb/ChangeLog. - Add 2 spaces after period. - cmd_name is initialized on each lookup_cmd(). - add_setshow_boolean_cmd ("remotebreak", ...) has no change except for calling set_remotebreak and show_remotebreak - Tested. No regression. -caz -----Original Message----- From: Pedro Alves [mailto:pedro@codesourcery.com] Sent: Thursday, October 01, 2009 3:14 PM To: Daniel Jacobowitz Cc: Joel Brobecker; Caz Yokoyama; 'Eli Zaretskii'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light On Thursday 01 October 2009 22:10:15, Daniel Jacobowitz wrote: > On Thu, Oct 01, 2009 at 01:46:24PM -0700, Joel Brobecker wrote: > > > Actually I support your spellings. Ctrl-C is much popular than control-c, > > > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > > > Joel said. > > > > Your arguments make sense and I am fine with your choices. But we generally > > use lower-case names for the various GDB settings, so do double-check > > with Daniel J and Pedro that they are also fine with these choices. > > I have no opinion (and think we've spent more time on these names than > they required - let's just do it). Ditto. -- Pedro Alves ------=_NextPart_000_016E_01CA42B0.CF981B90 Content-Type: application/octet-stream; name="remotebreak.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="remotebreak.patch" Content-length: 14691 Index: gdb/ChangeLog=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/ChangeLog,v=0A= retrieving revision 1.10924=0A= diff -u -r1.10924 ChangeLog=0A= --- gdb/ChangeLog 1 Oct 2009 20:09:20 -0000 1.10924=0A= +++ gdb/ChangeLog 1 Oct 2009 22:41:03 -0000=0A= @@ -1,3 +1,18 @@=0A= +2009-10-01 Kazuyoshi Caz Yokoyama =0A= +=0A= + * remote.c (interrupt_sequence_control_c)=0A= + (interrupt_sequence_break, interrupt_sequence_sysrq_g)=0A= + (interrupt_sequence_modes): New constants.=0A= + (interrupt_sequence_mode, interrupt_on_connect): New variable.=0A= + (show_interrupt_sequence): New function.=0A= + (set_remotebreak, show_remotebreak): New function.=0A= + (send_interrupt_sequence): New function.=0A= + (remote_start_remote): Call send_interrupt_sequence if=0A= + interrupt_on_connect is true.=0A= + (remote_stop_as): Call send_interrupt_sequence.=0A= + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect,=0A= + modify remotebreak to call set_remotebreak and show_remotebreak.=0A= +=0A= 2009-10-01 Phil Muldoon =0A= =20=0A= * infcall.c (call_function_by_hand): Add a new cleanup branch for=0A= Index: gdb/NEWS=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/NEWS,v=0A= retrieving revision 1.331=0A= diff -u -r1.331 NEWS=0A= --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331=0A= +++ gdb/NEWS 1 Oct 2009 22:41:05 -0000=0A= @@ -234,6 +234,24 @@=0A= =20=0A= * New commands (for set/show, see "New options" below)=0A= =20=0A= +set remote interrupt-sequence [Ctrl-C | BREAK | BREAK-g]=0A= +show remote interrupt-sequence=0A= + Allow the user to select one of ^C, a BREAK signal or BREAK-g=0A= + as the sequence to the remote target in order to interrupt the execution= .=0A= + Ctrl-C is a default. Some system prefers BREAK which is high level of= =0A= + serial line for some certain time. Linux kernel prefers BREAK-g, a.k.a= =0A= + Magic SysRq g. It is BREAK signal and character 'g'.=0A= +=0A= +set remote interrupt-on-connect [on | off]=0A= +show remote interrupt-on-connect=0A= + When interrupt-on-connect is ON, gdb sends interrupt-sequence to=0A= + remote target when gdb connects to it. This is needed when you debug=0A= + Linux kernel.=0A= +=0A= +set remotebreak [on | off]=0A= +show remotebreak=0A= +Deprecated. Use "set/show remote interrupt-sequence" instead.=0A= +=0A= catch syscall [NAME(S) | NUMBER(S)]=0A= Catch system calls. Arguments, which should be names of system=0A= calls or their numbers, mean catch only those syscalls. Without=0A= Index: gdb/remote.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/remote.c,v=0A= retrieving revision 1.372=0A= diff -u -r1.372 remote.c=0A= --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372=0A= +++ gdb/remote.c 1 Oct 2009 22:41:08 -0000=0A= @@ -546,14 +546,76 @@=0A= this can go away. */=0A= static int wait_forever_enabled_p =3D 1;=0A= =20=0A= +/* Allow the user to specify what sequence to send to the remote=0A= + when he requests a program interruption: Although ^C is usually=0A= + what remote systems expect (this is the default, here), it is=0A= + sometimes preferable to send a break. On other systems such=0A= + as the Linux kernel, a break followed by g, which is Magic SysRq g=0A= + is required in order to interrupt the execution. */=0A= +const char interrupt_sequence_control_c[] =3D "Ctrl-C";=0A= +const char interrupt_sequence_break[] =3D "BREAK";=0A= +const char interrupt_sequence_sysrq_g[] =3D "BREAK-g";=0A= +static const char *interrupt_sequence_modes[] =3D=0A= + {=0A= + interrupt_sequence_control_c,=0A= + interrupt_sequence_break,=0A= + interrupt_sequence_sysrq_g,=0A= + NULL=0A= + };=0A= +static const char *interrupt_sequence_mode =3D interrupt_sequence_control_= c;=0A= =20=0A= -/* This variable chooses whether to send a ^C or a break when the user=0A= - requests program interruption. Although ^C is usually what remote=0A= - systems expect, and that is the default here, sometimes a break is=0A= - preferable instead. */=0A= +static void=0A= +show_interrupt_sequence (struct ui_file *file, int from_tty,=0A= + struct cmd_list_element *c,=0A= + const char *value)=0A= +{=0A= + if (interrupt_sequence_mode =3D=3D interrupt_sequence_control_c)=0A= + fprintf_filtered (file,=0A= + _("Send the ASCII ETX character (Ctrl-c) "=0A= + "to the remote target to interrupt the "=0A= + "execution of the program.\n"));=0A= + else if (interrupt_sequence_mode =3D=3D interrupt_sequence_break)=0A= + fprintf_filtered (file,=0A= + _("send a break signal to the remote target "=0A= + "to interrupt the execution of the program.\n"));=0A= + else if (interrupt_sequence_mode =3D=3D interrupt_sequence_sysrq_g)=0A= + fprintf_filtered (file,=0A= + _("Send a break signal and 'g' a.k.a. Magic SysRq g to "=0A= + "the remote target to interrupt the execution "=0A= + "of Linux kernel.\n"));=0A= + else=0A= + internal_error (__FILE__, __LINE__,=0A= + _("Invalid value for interrupt_sequence_mode: %s."),=0A= + interrupt_sequence_mode);=0A= +}=0A= =20=0A= +/* This boolean variable specifies whether interrupt_sequence is sent=0A= + to remote target when gdb connect to it.=0A= + This is mostly needed when you debug Linux kernel.=0A= + Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb.= */=0A= +static int interrupt_on_connect =3D 0;=0A= +=0A= +/* This variable is used to implement the "set/show remotebreak" commands.= =0A= + Since these commands are now deprecated in favor of "set/show remote=0A= + interrupt-sequence", it no longer has any effect on the code. */=0A= static int remote_break;=0A= =20=0A= +static void=0A= +set_remotebreak (char *args, int from_tty, struct cmd_list_element *c)=0A= +{=0A= + if (remote_break)=0A= + interrupt_sequence_mode =3D interrupt_sequence_break;=0A= + else=0A= + interrupt_sequence_mode =3D interrupt_sequence_control_c;=0A= +}=0A= +=0A= +static void=0A= +show_remotebreak (struct ui_file *file, int from_tty,=0A= + struct cmd_list_element *c,=0A= + const char *value)=0A= +{=0A= +}=0A= +=0A= /* Descriptor for I/O to remote machine. Initialize it to NULL so that=0A= remote_open knows that we don't have a file open when the program=0A= starts. */=0A= @@ -2585,6 +2647,25 @@=0A= int extended_p;=0A= };=0A= =20=0A= +/* Send interrupt_sequence to remote target. */=0A= +static void=0A= +send_interrupt_sequence ()=0A= +{=0A= + if (interrupt_sequence_mode =3D=3D interrupt_sequence_control_c)=0A= + serial_write (remote_desc, "\x03", 1);=0A= + else if (interrupt_sequence_mode =3D=3D interrupt_sequence_break)=0A= + serial_send_break (remote_desc);=0A= + else if (interrupt_sequence_mode =3D=3D interrupt_sequence_sysrq_g)=0A= + {=0A= + serial_send_break (remote_desc);=0A= + serial_write (remote_desc, "g", 1);=0A= + }=0A= + else=0A= + internal_error (__FILE__, __LINE__,=0A= + _("Invalid value for interrupt_sequence_mode: %s."),=0A= + interrupt_sequence_mode);=0A= +}=0A= +=0A= static void=0A= remote_start_remote (struct ui_out *uiout, void *opaque)=0A= {=0A= @@ -2598,6 +2679,9 @@=0A= /* Ack any packet which the remote side has already sent. */=0A= serial_write (remote_desc, "+", 1);=0A= =20=0A= + if (interrupt_on_connect)=0A= + send_interrupt_sequence ();=0A= +=0A= /* The first packet we send to the target is the optional "supported=0A= packets" request. If the target can answer this, it will tell us=0A= which later probes to skip. */=0A= @@ -4021,12 +4105,8 @@=0A= if (rs->cached_wait_status)=0A= return;=0A= =20=0A= - /* Send a break or a ^C, depending on user preference. */=0A= -=0A= - if (remote_break)=0A= - serial_send_break (remote_desc);=0A= - else=0A= - serial_write (remote_desc, "\003", 1);=0A= + /* Send interrupt_sequence to remote target. */=0A= + send_interrupt_sequence ();=0A= }=0A= =20=0A= /* This is the generic stop called via the target vector. When a target=0A= @@ -8993,6 +9073,8 @@=0A= _initialize_remote (void)=0A= {=0A= struct remote_state *rs;=0A= + struct cmd_list_element *cmd;=0A= + static char *cmd_name;=0A= =20=0A= /* architecture specific data */=0A= remote_gdbarch_data_handle =3D=0A= @@ -9060,8 +9142,31 @@=0A= Set whether to send break if interrupted."), _("\=0A= Show whether to send break if interrupted."), _("\=0A= If set, a break, instead of a cntrl-c, is sent to the remote target."),=0A= - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is = %s. */=0A= + set_remotebreak, show_remotebreak,=0A= &setlist, &showlist);=0A= + cmd_name =3D "remotebreak";=0A= + cmd =3D lookup_cmd (&cmd_name, setlist, "", -1, 1);=0A= + deprecate_cmd (cmd, "set remote interrupt-sequence");=0A= + cmd_name =3D "remotebreak"; /* needed because lookup_cmd updates the poi= nter */=0A= + cmd =3D lookup_cmd (&cmd_name, showlist, "", -1, 1);=0A= + deprecate_cmd (cmd, "show remote interrupt-sequence");=0A= +=0A= + add_setshow_enum_cmd ("interrupt-sequence", class_support,=0A= + interrupt_sequence_modes, &interrupt_sequence_mode, _("\=0A= +Set interrupt sequence to remote target."), _("\=0A= +Show interrupt sequence to remote target."), _("\=0A= +Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl= -C\"."),=0A= + NULL, show_interrupt_sequence,=0A= + &remote_set_cmdlist,=0A= + &remote_show_cmdlist);=0A= +=0A= + add_setshow_boolean_cmd ("interrupt-on-connect", class_support,=0A= + &interrupt_on_connect, _("\=0A= +Set whether interrupt-sequence is sent to remote target when gdb connects = to."), _(" \=0A= +Show whether interrupt-sequence is sent to remote target when gdb connects= to."), _(" \=0A= +If set, interrupt sequence is sent to remote target."),=0A= + NULL, NULL,=0A= + &remote_set_cmdlist, &remote_show_cmdlist);=0A= =20=0A= /* Install commands for configuring memory read/write packets. */=0A= =20=0A= Index: gdb/doc/ChangeLog=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/doc/ChangeLog,v=0A= retrieving revision 1.958=0A= diff -u -r1.958 ChangeLog=0A= --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958=0A= +++ gdb/doc/ChangeLog 1 Oct 2009 22:41:11 -0000=0A= @@ -1,3 +1,8 @@=0A= +2009-10-01 Kazuyoshi Caz Yokoyama =0A= +=0A= + * gdb.texinfo (Remote Configuration): Add "set/show remote=0A= + interrupt-sequence" and "set/show remote interrupt-on-connect" command.= =0A= +=0A= 2009-09-26 Pierre Muller =0A= =20=0A= * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK.=0A= Index: gdb/doc/gdb.texinfo=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v=0A= retrieving revision 1.629=0A= diff -u -r1.629 gdb.texinfo=0A= --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629=0A= +++ gdb/doc/gdb.texinfo 1 Oct 2009 22:41:24 -0000=0A= @@ -15011,6 +15011,34 @@=0A= target system. If it is not set, the target will use a default=0A= filename (e.g.@: the last program run).=0A= =20=0A= +@item set remote interrupt-sequence=0A= +@cindex interrupt remote programs=0A= +@cindex select Ctrl-C, BREAK or BREAK-g=0A= +Allow the user to select one of @samp{Ctrl-C}, a @code{BREAK} or=0A= +@samp{BREAK-g} as the=0A= +sequence to the remote target in order to interrupt the execution.=0A= +@samp{Ctrl-C} is a default. Some system prefers @code{BREAK} which=0A= +is high level of serial line for some certain time.=0A= +Linux kernel prefers @samp{BREAK-g}, a.k.a Magic SysRq g.=0A= +It is @code{BREAK} signal followed by character @code{g}.=0A= +=0A= +@item show interrupt-sequence=0A= +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK-g}=0A= +is sent by @value{GDBN} to interrupt the remote program.=0A= +@code{BREAK-g} is BREAK signal followed by @code{g} and=0A= +also known as Magic SysRq g.=0A= +=0A= +@item set remote interrupt-on-connect=0A= +@cindex send interrupt-sequence on start=0A= +Specify whether interrupt-sequence is sent to remote target when=0A= +@value{GDBN} connects to it. This is mostly needed when you debug=0A= +Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g}=0A= +which is known as Magic SysRq g in order to connect @value{GDBN}.=0A= +=0A= +@item show interrupt-on-connect=0A= +Show whether interrupt-sequence is sent=0A= +to remote target when @value{GDBN} connects to it.=0A= +=0A= @kindex set tcp=0A= @kindex show tcp=0A= @item set tcp auto-retry on=0A= @@ -29817,9 +29845,9 @@=0A= @cindex interrupts (remote protocol)=0A= =20=0A= When a program on the remote target is running, @value{GDBN} may=0A= -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK},=0A= -control of which is specified via @value{GDBN}'s @samp{remotebreak}=0A= -setting (@pxref{set remotebreak}).=0A= +attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or=0A= +a @code{BREAK} followed by @code{g},=0A= +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}= .=0A= =20=0A= The precise meaning of @code{BREAK} is defined by the transport=0A= mechanism and may, in fact, be undefined. @value{GDBN} does not=0A= @@ -29836,6 +29864,10 @@=0A= (@pxref{X packet}), used for binary downloads, may include an unescaped=0A= @code{0x03} as part of its packet.=0A= =20=0A= +@code{BREAK} followed by @code{g} is also known as Magic SysRq g.=0A= +When Linux kernel receives this sequence from serial port,=0A= +it stops execution and connects to gdb.=0A= +=0A= Stubs are not required to recognize these interrupt mechanisms and the=0A= precise meaning associated with receipt of the interrupt is=0A= implementation defined. If the target supports debugging of multiple=0A= ------=_NextPart_000_016E_01CA42B0.CF981B90--