projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git]
/
gdb
/
xml-support.c
diff --git
a/gdb/xml-support.c
b/gdb/xml-support.c
index 587a3af74cb3013c18c3f1710263a470c07464d8..bace5243ec089ff2361e7f926d57b661214333c2 100644
(file)
--- a/
gdb/xml-support.c
+++ b/
gdb/xml-support.c
@@
-1,6
+1,6
@@
/* Helper routines for parsing XML using Expat.
/* Helper routines for parsing XML using Expat.
- Copyright (C) 2006-20
19
Free Software Foundation, Inc.
+ Copyright (C) 2006-20
20
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-19,14
+19,15
@@
#include "defs.h"
#include "gdbcmd.h"
#include "defs.h"
#include "gdbcmd.h"
+#include "xml-builtin.h"
#include "xml-support.h"
#include "xml-support.h"
-#include "
common
/filestuff.h"
+#include "
gdbsupport
/filestuff.h"
#include "safe-ctype.h"
#include <vector>
#include <string>
/* Debugging flag. */
#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. */
/* The contents of this file are only useful if XML support is
available. */
@@
-113,9
+114,9
@@
struct gdb_xml_parser
{ m_is_xinclude = is_xinclude; }
/* A thrown error, if any. */
{ 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
#ifdef HAVE_XML_STOPPARSER
XML_StopParser (m_expat_parser, XML_FALSE);
#endif
@@
-383,15
+384,14
@@
gdb_xml_start_element_wrapper (void *data, const XML_Char *name,
{
struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
{
struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
- TRY
+ try
{
parser->start_element (name, attrs);
}
{
parser->start_element (name, attrs);
}
-
CATCH (ex, RETURN_MASK_ALL
)
+
catch (gdb_exception &ex
)
{
{
- parser->set_error (
ex
);
+ parser->set_error (
std::move (ex)
);
}
}
- END_CATCH
}
/* Handle the end of an element. NAME is the current element. */
}
/* Handle the end of an element. NAME is the current element. */
@@
-456,15
+456,14
@@
gdb_xml_end_element_wrapper (void *data, const XML_Char *name)
{
struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
{
struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
- TRY
+ try
{
parser->end_element (name);
}
{
parser->end_element (name);
}
-
CATCH (ex, RETURN_MASK_ALL
)
+
catch (gdb_exception &ex
)
{
{
- parser->set_error (
ex
);
+ parser->set_error (
std::move (ex)
);
}
}
- END_CATCH
}
/* Free a parser and all its associated state. */
}
/* Free a parser and all its associated state. */
@@
-481,7
+480,6
@@
gdb_xml_parser::gdb_xml_parser (const char *name,
void *user_data)
: m_name (name),
m_user_data (user_data),
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)
m_last_line (0),
m_dtd_name (NULL),
m_is_xinclude (false)
@@
-606,7
+604,7
@@
gdb_xml_parser::parse (const char *buffer)
else
{
gdb_assert (m_error.reason < 0);
else
{
gdb_assert (m_error.reason < 0);
- throw_exception (
m_error
);
+ throw_exception (
std::move (m_error)
);
}
if (m_last_line != 0)
}
if (m_last_line != 0)
@@
-922,7
+920,7
@@
xml_process_xincludes (std::string &result,
const char *
fetch_xml_builtin (const char *filename)
{
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)
for (p = xml_builtin; (*p)[0]; p++)
if (strcmp ((*p)[0], filename) == 0)
@@
-979,13
+977,11
@@
xml_fetch_content_from_file (const char *filename, void *baton)
{
char *fullname = concat (dirname, "/", filename, (char *) NULL);
{
char *fullname = concat (dirname, "/", filename, (char *) NULL);
- if (fullname == NULL)
- malloc_failure (0);
- file = gdb_fopen_cloexec (fullname, FOPEN_RT);
+ file = gdb_fopen_cloexec (fullname, FOPEN_RB);
xfree (fullname);
}
else
xfree (fullname);
}
else
- file = gdb_fopen_cloexec (filename, FOPEN_R
T
);
+ file = gdb_fopen_cloexec (filename, FOPEN_R
B
);
if (file == NULL)
return {};
if (file == NULL)
return {};
This page took
0.032417 seconds
and
4
git commands to generate.