aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-26 23:16:13 -0600
committerTom Tromey <tom@tromey.com>2018-07-17 13:21:46 -0600
commit7eb1a66c26b57803bb4245f84cf15278297bb649 (patch)
tree66f98dfddf0df90c07980b8f6382873943e6b745 /gdb/guile
parentc691de6a16a87adc686ce5cd6c9be54ee0b1a8c1 (diff)
downloadgdb-7eb1a66c26b57803bb4245f84cf15278297bb649.zip
gdb-7eb1a66c26b57803bb4245f84cf15278297bb649.tar.gz
gdb-7eb1a66c26b57803bb4245f84cf15278297bb649.tar.bz2
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.
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/scm-pretty-print.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index da1b7d2..5e8a2a9 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -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