#include "defs.h"
#include "gdbcmd.h"
+#include "xml-builtin.h"
#include "xml-support.h"
-#include "common/filestuff.h"
+#include "gdbsupport/filestuff.h"
#include "safe-ctype.h"
#include <vector>
#include <string>
/* Debugging flag. */
-static int debug_xml;
+static bool debug_xml;
/* The contents of this file are only useful if XML support is
available. */
{ m_is_xinclude = is_xinclude; }
/* A thrown error, if any. */
- void set_error (gdb_exception error)
+ void set_error (gdb_exception &&error)
{
- m_error = error;
+ m_error = std::move (error);
#ifdef HAVE_XML_STOPPARSER
XML_StopParser (m_expat_parser, XML_FALSE);
#endif
{
parser->start_element (name, attrs);
}
- catch (const gdb_exception_RETURN_MASK_ALL &ex)
+ catch (gdb_exception &ex)
{
- parser->set_error (ex);
+ parser->set_error (std::move (ex));
}
}
{
parser->end_element (name);
}
- catch (const gdb_exception_RETURN_MASK_ALL &ex)
+ catch (gdb_exception &ex)
{
- parser->set_error (ex);
+ parser->set_error (std::move (ex));
}
}
void *user_data)
: m_name (name),
m_user_data (user_data),
- m_error (exception_none),
m_last_line (0),
m_dtd_name (NULL),
m_is_xinclude (false)
else
{
gdb_assert (m_error.reason < 0);
- throw_exception (m_error);
+ throw_exception (std::move (m_error));
}
if (m_last_line != 0)
const char *
fetch_xml_builtin (const char *filename)
{
- const char *(*p)[2];
+ const char *const (*p)[2];
for (p = xml_builtin; (*p)[0]; p++)
if (strcmp ((*p)[0], filename) == 0)
{
char *fullname = concat (dirname, "/", filename, (char *) NULL);
- if (fullname == NULL)
- malloc_failure (0);
file = gdb_fopen_cloexec (fullname, FOPEN_RT);
xfree (fullname);
}