GDB (xrefs)
|
#include "defs.h"
#include "gdbcmd.h"
#include "xml-support.h"
#include "filestuff.h"
#include "safe-ctype.h"
#include "gdb_expat.h"
Go to the source code of this file.
Classes | |
struct | scope_level |
struct | gdb_xml_parser |
struct | xinclude_parsing_data |
Macros | |
#define | MAX_XINCLUDE_DEPTH 30 |
Typedefs | |
typedef struct scope_level | scope_level_s |
Functions | |
DEF_VEC_O (scope_level_s) | |
static void | gdb_xml_body_text (void *data, const XML_Char *text, int length) |
void | gdb_xml_debug (struct gdb_xml_parser *parser, const char *format,...) |
void | gdb_xml_error (struct gdb_xml_parser *parser, const char *format,...) |
struct gdb_xml_value * | xml_find_attribute (VEC(gdb_xml_value_s)*attributes, const char *name) |
static void | gdb_xml_values_cleanup (void *data) |
static void | gdb_xml_start_element (void *data, const XML_Char *name, const XML_Char **attrs) |
static void | gdb_xml_start_element_wrapper (void *data, const XML_Char *name, const XML_Char **attrs) |
static void | gdb_xml_end_element (void *data, const XML_Char *name) |
static void | gdb_xml_end_element_wrapper (void *data, const XML_Char *name) |
static void | gdb_xml_cleanup (void *arg) |
static struct cleanup * | gdb_xml_create_parser_and_cleanup (const char *name, const struct gdb_xml_element *elements, void *user_data, struct gdb_xml_parser **parser_result) |
static int XMLCALL | gdb_xml_fetch_external_entity (XML_Parser expat_parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId) |
void | gdb_xml_use_dtd (struct gdb_xml_parser *parser, const char *dtd_name) |
int | gdb_xml_parse (struct gdb_xml_parser *parser, const char *buffer) |
int | gdb_xml_parse_quick (const char *name, const char *dtd_name, const struct gdb_xml_element *elements, const char *document, void *user_data) |
static int | xml_parse_unsigned_integer (const char *valstr, ULONGEST *valp) |
ULONGEST | gdb_xml_parse_ulongest (struct gdb_xml_parser *parser, const char *value) |
void * | gdb_xml_parse_attr_ulongest (struct gdb_xml_parser *parser, const struct gdb_xml_attribute *attribute, const char *value) |
void * | gdb_xml_parse_attr_enum (struct gdb_xml_parser *parser, const struct gdb_xml_attribute *attribute, const char *value) |
static void | xinclude_start_include (struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, VEC(gdb_xml_value_s)*attributes) |
static void | xinclude_end_include (struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, const char *body_text) |
static void XMLCALL | xml_xinclude_default (void *data_, const XML_Char *s, int len) |
static void XMLCALL | xml_xinclude_start_doctype (void *data_, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset) |
static void XMLCALL | xml_xinclude_end_doctype (void *data_) |
static void XMLCALL | xml_xinclude_xml_decl (void *data_, const XML_Char *version, const XML_Char *encoding, int standalone) |
static void | xml_xinclude_cleanup (void *data_) |
char * | xml_process_xincludes (const char *name, const char *text, xml_fetch_another fetcher, void *fetcher_baton, int depth) |
const char * | fetch_xml_builtin (const char *filename) |
LONGEST | xml_builtin_xfer_partial (const char *filename, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len) |
static void | show_debug_xml (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
void | obstack_xml_printf (struct obstack *obstack, const char *format,...) |
char * | xml_fetch_content_from_file (const char *filename, void *baton) |
void | _initialize_xml_support (void) |
Variables | |
static int | debug_xml |
const struct gdb_xml_enum | gdb_xml_enums_boolean [] |
const struct gdb_xml_attribute | xinclude_attributes [] |
const struct gdb_xml_element | xinclude_elements [] |
#define MAX_XINCLUDE_DEPTH 30 |
Definition at line 37 of file xml-support.c.
Referenced by xinclude_start_include().
typedef struct scope_level scope_level_s |
Definition at line 58 of file xml-support.c.
void _initialize_xml_support | ( | void | ) |
Definition at line 1079 of file xml-support.c.
References _, add_setshow_boolean_cmd(), class_maintenance, debug_xml, setdebuglist, show_debug_xml(), and showdebuglist.
DEF_VEC_O | ( | scope_level_s | ) |
Definition at line 926 of file xml-support.c.
References xml_builtin.
Referenced by gdb_xml_fetch_external_entity(), and xml_builtin_xfer_partial().
Definition at line 84 of file xml-support.c.
References scope_level::body, and VEC_last.
Referenced by gdb_xml_create_parser_and_cleanup().
|
static |
Definition at line 420 of file xml-support.c.
References scope_level::body, gdb_xml_parser::expat_parser, VEC_free, VEC_iterate, and xfree().
Referenced by gdb_xml_create_parser_and_cleanup().
|
static |
Definition at line 444 of file xml-support.c.
References scope_level::elements, gdb_xml_parser::expat_parser, gdb_xml_body_text(), gdb_xml_cleanup(), gdb_xml_end_element_wrapper(), gdb_xml_start_element_wrapper(), make_cleanup(), malloc_failure(), gdb_xml_parser::name, name, gdb_xml_parser::user_data, VEC_safe_push, and xfree().
Referenced by gdb_xml_parse_quick(), and xml_process_xincludes().
void gdb_xml_debug | ( | struct gdb_xml_parser * | parser, |
const char * | format, | ||
... | |||
) |
Definition at line 104 of file xml-support.c.
References debug_xml, gdb_xml_parser::expat_parser, fprintf_unfiltered(), gdb_stderr, line, gdb_xml_parser::name, xfree(), and xstrvprintf().
Referenced by gdb_xml_end_element(), gdb_xml_parse(), gdb_xml_start_element(), memory_map_end_property(), xinclude_start_include(), and xml_process_xincludes().
|
static |
Definition at line 338 of file xml-support.c.
References _, scope_level::body, scope_level::element, scope_level::elements, gdb_xml_element::end_handler, gdb_xml_parser::expat_parser, gdb_xml_element::flags, gdb_xml_debug(), GDB_XML_EF_OPTIONAL, gdb_xml_error(), gdb_xml_element::name, scope_level::seen, gdb_xml_parser::user_data, VEC_last, VEC_pop, and xfree().
Referenced by gdb_xml_end_element_wrapper().
|
static |
Definition at line 396 of file xml-support.c.
References CATCH, END_CATCH, gdb_xml_parser::expat_parser, gdb_xml_end_element(), RETURN_MASK_ALL, and TRY.
Referenced by gdb_xml_create_parser_and_cleanup().
void gdb_xml_error | ( | struct gdb_xml_parser * | parser, |
const char * | format, | ||
... | |||
) |
Definition at line 128 of file xml-support.c.
References gdb_xml_parser::expat_parser, line, throw_verror(), and XML_PARSE_ERROR.
Referenced by check_xml_btrace_version(), gdb_xml_end_element(), gdb_xml_parse_attr_enum(), gdb_xml_parse_attr_ulongest(), gdb_xml_parse_ulongest(), gdb_xml_start_element(), library_list_end_library(), library_list_start_list(), library_list_start_section(), library_list_start_segment(), memory_map_end_memory(), osdata_start_osdata(), parse_xml_btrace_block(), parse_xml_raw(), svr4_library_list_start_list(), tdesc_end_arch(), tdesc_start_field(), tdesc_start_reg(), tdesc_start_target(), tdesc_start_vector(), and xinclude_start_include().
|
static |
Definition at line 486 of file xml-support.c.
References _, fetch_xml_builtin(), internal_error(), status, and XML_STATUS_ERROR.
Referenced by gdb_xml_use_dtd().
int gdb_xml_parse | ( | struct gdb_xml_parser * | parser, |
const char * | buffer | ||
) |
Definition at line 559 of file xml-support.c.
References _, err, gdb_xml_parser::expat_parser, gdb_assert, gdb_xml_debug(), gdb_xml_parser::name, RETURN_ERROR, status, throw_exception(), warning(), XML_PARSE_ERROR, XML_STATUS_ERROR, and XML_STATUS_OK.
Referenced by gdb_xml_parse_quick(), and xml_process_xincludes().
void* gdb_xml_parse_attr_enum | ( | struct gdb_xml_parser * | parser, |
const struct gdb_xml_attribute * | attribute, | ||
const char * | value | ||
) |
Definition at line 688 of file xml-support.c.
References _, gdb_xml_error(), gdb_xml_attribute::handler_data, gdb_xml_attribute::name, gdb_xml_enum::name, gdb_xml_enum::value, and xmalloc().
void* gdb_xml_parse_attr_ulongest | ( | struct gdb_xml_parser * | parser, |
const struct gdb_xml_attribute * | attribute, | ||
const char * | value | ||
) |
Definition at line 658 of file xml-support.c.
References _, gdb_xml_error(), gdb_xml_attribute::name, xmalloc(), and xml_parse_unsigned_integer().
int gdb_xml_parse_quick | ( | const char * | name, |
const char * | dtd_name, | ||
const struct gdb_xml_element * | elements, | ||
const char * | document, | ||
void * | user_data | ||
) |
Definition at line 599 of file xml-support.c.
References do_cleanups(), gdb_xml_create_parser_and_cleanup(), gdb_xml_parse(), and gdb_xml_use_dtd().
Referenced by osdata_parse(), parse_traceframe_info(), parse_xml_btrace(), parse_xml_btrace_conf(), remote_get_threads_with_qxfer(), svr4_parse_libraries(), syscall_parse_xml(), tdesc_parse_xml(), and VEC().
ULONGEST gdb_xml_parse_ulongest | ( | struct gdb_xml_parser * | parser, |
const char * | value | ||
) |
Definition at line 645 of file xml-support.c.
References _, gdb_xml_error(), and xml_parse_unsigned_integer().
Referenced by memory_map_end_property(), and traceframe_info_start_tvar().
|
static |
Definition at line 173 of file xml-support.c.
References _, gdb_xml_element::attributes, gdb_xml_element::children, debug_xml, do_cleanups(), scope_level::element, scope_level::elements, gdb_xml_parser::expat_parser, gdb_xml_attribute::flags, gdb_xml_element::flags, GDB_XML_AF_OPTIONAL, gdb_xml_debug(), GDB_XML_EF_REPEATABLE, gdb_xml_error(), gdb_xml_values_cleanup(), gdb_xml_attribute::handler, make_cleanup(), gdb_xml_value::name, gdb_xml_attribute::name, gdb_xml_element::name, scope_level::seen, gdb_xml_element::start_handler, gdb_xml_parser::user_data, gdb_xml_value::value, VEC, VEC_last, VEC_quick_push, VEC_reserve, and VEC_safe_push.
Referenced by gdb_xml_start_element_wrapper().
|
static |
Definition at line 312 of file xml-support.c.
References CATCH, END_CATCH, gdb_xml_parser::expat_parser, gdb_xml_start_element(), RETURN_MASK_ALL, and TRY.
Referenced by gdb_xml_create_parser_and_cleanup().
void gdb_xml_use_dtd | ( | struct gdb_xml_parser * | parser, |
const char * | dtd_name | ||
) |
Definition at line 532 of file xml-support.c.
References _, err, gdb_xml_parser::expat_parser, gdb_xml_fetch_external_entity(), and internal_error().
Referenced by gdb_xml_parse_quick(), and xml_process_xincludes().
|
static |
Definition at line 157 of file xml-support.c.
References gdb_xml_value::value, VEC, VEC_free, VEC_iterate, and xfree().
Referenced by gdb_xml_start_element().
void obstack_xml_printf | ( | struct obstack * | obstack, |
const char * | format, | ||
... | |||
) |
Definition at line 976 of file xml-support.c.
References obstack_grow_str, xfree(), and xml_escape_text().
|
static |
Definition at line 969 of file xml-support.c.
References _, and fprintf_filtered().
Referenced by _initialize_xml_support().
|
static |
Definition at line 788 of file xml-support.c.
References xinclude_parsing_data::skip_depth.
|
static |
Definition at line 753 of file xml-support.c.
References _, do_cleanups(), xinclude_parsing_data::fetcher, xinclude_parsing_data::fetcher_baton, gdb_xml_debug(), gdb_xml_error(), xinclude_parsing_data::include_depth, make_cleanup(), MAX_XINCLUDE_DEPTH, gdb_xml_parser::name, xinclude_parsing_data::obstack, xinclude_parsing_data::skip_depth, gdb_xml_value::value, xfree(), xml_find_attribute(), and xml_process_xincludes().
LONGEST xml_builtin_xfer_partial | ( | const char * | filename, |
gdb_byte * | readbuf, | ||
const gdb_byte * | writebuf, | ||
ULONGEST | offset, | ||
LONGEST | len | ||
) |
Definition at line 943 of file xml-support.c.
References fetch_xml_builtin(), gdb_assert, len, and offset.
char* xml_fetch_content_from_file | ( | const char * | filename, |
void * | baton | ||
) |
Definition at line 1016 of file xml-support.c.
References _, discard_cleanups(), do_cleanups(), free_current_contents(), gdb_fopen_cloexec(), len, make_cleanup(), make_cleanup_fclose(), malloc_failure(), offset, warning(), xfree(), xmalloc(), and xrealloc().
Referenced by file_read_description_xml(), and xml_init_syscalls_info().
struct gdb_xml_value* xml_find_attribute | ( | VEC(gdb_xml_value_s)* | attributes, |
const char * | name | ||
) |
Definition at line 142 of file xml-support.c.
References gdb_xml_value::name, gdb_xml_value::value, and VEC_iterate.
Referenced by check_xml_btrace_version(), library_list_start_library(), library_list_start_list(), library_list_start_section(), library_list_start_segment(), memory_map_start_memory(), memory_map_start_property(), osdata_start_column(), osdata_start_osdata(), parse_xml_btrace_block(), parse_xml_btrace_conf_bts(), parse_xml_btrace_conf_pt(), parse_xml_btrace_pt_config_cpu(), start_thread(), svr4_library_list_start_list(), tdesc_start_feature(), tdesc_start_field(), tdesc_start_flags(), tdesc_start_struct(), tdesc_start_target(), tdesc_start_union(), traceframe_info_start_memory(), traceframe_info_start_tvar(), and xinclude_start_include().
Definition at line 625 of file xml-support.c.
References strtoulst().
Referenced by gdb_xml_parse_attr_ulongest(), and gdb_xml_parse_ulongest().
char* xml_process_xincludes | ( | const char * | name, |
const char * | text, | ||
xml_fetch_another | fetcher, | ||
void * | fetcher_baton, | ||
int | depth | ||
) |
Definition at line 868 of file xml-support.c.
References _, do_cleanups(), gdb_xml_parser::expat_parser, xinclude_parsing_data::fetcher, xinclude_parsing_data::fetcher_baton, gdb_xml_create_parser_and_cleanup(), gdb_xml_debug(), gdb_xml_parse(), gdb_xml_use_dtd(), xinclude_parsing_data::include_depth, make_cleanup(), xinclude_parsing_data::obstack, xml_xinclude_cleanup(), xml_xinclude_default(), xml_xinclude_end_doctype(), xml_xinclude_start_doctype(), and xml_xinclude_xml_decl().
Referenced by tdesc_parse_xml(), and xinclude_start_include().
|
static |
Definition at line 845 of file xml-support.c.
References xinclude_parsing_data::obstack, and xfree().
Referenced by xml_process_xincludes().
Definition at line 798 of file xml-support.c.
References xinclude_parsing_data::obstack, xinclude_parsing_data::skip_depth, and gdb_xml_parser::user_data.
Referenced by xml_process_xincludes().
|
static |
Definition at line 827 of file xml-support.c.
References xinclude_parsing_data::skip_depth, and gdb_xml_parser::user_data.
Referenced by xml_process_xincludes().
|
static |
Definition at line 814 of file xml-support.c.
References xinclude_parsing_data::skip_depth, and gdb_xml_parser::user_data.
Referenced by xml_process_xincludes().
|
static |
Definition at line 836 of file xml-support.c.
Referenced by xml_process_xincludes().
|
static |
Definition at line 27 of file xml-support.c.
Referenced by _initialize_xml_support(), gdb_xml_debug(), and gdb_xml_start_element().
const struct gdb_xml_enum gdb_xml_enums_boolean[] |
Definition at line 676 of file xml-support.c.
const struct gdb_xml_attribute xinclude_attributes[] |
Definition at line 853 of file xml-support.c.
const struct gdb_xml_element xinclude_elements[] |
Definition at line 858 of file xml-support.c.