This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Remove cleanup from call_function_by_hand_dummy
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 19 Oct 2017 22:06:45 -0000
- Subject: [binutils-gdb] Remove cleanup from call_function_by_hand_dummy
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=395423c418da2cba1240e39ae944510fe9ffcccc
commit 395423c418da2cba1240e39ae944510fe9ffcccc
Author: Tom Tromey <tom@tromey.com>
Date: Mon Oct 16 17:27:21 2017 -0600
Remove cleanup from call_function_by_hand_dummy
This changes call_function_by_hand_dummy to use std::string, removing
a cleanup.
ChangeLog
2017-10-19 Tom Tromey <tom@tromey.com>
* infcall.c (call_function_by_hand_dummy): Use std::string.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/infcall.c | 14 ++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d7f95a6..49d67bd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2017-10-19 Tom Tromey <tom@tromey.com>
+ * infcall.c (call_function_by_hand_dummy): Use std::string.
+
+2017-10-19 Tom Tromey <tom@tromey.com>
+
* mi/mi-main.c (mi_cmd_execute): Update.
* top.h (prepare_execute_command): Return scoped_value_mark.
* value.h (class scoped_value_mark): Use DISABLE_COPY_AND_ASSIGN.
diff --git a/gdb/infcall.c b/gdb/infcall.c
index d384d16..03749f3 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -1308,10 +1308,8 @@ When the function is done executing, GDB will silently stop."),
{
/* Make a copy as NAME may be in an objfile freed by dummy_frame_pop. */
- char *name = xstrdup (get_function_name (funaddr,
- name_buf, sizeof (name_buf)));
- make_cleanup (xfree, name);
-
+ std::string name = get_function_name (funaddr, name_buf,
+ sizeof (name_buf));
if (stopped_by_random_signal)
{
@@ -1339,7 +1337,7 @@ GDB has restored the context to what it was before the call.\n\
To change this behavior use \"set unwindonsignal off\".\n\
Evaluation of the expression containing the function\n\
(%s) will be abandoned."),
- name);
+ name.c_str ());
}
else
{
@@ -1358,7 +1356,7 @@ To change this behavior use \"set unwindonsignal on\".\n\
Evaluation of the expression containing the function\n\
(%s) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name);
+ name.c_str ());
}
}
@@ -1380,7 +1378,7 @@ context to its original state before the call.\n\
To change this behaviour use \"set unwind-on-terminating-exception off\".\n\
Evaluation of the expression containing the function (%s)\n\
will be abandoned."),
- name);
+ name.c_str ());
}
else if (stop_stack_dummy == STOP_NONE)
{
@@ -1404,7 +1402,7 @@ The program being debugged stopped while in a function called from GDB.\n\
Evaluation of the expression containing the function\n\
(%s) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name);
+ name.c_str ());
}
}