Remove cleanups from cp-support.c
This removes some cleanups from cp-support.c, using std::string. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * cp-support.c (gdb_demangle): Use std::string.
This commit is contained in:
parent
2003f3d839
commit
6ad94bc766
|
@ -1,3 +1,7 @@
|
||||||
|
2017-09-29 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* cp-support.c (gdb_demangle): Use std::string.
|
||||||
|
|
||||||
2017-09-29 Tom Tromey <tom@tromey.com>
|
2017-09-29 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* stack.c (parse_frame_specification): Use std::string
|
* stack.c (parse_frame_specification): Use std::string
|
||||||
|
|
|
@ -1546,17 +1546,14 @@ gdb_demangle (const char *name, int options)
|
||||||
|
|
||||||
if (!error_reported)
|
if (!error_reported)
|
||||||
{
|
{
|
||||||
char *short_msg, *long_msg;
|
std::string short_msg
|
||||||
struct cleanup *back_to;
|
= string_printf (_("unable to demangle '%s' "
|
||||||
|
|
||||||
short_msg = xstrprintf (_("unable to demangle '%s' "
|
|
||||||
"(demangler failed with signal %d)"),
|
"(demangler failed with signal %d)"),
|
||||||
name, crash_signal);
|
name, crash_signal);
|
||||||
back_to = make_cleanup (xfree, short_msg);
|
|
||||||
|
|
||||||
long_msg = xstrprintf ("%s:%d: %s: %s", __FILE__, __LINE__,
|
std::string long_msg
|
||||||
"demangler-warning", short_msg);
|
= string_printf ("%s:%d: %s: %s", __FILE__, __LINE__,
|
||||||
make_cleanup (xfree, long_msg);
|
"demangler-warning", short_msg.c_str ());
|
||||||
|
|
||||||
target_terminal::scoped_restore_terminal_state term_state;
|
target_terminal::scoped_restore_terminal_state term_state;
|
||||||
target_terminal::ours_for_output ();
|
target_terminal::ours_for_output ();
|
||||||
|
@ -1565,13 +1562,11 @@ gdb_demangle (const char *name, int options)
|
||||||
if (core_dump_allowed)
|
if (core_dump_allowed)
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr,
|
||||||
_("%s\nAttempting to dump core.\n"),
|
_("%s\nAttempting to dump core.\n"),
|
||||||
long_msg);
|
long_msg.c_str ());
|
||||||
else
|
else
|
||||||
warn_cant_dump_core (long_msg);
|
warn_cant_dump_core (long_msg.c_str ());
|
||||||
|
|
||||||
demangler_warning (__FILE__, __LINE__, "%s", short_msg);
|
demangler_warning (__FILE__, __LINE__, "%s", short_msg.c_str ());
|
||||||
|
|
||||||
do_cleanups (back_to);
|
|
||||||
|
|
||||||
error_reported = 1;
|
error_reported = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue