GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-7.10/gdb/xml-support.c File Reference
#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_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 (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 cleanupgdb_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 []
 

Macro Definition Documentation

#define MAX_XINCLUDE_DEPTH   30

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

Referenced by xinclude_start_include().

Typedef Documentation

typedef struct scope_level scope_level_s

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

Function Documentation

void _initialize_xml_support ( void  )
DEF_VEC_O ( scope_level_s  )
const char* fetch_xml_builtin ( const char *  filename)

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

References xml_builtin.

Referenced by gdb_xml_fetch_external_entity(), and xml_builtin_xfer_partial().

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

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 void gdb_xml_cleanup ( void *  arg)
static
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
void gdb_xml_debug ( struct gdb_xml_parser parser,
const char *  format,
  ... 
)
static void gdb_xml_end_element ( void *  data,
const XML_Char *  name 
)
static
static void gdb_xml_end_element_wrapper ( void *  data,
const XML_Char *  name 
)
static
void gdb_xml_error ( struct gdb_xml_parser parser,
const char *  format,
  ... 
)
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

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 
)
void* gdb_xml_parse_attr_enum ( struct gdb_xml_parser parser,
const struct gdb_xml_attribute attribute,
const char *  value 
)
void* gdb_xml_parse_attr_ulongest ( struct gdb_xml_parser parser,
const struct gdb_xml_attribute attribute,
const char *  value 
)
int gdb_xml_parse_quick ( const char *  name,
const char *  dtd_name,
const struct gdb_xml_element elements,
const char *  document,
void *  user_data 
)
ULONGEST gdb_xml_parse_ulongest ( struct gdb_xml_parser parser,
const char *  value 
)
static void gdb_xml_start_element ( void *  data,
const XML_Char *  name,
const XML_Char **  attrs 
)
static
static void gdb_xml_start_element_wrapper ( void *  data,
const XML_Char *  name,
const XML_Char **  attrs 
)
static
void gdb_xml_use_dtd ( struct gdb_xml_parser parser,
const char *  dtd_name 
)
static void gdb_xml_values_cleanup ( void *  data)
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 void show_debug_xml ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

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

References _, and fprintf_filtered().

Referenced by _initialize_xml_support().

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

References xinclude_parsing_data::skip_depth.

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
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 
)
struct gdb_xml_value* xml_find_attribute ( VEC(gdb_xml_value_s)*  attributes,
const char *  name 
)
static int xml_parse_unsigned_integer ( const char *  valstr,
ULONGEST valp 
)
static

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 
)
static void xml_xinclude_cleanup ( void *  data_)
static

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

References xinclude_parsing_data::obstack, and xfree().

Referenced by xml_process_xincludes().

static void XMLCALL xml_xinclude_default ( void *  data_,
const XML_Char *  s,
int  len 
)
static
static void XMLCALL xml_xinclude_end_doctype ( void *  data_)
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 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 814 of file xml-support.c.

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

Referenced by xml_process_xincludes().

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

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

Referenced by xml_process_xincludes().

Variable Documentation

int debug_xml
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[]
Initial value:
= {
{ "yes", 1 },
{ "no", 0 },
{ NULL, 0 }
}

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

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

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:788
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:753
const struct gdb_xml_attribute xinclude_attributes[]
Definition: xml-support.c:853

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