Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Caz Yokoyama <cazyokoyama@gmail.com>
Cc: 'Eli Zaretskii' <eliz@gnu.org>,
	pedro@codesourcery.com, 	gdb-patches@sourceware.org
Subject: Re: symbolic debug of loadable modules with kgdb light
Date: Thu, 01 Oct 2009 16:33:00 -0000	[thread overview]
Message-ID: <20091001163330.GL10338@adacore.com> (raw)
In-Reply-To: <5650DA603A804427AA3B3F8F91164548@xpjpn>

Regarding testing, since you are modifying remote.c, you'll need to run
the testsuite using gdbserver.  The testsuite needs to be run before
and after the patch, in order to compare the results.  Normally, there
should be no regression.  Directions on how to do that are explained at
http://sourceware.org/gdb/wiki/TestingGDB (see Testing gdbserver in a
native configuration).  Please indicate when you submit patches that
you ran the testsuite, and that you found no regression.

> +        * remote.c (interrupt_sequence_control_c)
> +        (interrupt_sequence_break, interrupt_sequence_sysrq_g)
> +        (interrupt_sequence_modes): New constants.
> +        (interrupt_sequence_mode, interrupt_on_connect): New variable.
> +	(show_interrupt_sequence): New function.
> +        (set_remotebreak, show_remotebreak): New function.
> +	(send_interrupt_sequence: New function.
> +	(remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect.
> +	(remote_stop_as): Call send_interrupt_sequence.
> +	(_initialize_remote): Add interrupt-sequence and interrupt-on-connect,
> +	modify remotebreak to call set_remotebreak and show_remotebreak.

Just a few formatting nits left: The ChangeLog entries needs to be
indented using tabs. You're mixing spaces and tabs. You're missing
a closing parenthesis after send_interrupt_sequence and the line just
after is too long (maximum is 79 or 80 characters).

> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g]

You changed the user interface again, this is really fustrating.
Personally, I don't care anymore what names we use for these options
and I can see why you prefer them, but since we're changing them again,
please ask Daniel Jacobowitz and Pedro Alves, who are the major
maintainers and regular users of this code, whether they are OK
with your choices.

In the future, I would really appreciate if we agreed on the user
interface first, without considering code while doing that, and then
stay with what we've agreed on.  Otherwise, things keep changing every
time I look at a patch, and we both waste valuable time.

That being said, we're getting there.

> +/* This boolean variable specifies whether interrupt_sequence is sent
> +   to remote target when gdb starts. This is mostly needed when you debug
> +   Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for
> +   connecting gdb.  */

Formatting: 2 spaces after each of the 2 periods.

> @@ -8993,6 +9073,10 @@
>  _initialize_remote (void)
>  {
>    struct remote_state *rs;
> +  struct cmd_list_element *cmd;
> +  /* I can't use the same string for lookup_cmd(). Cause segment fault.  */
> +  static char *_set_remotebreak_ = "remotebreak";
> +  static char *_show_remotebreak_ = "remotebreak";

Try this instead:

  char *cmd_name;

  cmd_name = "remotebreak";
  cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1);
  deprecate_cmd (cmd, "set remote interrupt-sequence");
  cmd_name = "remotebreak";
  cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1);
  deprecate_cmd (cmd, "show remote interrupt-sequence");

The reason why you're getting the SEGV is because lookup_cmd updates
the pointer your passing to point after the command name it has matched.

> -  add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\
> -Set whether to send break if interrupted."), _("\
> -Show whether to send break if interrupted."), _("\
> +  add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\
> +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\
> +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\

Please undo this part of the change. You do NOT need to update the command
documentation for "set/show remotebreak", since this is already taken care

-- 
Joel


  parent reply	other threads:[~2009-10-01 16:33 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 15:51 Caz Yokoyama
2009-04-24 15:33 ` Tom Tromey
2009-04-24 16:49   ` Caz Yokoyama
2009-04-26  0:39   ` Caz Yokoyama
2009-05-15 21:14   ` Caz Yokoyama
2009-05-15 21:23     ` Pedro Alves
2009-05-15 21:34       ` Daniel Jacobowitz
2009-05-15 21:41         ` Caz Yokoyama
2009-05-15 22:13           ` Michael Snyder
2009-05-15 22:25             ` Caz Yokoyama
2009-08-07  7:17             ` Caz Yokoyama
2009-08-07  9:22               ` Eli Zaretskii
2009-08-07 20:42                 ` Caz Yokoyama
2009-09-23  0:48               ` Joel Brobecker
2009-09-23  1:39                 ` Daniel Jacobowitz
2009-09-23  4:16                 ` Caz Yokoyama
2009-09-23 11:36                 ` Caz Yokoyama
2009-09-24 16:40                 ` Caz Yokoyama
2009-09-24 22:42                 ` Caz Yokoyama
2009-09-25 16:06                   ` Joel Brobecker
2009-09-26  3:43                     ` Caz Yokoyama
     [not found]                       ` <535d47e30909260627n662135a1hf6d1a0bb33368b3a@mail.gmail.com>
2009-09-29  1:58                         ` Joel Brobecker
2009-09-29  3:23                           ` Caz Yokoyama
2009-09-29  4:22                             ` Joel Brobecker
2009-09-29  4:58                               ` Caz Yokoyama
2009-09-29  5:19                                 ` Joel Brobecker
2009-09-29 16:12                                   ` Caz Yokoyama
2009-09-29 16:39                                     ` Joel Brobecker
2009-09-30  4:45                                       ` Caz Yokoyama
2009-09-30 17:28                                         ` Joel Brobecker
2009-09-30 19:16                                         ` Eli Zaretskii
2009-09-30 20:12                                           ` Joel Brobecker
2009-10-01  3:48                                             ` Caz Yokoyama
2009-10-01  4:08                                               ` Eli Zaretskii
2009-10-01  4:51                                                 ` Caz Yokoyama
2009-10-01 20:04                                                   ` Eli Zaretskii
2009-10-01 16:33                                               ` Joel Brobecker [this message]
2009-10-01 17:18                                                 ` Caz Yokoyama
2009-10-01 19:37                                                   ` Joel Brobecker
2009-10-01 19:53                                                     ` Caz Yokoyama
2009-10-01 20:25                                                     ` Eli Zaretskii
2009-10-01 20:19                                                   ` Eli Zaretskii
2009-10-01 20:29                                                     ` Caz Yokoyama
2009-10-01 20:46                                                       ` Joel Brobecker
2009-10-01 21:10                                                         ` Daniel Jacobowitz
2009-10-01 21:58                                                           ` Caz Yokoyama
2009-10-01 22:13                                                           ` Pedro Alves
2009-10-01 23:04                                                             ` Caz Yokoyama
2009-10-01 23:32                                                               ` Joel Brobecker
2009-10-02  1:18                                                                 ` Caz Yokoyama
2009-10-02 22:14                                                                   ` Joel Brobecker
2009-10-02  8:55                                                                 ` Eli Zaretskii
2009-10-28 15:05                                                                 ` Joel Brobecker
2009-10-01 20:13                                                 ` Caz Yokoyama
2009-05-15 21:34       ` Caz Yokoyama

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091001163330.GL10338@adacore.com \
    --to=brobecker@adacore.com \
    --cc=cazyokoyama@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox