GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/xml-support.c File Reference
#include "defs.h"
#include "gdbcmd.h"
#include "xml-support.h"
#include "filestuff.h"
#include "safe-ctype.h"
#include <vector>
#include <string>
#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
 

Functions

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_valuexml_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_wrapper (void *data, const XML_Char *name, const XML_Char **attrs)
 
static void gdb_xml_end_element_wrapper (void *data, const XML_Char *name)
 
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)
 
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)
 
bool xml_process_xincludes (std::string &result, 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)
 
gdb::unique_xmalloc_ptr< 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 []
 

Macro Definition Documentation

◆ MAX_XINCLUDE_DEPTH

#define MAX_XINCLUDE_DEPTH   30

Definition at line 39 of file xml-support.c.

Referenced by xinclude_start_include().

Function Documentation

◆ _initialize_xml_support()

void _initialize_xml_support ( void  )

◆ fetch_xml_builtin()

const char* fetch_xml_builtin ( const char *  filename)

Definition at line 947 of file xml-support.c.

References xml_builtin.

Referenced by gdb_xml_fetch_external_entity(), and xml_builtin_xfer_partial().

◆ gdb_xml_body_text()

static void gdb_xml_body_text ( void *  data,
const XML_Char *  text,
int  length 
)
static

Definition at line 169 of file xml-support.c.

References gdb_xml_parser::body_text().

Referenced by gdb_xml_parser::gdb_xml_parser().

◆ gdb_xml_debug()

void gdb_xml_debug ( struct gdb_xml_parser parser,
const char *  format,
  ... 
)

◆ gdb_xml_end_element_wrapper()

static void gdb_xml_end_element_wrapper ( void *  data,
const XML_Char *  name 
)
static

◆ gdb_xml_error()

void gdb_xml_error ( struct gdb_xml_parser parser,
const char *  format,
  ... 
)

◆ gdb_xml_fetch_external_entity()

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 
)
static

◆ gdb_xml_parse_attr_enum()

void* gdb_xml_parse_attr_enum ( struct gdb_xml_parser parser,
const struct gdb_xml_attribute attribute,
const char *  value 
)

◆ gdb_xml_parse_attr_ulongest()

void* gdb_xml_parse_attr_ulongest ( struct gdb_xml_parser parser,
const struct gdb_xml_attribute attribute,
const char *  value 
)

Definition at line 697 of file xml-support.c.

References _, gdb_xml_error(), attribute::name, xml_parse_unsigned_integer(), and XNEW.

◆ gdb_xml_parse_quick()

int gdb_xml_parse_quick ( const char *  name,
const char *  dtd_name,
const struct gdb_xml_element elements,
const char *  document,
void *  user_data 
)

◆ gdb_xml_parse_ulongest()

ULONGEST gdb_xml_parse_ulongest ( struct gdb_xml_parser parser,
const char *  value 
)

◆ gdb_xml_start_element_wrapper()

static void gdb_xml_start_element_wrapper ( void *  data,
const XML_Char *  name,
const XML_Char **  attrs 
)
static

◆ gdb_xml_values_cleanup()

static void gdb_xml_values_cleanup ( void *  data)
static

Definition at line 246 of file xml-support.c.

References gdb_xml_value::value, VEC, VEC_free, VEC_iterate, and xfree().

Referenced by gdb_xml_parser::start_element().

◆ show_debug_xml()

static void show_debug_xml ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 990 of file xml-support.c.

References _, and fprintf_filtered().

Referenced by _initialize_xml_support().

◆ xinclude_end_include()

static void xinclude_end_include ( struct gdb_xml_parser parser,
const struct gdb_xml_element element,
void *  user_data,
const char *  body_text 
)
static

Definition at line 833 of file xml-support.c.

References xinclude_parsing_data::skip_depth.

◆ xinclude_start_include()

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

◆ xml_builtin_xfer_partial()

LONGEST xml_builtin_xfer_partial ( const char *  filename,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)

Definition at line 964 of file xml-support.c.

References fetch_xml_builtin(), gdb_assert, and offset.

◆ xml_fetch_content_from_file()

gdb::unique_xmalloc_ptr<char> xml_fetch_content_from_file ( const char *  filename,
void *  baton 
)

◆ xml_find_attribute()

struct gdb_xml_value* xml_find_attribute ( VEC(gdb_xml_value_s) *  attributes,
const char *  name 
)

◆ xml_parse_unsigned_integer()

static int xml_parse_unsigned_integer ( const char *  valstr,
ULONGEST valp 
)
static

Definition at line 664 of file xml-support.c.

References strtoulst().

Referenced by gdb_xml_parse_attr_ulongest(), and gdb_xml_parse_ulongest().

◆ xml_process_xincludes()

bool xml_process_xincludes ( std::string result,
const char *  name,
const char *  text,
xml_fetch_another  fetcher,
void *  fetcher_baton,
int  depth 
)

◆ xml_xinclude_default()

static void XMLCALL xml_xinclude_default ( void *  data_,
const XML_Char *  s,
int  len 
)
static

◆ xml_xinclude_end_doctype()

static void XMLCALL xml_xinclude_end_doctype ( void *  data_)
static

Definition at line 873 of file xml-support.c.

References xinclude_parsing_data::skip_depth, and gdb_xml_parser::user_data().

Referenced by xml_process_xincludes().

◆ xml_xinclude_start_doctype()

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

Definition at line 860 of file xml-support.c.

References xinclude_parsing_data::skip_depth, and gdb_xml_parser::user_data().

Referenced by xml_process_xincludes().

◆ xml_xinclude_xml_decl()

static void XMLCALL xml_xinclude_xml_decl ( void *  data_,
const XML_Char *  version,
const XML_Char *  encoding,
int  standalone 
)
static

Definition at line 882 of file xml-support.c.

Referenced by xml_process_xincludes().

Variable Documentation

◆ debug_xml

int debug_xml
static

◆ gdb_xml_enums_boolean

const struct gdb_xml_enum gdb_xml_enums_boolean[]
Initial value:
= {
{ "yes", 1 },
{ "no", 0 },
{ NULL, 0 }
}

Definition at line 715 of file xml-support.c.

◆ xinclude_attributes

const struct gdb_xml_attribute xinclude_attributes[]
Initial value:
= {
{ "href", GDB_XML_AF_NONE, NULL, NULL },
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
}

Definition at line 890 of file xml-support.c.

◆ xinclude_elements

const struct gdb_xml_element xinclude_elements[]
Initial value:
= {
{ "http://www.w3.org/2001/XInclude!include", xinclude_attributes, NULL,
{ NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
}
static void xinclude_end_include(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, const char *body_text)
Definition: xml-support.c:833
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)
Definition: xml-support.c:804
const struct gdb_xml_attribute xinclude_attributes[]
Definition: xml-support.c:890

Definition at line 895 of file xml-support.c.

Referenced by xml_process_xincludes().