diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-08-22 10:55:28 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-08-22 10:55:28 -0400 |
commit | 467dc1e2ea5a8b300b61194aa8565829ce7d65bc (patch) | |
tree | 8e7a937f9c0a1c739b9d2bef6ddd9c0a9a0dca38 /gdb/xml-support.c | |
parent | 6d52907e226ade45d5f5196eaed8386affda5156 (diff) | |
download | gdb-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.zip gdb-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.tar.gz gdb-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.tar.bz2 |
Replace xstrvprintf usages with string_vprintf
Most usages of xstrvprintf in GDB can be replaced with string_vprintf,
removing some manual memory management.
gdb/ChangeLog:
* guile/scm-string.c (gdbscm_scm_from_printf): Use
string_vprintf.
* guile/scm-utils.c (gdbscm_printf): Likewise.
* serial.c (serial_printf): Likewise.
* xml-support.c (gdb_xml_parser::vdebug): Likewise.
Diffstat (limited to 'gdb/xml-support.c')
-rw-r--r-- | gdb/xml-support.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/xml-support.c b/gdb/xml-support.c index 3775e2c..7c36ca3 100644 --- a/gdb/xml-support.c +++ b/gdb/xml-support.c @@ -179,16 +179,14 @@ void gdb_xml_parser::vdebug (const char *format, va_list ap) { int line = XML_GetCurrentLineNumber (m_expat_parser); - char *message; - message = xstrvprintf (format, ap); + std::string message = string_vprintf (format, ap); if (line) fprintf_unfiltered (gdb_stderr, "%s (line %d): %s\n", - m_name, line, message); + m_name, line, message.c_str ()); else fprintf_unfiltered (gdb_stderr, "%s: %s\n", - m_name, message); - xfree (message); + m_name, message.c_str ()); } void |