summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2008-10-09 17:48:55 +0000
committerMichael Snyder <msnyder@specifix.com>2008-10-09 17:48:55 +0000
commit748e0221f2947a6f0338e8acdaff3dbef41ba42c (patch)
tree0f6616311e4d5726017c06f234ffa9a3121d285f
parent4986a60dac58b2c3c15be84d4857c863f8e25890 (diff)
downloadgdb-748e0221f2947a6f0338e8acdaff3dbef41ba42c.tar.gz
2008-10-09 Michael Snyder <msnyder@vmware.com>
* reverse.c (exec_reverse_once): Eliminate fixed-size buffer, use xstrprintf.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/reverse.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 728b87681ca..6cc9184d907 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-09 Michael Snyder <msnyder@vmware.com>
+
+ * reverse.c (exec_reverse_once): Eliminate fixed-size buffer,
+ use xstrprintf.
+
2008-10-08 Hui Zhu <teawater@gmail.com>
* record.c (record_open): Reset after push_target.
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 4952267cb34..9a40545cdc9 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -44,8 +44,7 @@ static void exec_direction_default (void *notused)
static void
exec_reverse_once (char *cmd, char *args, int from_tty)
{
- /* String buffer for command consing. */
- char reverse_command[512];
+ char *reverse_command;
enum exec_direction_kind dir = execution_direction;
struct cleanup *old_chain;
@@ -59,9 +58,9 @@ exec_reverse_once (char *cmd, char *args, int from_tty)
if (!target_can_execute_reverse)
error (_("Target %s does not support this command."), target_shortname);
+ reverse_command = xstrprintf ("%s %s", cmd, args ? args : "");
old_chain = make_cleanup (exec_direction_default, NULL);
- sprintf (reverse_command, "%s %s", cmd, args ? args : "");
-
+ make_cleanup (xfree, reverse_command);
execution_direction = EXEC_REVERSE;
execute_command (reverse_command, from_tty);
do_cleanups (old_chain);