GDB (xrefs)
|
#include "defs.h"
#include "gdbsupport/gdb_obstack.h"
#include "macrotab.h"
#include "macroexp.h"
#include "macroscope.h"
#include "c-lang.h"
Go to the source code of this file.
Classes | |
struct | shared_macro_buffer |
struct | growable_macro_buffer |
struct | macro_name_list |
Functions | |
int | macro_is_whitespace (int c) |
int | macro_is_digit (int c) |
int | macro_is_identifier_nondigit (int c) |
static void | set_token (shared_macro_buffer *tok, const char *start, const char *end) |
static int | get_comment (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_identifier (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_pp_number (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_character_constant (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_string_literal (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_punctuator (shared_macro_buffer *tok, const char *p, const char *end) |
static int | get_token (shared_macro_buffer *tok, shared_macro_buffer *src) |
static void | append_tokens_without_splicing (growable_macro_buffer *dest, shared_macro_buffer *src) |
static void | stringify (growable_macro_buffer *dest, const char *arg, int len) |
gdb::unique_xmalloc_ptr< char > | macro_stringify (const char *str) |
static int | currently_rescanning (struct macro_name_list *list, const char *name) |
static bool | gather_arguments (const char *name, shared_macro_buffer *src, int nargs, std::vector< shared_macro_buffer > *args_ptr) |
static void | scan (growable_macro_buffer *dest, shared_macro_buffer *src, struct macro_name_list *no_loop, const macro_scope &scope) |
static int | find_parameter (const shared_macro_buffer *tok, int is_varargs, const shared_macro_buffer *va_arg_name, int argc, const char *const *argv) |
static void | get_next_token_for_substitution (shared_macro_buffer *replacement_list, shared_macro_buffer *token, const char **start, shared_macro_buffer *lookahead, const char **lookahead_start, int *lookahead_valid, bool *keep_going) |
static void | substitute_args (growable_macro_buffer *dest, struct macro_definition *def, int is_varargs, const shared_macro_buffer *va_arg_name, const std::vector< shared_macro_buffer > &argv, struct macro_name_list *no_loop, const macro_scope &scope) |
static int | expand (const char *id, struct macro_definition *def, growable_macro_buffer *dest, shared_macro_buffer *src, struct macro_name_list *no_loop, const macro_scope &scope) |
static int | maybe_expand (growable_macro_buffer *dest, shared_macro_buffer *src_first, shared_macro_buffer *src_rest, struct macro_name_list *no_loop, const macro_scope &scope) |
gdb::unique_xmalloc_ptr< char > | macro_expand (const char *source, const macro_scope &scope) |
gdb::unique_xmalloc_ptr< char > | macro_expand_once (const char *source, const macro_scope &scope) |
gdb::unique_xmalloc_ptr< char > | macro_expand_next (const char **lexptr, const macro_scope &scope) |
|
static |
Definition at line 573 of file macroexp.c.
References growable_macro_buffer::appendc(), growable_macro_buffer::appendmem(), get_token(), shared_macro_buffer::last_token, growable_macro_buffer::last_token, shared_macro_buffer::len, growable_macro_buffer::len, shared_macro_buffer::set_shared(), shared_macro_buffer::text, and growable_macro_buffer::text.
Referenced by scan(), and substitute_args().
|
static |
Definition at line 722 of file macroexp.c.
References name, macro_name_list::name, and macro_name_list::next.
Referenced by maybe_expand().
|
static |
Definition at line 1205 of file macroexp.c.
References macro_definition::argc, macro_definition::argv, gather_arguments(), macro_definition::kind, growable_macro_buffer::len, macro_function_like, macro_object_like, macro_name_list::name, macro_name_list::next, macro_definition::replacement, scan(), shared_macro_buffer::set_shared(), substitute_args(), and growable_macro_buffer::text.
Referenced by maybe_expand().
|
static |
Definition at line 880 of file macroexp.c.
References shared_macro_buffer::is_identifier, shared_macro_buffer::len, and shared_macro_buffer::text.
Referenced by substitute_args().
|
static |
Definition at line 769 of file macroexp.c.
References get_token(), shared_macro_buffer::last_token, shared_macro_buffer::len, name, set_token(), and shared_macro_buffer::text.
Referenced by expand().
|
static |
Definition at line 317 of file macroexp.c.
References c_parse_escape(), and set_token().
Referenced by get_token().
|
static |
|
static |
Definition at line 256 of file macroexp.c.
References shared_macro_buffer::is_identifier, macro_is_digit(), macro_is_identifier_nondigit(), and set_token().
Referenced by get_token().
|
static |
Definition at line 905 of file macroexp.c.
References get_token(), keep_going(), shared_macro_buffer::text, and token.
Referenced by substitute_args().
|
static |
Definition at line 278 of file macroexp.c.
References macro_is_digit(), macro_is_identifier_nondigit(), and set_token().
Referenced by get_token().
|
static |
|
static |
Definition at line 379 of file macroexp.c.
References c_parse_escape(), and set_token().
Referenced by get_token().
|
static |
Definition at line 491 of file macroexp.c.
References get_character_constant(), get_comment(), get_identifier(), get_pp_number(), get_punctuator(), get_string_literal(), shared_macro_buffer::len, macro_is_whitespace(), set_token(), and shared_macro_buffer::text.
Referenced by append_tokens_without_splicing(), gather_arguments(), get_next_token_for_substitution(), macro_expand_next(), scan(), and substitute_args().
gdb::unique_xmalloc_ptr< char > macro_expand | ( | const char * | source, |
const macro_scope & | scope ) |
Definition at line 1398 of file macroexp.c.
References growable_macro_buffer::appendc(), growable_macro_buffer::last_token, growable_macro_buffer::release(), and scan().
Referenced by macro_expand_command().
gdb::unique_xmalloc_ptr< char > macro_expand_next | ( | const char ** | lexptr, |
const macro_scope & | scope ) |
Definition at line 1420 of file macroexp.c.
References growable_macro_buffer::appendc(), get_token(), growable_macro_buffer::last_token, maybe_expand(), growable_macro_buffer::release(), and shared_macro_buffer::text.
Referenced by lex_one_token().
gdb::unique_xmalloc_ptr< char > macro_expand_once | ( | const char * | source, |
const macro_scope & | scope ) |
Definition at line 1414 of file macroexp.c.
Referenced by macro_expand_once_command().
int macro_is_digit | ( | int | c | ) |
Definition at line 187 of file macroexp.c.
Referenced by extract_identifier(), get_identifier(), and get_pp_number().
int macro_is_identifier_nondigit | ( | int | c | ) |
Definition at line 194 of file macroexp.c.
Referenced by extract_identifier(), get_identifier(), and get_pp_number().
int macro_is_whitespace | ( | int | c | ) |
Definition at line 176 of file macroexp.c.
Referenced by get_token(), skip_ws(), and stringify().
gdb::unique_xmalloc_ptr< char > macro_stringify | ( | const char * | str | ) |
Definition at line 688 of file macroexp.c.
References growable_macro_buffer::appendc(), growable_macro_buffer::release(), and stringify().
Referenced by fixup_definition().
|
static |
Definition at line 1324 of file macroexp.c.
References currently_rescanning(), expand(), shared_macro_buffer::is_identifier, shared_macro_buffer::len, standard_macro_lookup(), and shared_macro_buffer::text.
Referenced by macro_expand_next(), and scan().
|
static |
Definition at line 1358 of file macroexp.c.
References append_tokens_without_splicing(), growable_macro_buffer::appendmem(), get_token(), growable_macro_buffer::last_token, shared_macro_buffer::len, growable_macro_buffer::len, maybe_expand(), and shared_macro_buffer::text.
Referenced by attach_fields_to_type(), expand(), find_end_quote(), find_toplevel_char(), gdb_rl_find_completion_word(), gnu_write_inferior(), int_to_threadref(), macro_expand(), remove_qualifiers(), skip_quoted_chars(), substitute_args(), and threadref_to_int().
|
static |
Definition at line 203 of file macroexp.c.
References shared_macro_buffer::is_identifier, shared_macro_buffer::last_token, and shared_macro_buffer::set_shared().
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 642 of file macroexp.c.
References growable_macro_buffer::appendc(), growable_macro_buffer::last_token, growable_macro_buffer::len, and macro_is_whitespace().
Referenced by macro_stringify(), and substitute_args().
|
static |
Definition at line 941 of file macroexp.c.
References append_tokens_without_splicing(), growable_macro_buffer::appendmem(), macro_definition::argc, macro_definition::argv, find_parameter(), get_next_token_for_substitution(), get_token(), keep_going(), growable_macro_buffer::last_token, shared_macro_buffer::len, growable_macro_buffer::len, macro_definition::replacement, scan(), stringify(), and shared_macro_buffer::text.
Referenced by expand().