mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
Make xml_escape_text return an std::string
This is a simple replacement, it allows removing some manual free'ing in the callers. gdb/ChangeLog: * common/buffer.c (buffer_xml_printf): Adjust. * common/xml-utils.c (xml_escape_text): Change return type to std::string, update code accordingly. * common/xml-utils.h (xml_escape_text): Change return type to std::string. * rs6000-aix-tdep.c (rs6000_aix_shared_library_to_xml): Adjust. * windows-tdep.c (windows_xfer_shared_library): Adjust. * unittests/xml-utils-selftests.c (test_xml_escape_text): Adjust. gdb/gdbserver/ChangeLog: * linux-low.c (linux_qxfer_libraries_svr4): Adjust to change of return type of xml_escape_text. * server.c (emit_dll_description): Likewise.
This commit is contained in:
@ -908,20 +908,16 @@ static void
|
||||
rs6000_aix_shared_library_to_xml (struct ld_info *ldi,
|
||||
struct obstack *obstack)
|
||||
{
|
||||
char *p;
|
||||
|
||||
obstack_grow_str (obstack, "<library name=\"");
|
||||
p = xml_escape_text (ldi->filename);
|
||||
obstack_grow_str (obstack, p);
|
||||
xfree (p);
|
||||
std::string p = xml_escape_text (ldi->filename);
|
||||
obstack_grow_str (obstack, p.c_str ());
|
||||
obstack_grow_str (obstack, "\"");
|
||||
|
||||
if (ldi->member_name[0] != '\0')
|
||||
{
|
||||
obstack_grow_str (obstack, " member=\"");
|
||||
p = xml_escape_text (ldi->member_name);
|
||||
obstack_grow_str (obstack, p);
|
||||
xfree (p);
|
||||
obstack_grow_str (obstack, p.c_str ());
|
||||
obstack_grow_str (obstack, "\"");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user