diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-07-02 20:38:53 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-07-03 22:27:09 -0400 |
commit | a36158ec0c5145bc3988d9513081a2819353b179 (patch) | |
tree | 96be65e9fb7d4a78c8154ed74d2efc7820265db2 /gdb/macroexp.c | |
parent | 14d960c82a6094551a0c463973b676136e4e60de (diff) | |
download | gdb-a36158ec0c5145bc3988d9513081a2819353b179.zip gdb-a36158ec0c5145bc3988d9513081a2819353b179.tar.gz gdb-a36158ec0c5145bc3988d9513081a2819353b179.tar.bz2 |
gdb: make macro_stringify return a gdb::unique_xmalloc_ptr<char>
The change to macro_stringify is straightforward. This allows removing
the manual memory management in fixup_definition.
gdb/ChangeLog:
* macroexp.h (macro_stringify): Return
gdb::unique_xmalloc_ptr<char>.
* macroexp.c (macro_stringify): Likewise.
* macrotab.c (fixup_definition): Update.
Change-Id: Id7db8988bdbd569dd51c4f4655b00eb26db277cb
Diffstat (limited to 'gdb/macroexp.c')
-rw-r--r-- | gdb/macroexp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/macroexp.c b/gdb/macroexp.c index e1d185d..5f749ff 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -698,7 +698,7 @@ stringify (struct macro_buffer *dest, const char *arg, int len) /* See macroexp.h. */ -char * +gdb::unique_xmalloc_ptr<char> macro_stringify (const char *str) { int len = strlen (str); @@ -707,7 +707,7 @@ macro_stringify (const char *str) stringify (&buffer, str, len); buffer.appendc ('\0'); - return buffer.release ().release (); + return buffer.release (); } |