This is the mail archive of the
mailing list for the GDB project.
Re: symbolic debug of loadable modules with kgdb light
> +2009-10-01 Kazuyoshi Caz Yokoyama <email@example.com>
> + * 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 is true.
> + (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.
Very nice and clean! Just a few nits as shown below, but they are minor
and can be mechanically fixed. So the code part of the patch is
pre-approved, after you address the last comments below (it means that
you have permission to commit the patch, but please make sure to send
a copy of the patch that you end up checking in). I think Eli already
approved the latest version of the documentation part, but he'll
probably want to have a last quick look.
And of course, now that I talk about checking in your patch, I am
now only realizing that you do not seem to have an assignment filed
with the FSF. This is a requirement for us to accept your patch.
Perhaps you have an assignment on file through your employer?
I couldn't find you in their records using either your name or
email domain. Let me know if you'd like me to get you started with
the paperwork. It takes a few weeks, so start ASAP if needed.
> +const char interrupt_sequence_sysrq_g = "BREAK-g";
You forgot to rename this constant to interrupt_sequence_break_g,
to match the actual litteral value.
> +/* This boolean variable specifies whether interrupt_sequence is sent
> + to remote target when gdb connect to it.
> + This is mostly needed when you debug Linux kernel.
> + Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */
I've noticed a few English mistakes. I started pointed them out, but in
the end, it's probably simpler if I give you the correct version:
/* This boolean variable specifies whether interrupt_sequence is sent
to the remote target when gdb connects to it.
This is mostly needed when you debug theLinux kernel: The Linux kernel
expects BREAK g which is Magic SysRq g for connecting gdb. */
> + struct cmd_list_element *cmd;
> + static char *cmd_name;
This should not be static. That way, it gets allocated on the stack
and then released after the function returns.