From 281d762b1a56317171e462666b98d50bfa31a08a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 21 Feb 2018 16:53:56 -0700 Subject: Remove cleanups from check_fast_tracepoint_sals This changes the gdbarch fast_tracepoint_valid_at method to use a std::string as its out parameter, and then updates all the uses. This allows removing a cleanup from breakpoint.c. Regression tested by the buildbot. ChangeLog 2018-02-24 Tom Tromey * i386-tdep.c (i386_fast_tracepoint_valid_at): "msg" now a std::string. * gdbarch.sh (fast_tracepoint_valid_at): Change "msg" to a std::string*. * gdbarch.c: Rebuild. * gdbarch.h: Rebuild. * breakpoint.c (check_fast_tracepoint_sals): Use std::string. * arch-utils.h (default_fast_tracepoint_valid_at): Update. * arch-utils.c (default_fast_tracepoint_valid_at): "msg" now a std::string*. --- gdb/i386-tdep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/i386-tdep.c') diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 6b59278..60dc801 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8111,7 +8111,7 @@ static const int i386_record_regmap[] = static int i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, - char **msg) + std::string *msg) { int len, jumplen; @@ -8144,15 +8144,15 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, /* Return a bit of target-specific detail to add to the caller's generic failure message. */ if (msg) - *msg = xstrprintf (_("; instruction is only %d bytes long, " - "need at least %d bytes for the jump"), - len, jumplen); + *msg = string_printf (_("; instruction is only %d bytes long, " + "need at least %d bytes for the jump"), + len, jumplen); return 0; } else { if (msg) - *msg = NULL; + msg->clear (); return 1; } } -- cgit v1.1