This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Resubmit reverse debugging [5/5]
- From: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 08 Oct 2008 15:14:23 -0300
- Subject: Re: [RFA] Resubmit reverse debugging [5/5]
- References: <48EC18F9.8040105@vmware.com>
El mar, 07-10-2008 a las 19:20 -0700, Michael Snyder escribiÃ:
> +static void
> +exec_reverse_once (char *cmd, char *args, int from_tty)
> +{
> + /* String buffer for command consing. */
> + char reverse_command[512];
<snip>
> + sprintf (reverse_command, "%s %s", cmd, args ? args : "");
> +
> + execution_direction = EXEC_REVERSE;
> + execute_command (reverse_command, from_tty);
> + do_cleanups (old_chain);
That fixed-length buffer being written with sprintf doesn't look good...
What do you think about using xstrprintf instead? That will remove the
possibility of buffer overflow, and also remove an arbitrary limit.
> + add_com ("reverse-next", class_run, reverse_next, _("\
> +Step program backward, proceeding through subroutine calls.\n\
> +Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
> +when they do, the call is treated as one instruction.\n\
> +Argument N means do this N times (or till program stops for another reason).")
> + );
> + add_com_alias ("rn", "reverse-next", class_alias, 1);
What about adding "previous" and either "pr" or "pre" as alias to
reverse-next? Sounds more natural to me than "reverse-next". Similarly,
"previousi" and "pri" or "prei".
I'd also half-seriously suggest adding a "step-back" alias on the same
grounds. :-)
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center