This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Resubmit reverse debugging [5/5]


Thiago Jung Bauermann wrote:
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.

Sure, I'll look into it.


+  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. :-)

Lots of people have alternate suggestions for command names. The present set is as close to convergence as we were able to get in several previous rounds of discussion.

I don't want the feature to be held up by this discussion,
so I'm just saying "aliases are easy to add later".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]