Use std::string in ppscm_make_pp_type_error_exception

This changes ppscm_make_pp_type_error_exception to use std::string,
removing a cleanup.

gdb/ChangeLog
2018-07-17  Tom Tromey  <tom@tromey.com>

	* guile/scm-pretty-print.c (ppscm_make_pp_type_error_exception):
	Use string_printf.
This commit is contained in:
Tom Tromey 2018-05-26 23:16:13 -06:00
parent c691de6a16
commit 7eb1a66c26
2 changed files with 9 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2018-07-17 Tom Tromey <tom@tromey.com>
* guile/scm-pretty-print.c (ppscm_make_pp_type_error_exception):
Use string_printf.
2018-07-17 Jim Wilson <jimw@sifive.com>
* riscv-tdep.c (riscv_has_feature): Delete comment that refers to

View File

@ -327,16 +327,10 @@ gdbscm_pretty_printer_worker_p (SCM scm)
static SCM
ppscm_make_pp_type_error_exception (const char *message, SCM object)
{
char *msg = xstrprintf ("%s: ~S", message);
struct cleanup *cleanup = make_cleanup (xfree, msg);
SCM exception
= gdbscm_make_error (pp_type_error_symbol,
NULL /* func */, msg,
scm_list_1 (object), scm_list_1 (object));
do_cleanups (cleanup);
return exception;
std::string msg = string_printf ("%s: ~S", message);
return gdbscm_make_error (pp_type_error_symbol,
NULL /* func */, msg.c_str (),
scm_list_1 (object), scm_list_1 (object));
}
/* Print MESSAGE as an exception (meaning it is controlled by