GDB (xrefs)
|
#include "defs.h"
#include "gdb_obstack.h"
#include "bcache.h"
#include "macrotab.h"
#include "macroexp.h"
#include "c-lang.h"
Go to the source code of this file.
Classes | |
struct | macro_buffer |
struct | macro_name_list |
Functions | |
static void | init_buffer (struct macro_buffer *b, int n) |
static void | init_shared_buffer (struct macro_buffer *buf, char *addr, int len) |
static void | free_buffer (struct macro_buffer *b) |
static char * | free_buffer_return_text (struct macro_buffer *b) |
static void | cleanup_macro_buffer (void *untyped_buf) |
static void | resize_buffer (struct macro_buffer *b, int n) |
static void | appendc (struct macro_buffer *b, int c) |
static void | appendmem (struct macro_buffer *b, char *addr, int len) |
int | macro_is_whitespace (int c) |
int | macro_is_digit (int c) |
int | macro_is_identifier_nondigit (int c) |
static void | set_token (struct macro_buffer *tok, char *start, char *end) |
static int | get_comment (struct macro_buffer *tok, char *p, char *end) |
static int | get_identifier (struct macro_buffer *tok, char *p, char *end) |
static int | get_pp_number (struct macro_buffer *tok, char *p, char *end) |
static int | get_character_constant (struct macro_buffer *tok, char *p, char *end) |
static int | get_string_literal (struct macro_buffer *tok, char *p, char *end) |
static int | get_punctuator (struct macro_buffer *tok, char *p, char *end) |
static int | get_token (struct macro_buffer *tok, struct macro_buffer *src) |
static void | append_tokens_without_splicing (struct macro_buffer *dest, struct macro_buffer *src) |
static void | stringify (struct macro_buffer *dest, const char *arg, int len) |
char * | macro_stringify (const char *str) |
static int | currently_rescanning (struct macro_name_list *list, const char *name) |
static struct macro_buffer * | gather_arguments (const char *name, struct macro_buffer *src, int nargs, int *argc_p) |
static void | scan (struct macro_buffer *dest, struct macro_buffer *src, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton) |
static int | find_parameter (const struct macro_buffer *tok, int is_varargs, const struct macro_buffer *va_arg_name, int argc, const char *const *argv) |
static void | substitute_args (struct macro_buffer *dest, struct macro_definition *def, int is_varargs, const struct macro_buffer *va_arg_name, int argc, struct macro_buffer *argv, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton) |
static int | expand (const char *id, struct macro_definition *def, struct macro_buffer *dest, struct macro_buffer *src, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton) |
static int | maybe_expand (struct macro_buffer *dest, struct macro_buffer *src_first, struct macro_buffer *src_rest, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton) |
char * | macro_expand (const char *source, macro_lookup_ftype *lookup_func, void *lookup_func_baton) |
char * | macro_expand_once (const char *source, macro_lookup_ftype *lookup_func, void *lookup_func_baton) |
char * | macro_expand_next (const char **lexptr, macro_lookup_ftype *lookup_func, void *lookup_baton) |
|
static |
Definition at line 584 of file macroexp.c.
References _, appendc(), appendmem(), gdb_assert, get_token(), init_shared_buffer(), internal_error(), macro_buffer::last_token, macro_buffer::len, and macro_buffer::text.
Referenced by scan(), and substitute_args().
|
static |
Definition at line 155 of file macroexp.c.
References macro_buffer::len, resize_buffer(), macro_buffer::size, and macro_buffer::text.
Referenced by append_tokens_without_splicing(), macro_expand(), macro_expand_next(), macro_stringify(), and stringify().
|
static |
Definition at line 169 of file macroexp.c.
References macro_buffer::len, len, resize_buffer(), macro_buffer::size, and macro_buffer::text.
Referenced by append_tokens_without_splicing(), scan(), and substitute_args().
|
static |
Definition at line 129 of file macroexp.c.
References free_buffer().
Referenced by expand(), macro_expand(), and macro_expand_next().
|
static |
Definition at line 737 of file macroexp.c.
References macro_name_list::name, and macro_name_list::next.
Referenced by maybe_expand().
|
static |
Definition at line 1178 of file macroexp.c.
References _, macro_definition::argc, macro_definition::argv, cleanup_macro_buffer(), do_cleanups(), error(), free_current_contents(), gather_arguments(), init_buffer(), init_shared_buffer(), internal_error(), macro_definition::kind, macro_buffer::len, len, macro_function_like, macro_object_like, make_cleanup(), macro_name_list::name, macro_name_list::next, null_cleanup(), macro_definition::replacement, scan(), substitute_args(), and macro_buffer::text.
Referenced by maybe_expand().
|
static |
Definition at line 923 of file macroexp.c.
References macro_buffer::is_identifier, macro_buffer::len, and macro_buffer::text.
Referenced by substitute_args().
|
static |
Definition at line 108 of file macroexp.c.
References gdb_assert, macro_buffer::shared, macro_buffer::size, macro_buffer::text, and xfree().
Referenced by cleanup_macro_buffer().
|
static |
Definition at line 119 of file macroexp.c.
References gdb_assert, macro_buffer::shared, macro_buffer::size, and macro_buffer::text.
Referenced by macro_stringify().
|
static |
Definition at line 787 of file macroexp.c.
References _, discard_cleanups(), error(), free_current_contents(), get_token(), init_shared_buffer(), macro_buffer::last_token, macro_buffer::len, make_cleanup(), set_token(), macro_buffer::text, xmalloc(), and xrealloc().
Referenced by expand().
|
static |
Definition at line 327 of file macroexp.c.
References _, c_parse_escape(), error(), gdb_assert_not_reached, and set_token().
Referenced by get_token().
|
static |
Definition at line 224 of file macroexp.c.
References _, error(), and set_token().
Referenced by get_token().
|
static |
Definition at line 266 of file macroexp.c.
References macro_buffer::is_identifier, macro_is_digit(), macro_is_identifier_nondigit(), and set_token().
Referenced by get_token().
|
static |
Definition at line 288 of file macroexp.c.
References macro_is_digit(), macro_is_identifier_nondigit(), and set_token().
Referenced by get_token().
|
static |
Definition at line 438 of file macroexp.c.
References len, and set_token().
Referenced by get_token().
|
static |
Definition at line 388 of file macroexp.c.
References _, c_parse_escape(), error(), gdb_assert_not_reached, and set_token().
Referenced by get_token().
|
static |
Definition at line 499 of file macroexp.c.
References gdb_assert, get_character_constant(), get_comment(), get_identifier(), get_pp_number(), get_punctuator(), get_string_literal(), macro_buffer::len, macro_is_whitespace(), set_token(), macro_buffer::shared, and macro_buffer::text.
Referenced by append_tokens_without_splicing(), gather_arguments(), macro_expand_next(), scan(), and substitute_args().
|
static |
Definition at line 80 of file macroexp.c.
References macro_buffer::last_token, macro_buffer::len, macro_buffer::shared, macro_buffer::size, macro_buffer::text, and xmalloc().
Referenced by expand(), macro_expand(), macro_expand_next(), and macro_stringify().
|
static |
Definition at line 96 of file macroexp.c.
References macro_buffer::last_token, macro_buffer::len, len, macro_buffer::shared, macro_buffer::size, and macro_buffer::text.
Referenced by append_tokens_without_splicing(), expand(), gather_arguments(), macro_expand(), macro_expand_next(), set_token(), and substitute_args().
char* macro_expand | ( | const char * | source, |
macro_lookup_ftype * | lookup_func, | ||
void * | lookup_func_baton | ||
) |
Definition at line 1410 of file macroexp.c.
References appendc(), cleanup_macro_buffer(), discard_cleanups(), init_buffer(), init_shared_buffer(), macro_buffer::last_token, make_cleanup(), scan(), and macro_buffer::text.
Referenced by macro_expand_command().
char* macro_expand_next | ( | const char ** | lexptr, |
macro_lookup_ftype * | lookup_func, | ||
void * | lookup_baton | ||
) |
Definition at line 1442 of file macroexp.c.
References appendc(), cleanup_macro_buffer(), discard_cleanups(), do_cleanups(), get_token(), init_buffer(), init_shared_buffer(), macro_buffer::last_token, make_cleanup(), maybe_expand(), and macro_buffer::text.
Referenced by lex_one_token().
char* macro_expand_once | ( | const char * | source, |
macro_lookup_ftype * | lookup_func, | ||
void * | lookup_func_baton | ||
) |
Definition at line 1433 of file macroexp.c.
Referenced by macro_expand_once_command().
Definition at line 197 of file macroexp.c.
Referenced by extract_identifier(), get_identifier(), and get_pp_number().
Definition at line 204 of file macroexp.c.
Referenced by extract_identifier(), get_identifier(), and get_pp_number().
Definition at line 186 of file macroexp.c.
Referenced by get_token(), skip_ws(), and stringify().
char* macro_stringify | ( | const char * | str | ) |
Definition at line 702 of file macroexp.c.
References appendc(), free_buffer_return_text(), init_buffer(), len, and stringify().
Referenced by fixup_definition().
|
static |
Definition at line 1317 of file macroexp.c.
References currently_rescanning(), do_cleanups(), expand(), gdb_assert, macro_buffer::is_identifier, macro_buffer::len, make_cleanup(), macro_buffer::shared, macro_buffer::text, xfree(), and xmalloc().
Referenced by macro_expand_next(), and scan().
|
static |
Definition at line 138 of file macroexp.c.
References gdb_assert, macro_buffer::shared, macro_buffer::size, macro_buffer::text, and xrealloc().
Referenced by appendc(), and appendmem().
|
static |
Definition at line 1367 of file macroexp.c.
References append_tokens_without_splicing(), appendmem(), gdb_assert, get_token(), macro_buffer::last_token, macro_buffer::len, maybe_expand(), macro_buffer::shared, and macro_buffer::text.
Referenced by attach_fields_to_type(), expand(), find_toplevel_char(), gnu_write_inferior(), int_to_threadref(), longlong_hexchars(), macro_expand(), remove_qualifiers(), skip_quoted_chars(), substitute_args(), and threadref_to_int().
|
static |
Definition at line 213 of file macroexp.c.
References init_shared_buffer(), macro_buffer::is_identifier, and macro_buffer::last_token.
Referenced by gather_arguments(), get_character_constant(), get_comment(), get_identifier(), get_pp_number(), get_punctuator(), get_string_literal(), and get_token().
|
static |
Definition at line 656 of file macroexp.c.
References appendc(), macro_buffer::last_token, macro_buffer::len, len, and macro_is_whitespace().
Referenced by macro_stringify(), and substitute_args().
|
static |
Definition at line 960 of file macroexp.c.
References _, append_tokens_without_splicing(), appendmem(), macro_definition::argc, macro_definition::argv, error(), find_parameter(), gdb_assert, get_token(), init_shared_buffer(), macro_buffer::last_token, macro_buffer::len, len, macro_definition::replacement, scan(), stringify(), and macro_buffer::text.
Referenced by expand().