This is the mail archive of the
mailing list for the GDB project.
Re: symbolic debug of loadable modules with kgdb light
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Caz Yokoyama <cazyokoyama at gmail dot com>
- Cc: 'Eli Zaretskii' <eliz at gnu dot org>, pedro at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Thu, 1 Oct 2009 09:33:30 -0700
- Subject: Re: symbolic debug of loadable modules with kgdb light
- References: <1724490614004CEB9EE1A091A151E05B@xpjpn> <20090929042226.GK9003@adacore.com> <2C14068798BA41219F3603CDD24C8BC0@xpjpn> <20090929051929.GL9003@adacore.com> <7063C3E99BE344B2B98EDC0318ED852A@xpjpn> <20090929163910.GO9003@adacore.com> <93F096FEF7ED4579B52B23D69DA91195@xpjpn> <email@example.com> <20090930201204.GH10338@adacore.com> <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:
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