GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
/tmp/gdb-13.1/gdb/xml-support.c File Reference
#include "defs.h"
#include "gdbcmd.h"
#include "xml-builtin.h"
#include "xml-support.h"
#include "gdbsupport/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 (std::vector< gdb_xml_value > &attributes, const char *name)
 
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, std::vector< gdb_xml_value > &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, 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::optional< gdb::char_vector > xml_fetch_content_from_file (const char *filename, const char *dirname)
 
void _initialize_xml_support ()
 

Variables

static bool 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 40 of file xml-support.c.

Function Documentation

◆ _initialize_xml_support()

void _initialize_xml_support ( )

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

Referenced by initialize_all_files().

◆ fetch_xml_builtin()

const char * fetch_xml_builtin ( const char *  filename)

Definition at line 914 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 170 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 668 of file xml-support.c.

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

◆ 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

◆ 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 957 of file xml-support.c.

References gdb_printf().

◆ 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 801 of file xml-support.c.

◆ xinclude_start_include()

static void xinclude_start_include ( struct gdb_xml_parser parser,
const struct gdb_xml_element element,
void *  user_data,
std::vector< gdb_xml_value > &  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 931 of file xml-support.c.

References fetch_xml_builtin().

◆ xml_fetch_content_from_file()

gdb::optional< gdb::char_vector > xml_fetch_content_from_file ( const char *  filename,
const char *  dirname 
)

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

References perror_with_name().

Referenced by file_read_description_xml(), and xml_init_syscalls_info().

◆ xml_find_attribute()

struct gdb_xml_value * xml_find_attribute ( std::vector< gdb_xml_value > &  attributes,
const char *  name 
)

◆ xml_parse_unsigned_integer()

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

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

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,
int  depth 
)

◆ xml_xinclude_default()

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

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

References gdb_xml_parser::user_data().

Referenced by xml_process_xincludes().

◆ xml_xinclude_end_doctype()

static void XMLCALL xml_xinclude_end_doctype ( void *  data_)
static

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

References 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 828 of file xml-support.c.

References 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 850 of file xml-support.c.

Referenced by xml_process_xincludes().

Variable Documentation

◆ debug_xml

bool debug_xml
static

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

Referenced by gdb_xml_debug(), and gdb_xml_parser::start_element().

◆ gdb_xml_enums_boolean

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

Definition at line 686 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 }
}
@ GDB_XML_AF_NONE
Definition: xml-support.h:104

Definition at line 858 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:801
const struct gdb_xml_attribute xinclude_attributes[]
Definition: xml-support.c:858
static void xinclude_start_include(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, std::vector< gdb_xml_value > &attributes)
Definition: xml-support.c:773
@ GDB_XML_EF_NONE
Definition: xml-support.h:125
@ GDB_XML_EF_REPEATABLE
Definition: xml-support.h:127
@ GDB_XML_EF_OPTIONAL
Definition: xml-support.h:126

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

Referenced by xml_process_xincludes().