Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 2/3] Remove cleanup from call_function_by_hand_dummy
Date: Wed, 18 Oct 2017 04:06:00 -0000	[thread overview]
Message-ID: <20171018040645.7212-2-tom@tromey.com> (raw)
In-Reply-To: <20171018040645.7212-1-tom@tromey.com>

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

ChangeLog
2017-10-17  Tom Tromey  <tom@tromey.com>

	* infcall.c (call_function_by_hand_dummy): Use std::string.
---
 gdb/ChangeLog |  4 ++++
 gdb/infcall.c | 14 ++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/gdb/infcall.c b/gdb/infcall.c
index d384d16c29..03749f3dc2 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 ());
 	}
 
     }
-- 
2.13.6


      parent reply	other threads:[~2017-10-18  4:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18  4:06 [RFA 1/3] Remove cleanups from prepare_execute_command Tom Tromey
2017-10-18  4:06 ` [RFA 3/3] Remove cleanups from break-catch-syscall.c Tom Tromey
2017-10-19 21:00   ` Simon Marchi
2017-10-19 21:57     ` Tom Tromey
2017-10-19 21:57       ` Tom Tromey
2017-10-20 20:26   ` Simon Marchi
2017-10-25  4:42     ` Tom Tromey
2017-10-25 10:38       ` Pedro Alves
2017-10-25 14:50         ` Tom Tromey
2017-12-06 18:58     ` Sergio Durigan Junior
2017-12-06 21:41       ` Simon Marchi
2017-10-18  4:06 ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171018040645.7212-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox