GDB (xrefs)

Classes | Functions
/tmp/gdb-8.1/gdb/block.c File Reference
`#include "defs.h"`
`#include "block.h"`
`#include "symtab.h"`
`#include "symfile.h"`
`#include "gdb_obstack.h"`
`#include "cp-support.h"`
`#include "addrmap.h"`
`#include "gdbtypes.h"`
`#include "objfiles.h"`

Go to the source code of this file.

## Classes
struct | block_namespace_info

## Functions
static void | block_initialize_namespace (struct block *block, struct obstack *obstack)
struct objfile * | block_objfile (const struct block *block)
struct gdbarch * | block_gdbarch (const struct block *block)
int | contained_in (const struct block *a, const struct block *b)
struct symbol * | block_linkage_function (const struct block *bl)
struct symbol * | block_containing_function (const struct block *bl)
int | block_inlined_p (const struct block *bl)
static struct block * | find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
const struct blockvector * | blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section, const struct block **pblock, struct compunit_symtab *cust)
int | blockvector_contains_pc (const struct blockvector *bv, CORE_ADDR pc)
struct call_site * | call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
const struct blockvector * | blockvector_for_pc (CORE_ADDR pc, const struct block **pblock)
const struct block * | block_for_pc_sect (CORE_ADDR pc, struct obj_section *section)
const struct block * | block_for_pc (CORE_ADDR pc)
const char * | block_scope (const struct block *block)
void | block_set_scope (struct block *block, const char *scope, struct obstack *obstack)
struct using_direct * | block_using (const struct block *block)
void | block_set_using (struct block *block, struct using_direct *using_decl, struct obstack *obstack)
const struct block * | block_static_block (const struct block *block)
const struct block * | block_global_block (const struct block *block)
struct block * | allocate_block (struct obstack *obstack)
struct block * | allocate_global_block (struct obstack *obstack)
void | set_block_compunit_symtab (struct block *block, struct compunit_symtab *cu)
struct dynamic_prop * | block_static_link (const struct block *block)
static struct compunit_symtab * | get_block_compunit_symtab (const struct block *block)
static void | initialize_block_iterator (const struct block *block, struct block_iterator *iter)
static struct compunit_symtab * | find_iterator_compunit_symtab (struct block_iterator *iterator)
static struct symbol * | block_iterator_step (struct block_iterator *iterator, int first)
struct symbol * | block_iterator_first (const struct block *block, struct block_iterator *iterator)
struct symbol * | block_iterator_next (struct block_iterator *iterator)
static struct symbol * | block_iter_match_step (struct block_iterator *iterator, const lookup_name_info &name, int first)
struct symbol * | block_iter_match_first (const struct block *block, const lookup_name_info &name, struct block_iterator *iterator)
struct symbol * | block_iter_match_next (const lookup_name_info &name, struct block_iterator *iterator)
struct symbol * | block_lookup_symbol (const struct block *block, const char *name, symbol_name_match_type match_type, const domain_enum domain)
struct symbol * | block_lookup_symbol_primary (const struct block *block, const char *name, const domain_enum domain)
struct symbol * | block_find_symbol (const struct block *block, const char *name, const domain_enum domain, block_symbol_matcher_ftype *matcher, void *data)
int | block_find_non_opaque_type (struct symbol *sym, void *data)
int | block_find_non_opaque_type_preferred (struct symbol *sym, void *data)

## Function Documentation

## ◆ allocate_block()

struct block* allocate_block | ( | struct obstack * | obstack | ) |

Definition at line 400 of file block.c.

References OBSTACK_ZALLOC.

Referenced by finalize_symtab(), and finish_block_internal().

## ◆ allocate_global_block()

struct block* allocate_global_block | ( | struct obstack * | obstack | ) |

Definition at line 410 of file block.c.

References global_block::block, and OBSTACK_ZALLOC.

Referenced by finalize_symtab(), and finish_block_internal().

## ◆ block_containing_function()

struct symbol* block_containing_function | ( | const struct block * | bl | ) |

Definition at line 115 of file block.c.

References BLOCK_FUNCTION, and BLOCK_SUPERBLOCK.

Referenced by create_sals_line_offset().

## ◆ block_find_non_opaque_type()

int block_find_non_opaque_type | ( | struct symbol * | sym,
|  | void * | data
| ) |  |

Definition at line 797 of file block.c.

References SYMBOL_TYPE, and TYPE_IS_OPAQUE.

Referenced by basic_lookup_transparent_type_1(), and basic_lookup_transparent_type_quick().

## ◆ block_find_non_opaque_type_preferred()

int block_find_non_opaque_type_preferred | ( | struct symbol * | sym,
|  | void * | data
| ) |  |

Definition at line 805 of file block.c.

References SYMBOL_TYPE, and TYPE_IS_OPAQUE.

Referenced by dw2_debug_names_lookup_symbol(), dw2_lookup_symbol(), and psym_lookup_symbol().

## ◆ block_find_symbol()

struct symbol* block_find_symbol | ( | const struct block * | block,
|  | const char * | name,
|  | const domain_enum | domain,
|  | block_symbol_matcher_ftype * | matcher,
|  | void * | data
| ) |  |

Definition at line 769 of file block.c.

References ALL_BLOCK_SYMBOLS_WITH_NAME, BLOCK_SUPERBLOCK, symbol::domain, FULL, gdb_assert, name, SYMBOL_DOMAIN, SYMBOL_LANGUAGE, and symbol_matches_domain().

Referenced by basic_lookup_transparent_type_1(), basic_lookup_transparent_type_quick(), dw2_debug_names_lookup_symbol(), dw2_lookup_symbol(), and psym_lookup_symbol().

## ◆ block_for_pc()

const struct block* block_for_pc | ( | CORE_ADDR | pc | ) |

Definition at line 282 of file block.c.

References block_for_pc_sect(), and find_pc_mapped_section().

Referenced by collection_list::add_local_symbols(), agent_eval_command_one(), create_excep_cond_exprs(), do_compile_dwarf_expr_to_c(), dwarf2_compile_expr_to_ax(), dwarf2_find_location_expression(), encode_actions_1(), evaluate_subexp_standard(), find_condition_and_thread(), find_proc_desc(), frame_id_inner(), gdbpy_block_for_pc(), gdbscm_lookup_block(), gen_expr(), gen_maybe_namespace_elt(), get_frame_block(), get_pc_function_start(), info_scope_command(), init_breakpoint_sal(), inline_frame_sniffer(), locexpr_describe_location_piece(), parse_cmd_to_aexpr(), set_breakpoint_condition(), skip_inline_frames(), skip_prologue_using_sal(), update_breakpoint_locations(), and validate_actionline().

## ◆ block_for_pc_sect()

const struct block* block_for_pc_sect | ( | CORE_ADDR | pc,
|  | struct obj_section * | section
| ) |  |

Definition at line 267 of file block.c.

References blockvector_for_pc_sect().

Referenced by block_for_pc(), create_sals_line_offset(), find_pc_sect_function(), and skip_prologue_sal().

## ◆ block_gdbarch()

struct gdbarch* block_gdbarch | ( | const struct block * | block | ) |

Definition at line 60 of file block.c.

References BLOCK_FUNCTION, block_objfile(), get_objfile_arch(), and symbol_arch().

Referenced by ada_lookup_symbol_nonlocal(), basic_lookup_symbol_nonlocal(), cp_lookup_bare_symbol(), and d_lookup_symbol().

## ◆ block_global_block()

const struct block* block_global_block | ( | const struct block * | block | ) |

Definition at line 379 of file block.c.

References BLOCK_SUPERBLOCK.

Referenced by block_objfile(), blpy_get_global_block(), cp_basic_lookup_symbol(), default_collect_symbol_completion_matches_break_on(), gdbscm_block_global_block(), get_hosting_frame(), lookup_objfile_from_block(), and make_symbol_overload_list_namespace().

## ◆ block_initialize_namespace()

static void block_initialize_namespace | ( | struct block * | block,
|  | struct obstack * | obstack
| ) |  |
| static

Definition at line 350 of file block.c.

References BLOCK_NAMESPACE.

Referenced by block_set_scope(), and block_set_using().

## ◆ block_inlined_p()

int block_inlined_p | ( | const struct block * | bl | ) |

Definition at line 126 of file block.c.

References BLOCK_FUNCTION, and SYMBOL_INLINED.

Referenced by block_linkage_function(), contained_in(), default_collect_symbol_completion_matches_break_on(), find_frame_funname(), get_frame_block(), get_hosting_frame(), inline_frame_sniffer(), lookup_local_symbol(), skip_inline_frames(), skip_prologue_sal(), and skip_prologue_using_sal().

## ◆ block_iter_match_first()

struct symbol* block_iter_match_first | ( | const struct block * | block,
|  | const lookup_name_info & | name,
|  | struct block_iterator * | iterator
| ) |  |

Definition at line 639 of file block.c.

References block_iter_match_step(), block::dict, block_iterator::dict_iter, dict_iter_match_first(), FIRST_LOCAL_BLOCK, initialize_block_iterator(), name, and block_iterator::which.

Referenced by ada_add_block_symbols(), and map_block().

## ◆ block_iter_match_next()

struct symbol* block_iter_match_next | ( | const lookup_name_info & | name,
|  | struct block_iterator * | iterator
| ) |  |

Definition at line 654 of file block.c.

References block_iter_match_step(), block_iterator::dict_iter, dict_iter_match_next(), FIRST_LOCAL_BLOCK, name, and block_iterator::which.

Referenced by ada_add_block_symbols(), and map_block().

## ◆ block_iter_match_step()

static struct symbol* block_iter_match_step | ( | struct block_iterator * | iterator,
|  | const lookup_name_info & | name,
|  | int | first
| ) |  |
| static

Definition at line 597 of file block.c.

References BLOCK_DICT, BLOCKVECTOR_BLOCK, COMPUNIT_BLOCKVECTOR, block_iterator::dict_iter, dict_iter_match_first(), dict_iter_match_next(), find_iterator_compunit_symtab(), FIRST_LOCAL_BLOCK, gdb_assert, block_iterator::idx, name, and block_iterator::which.

Referenced by block_iter_match_first(), and block_iter_match_next().

## ◆ block_iterator_first()

struct symbol* block_iterator_first | ( | const struct block * | block,
|  | struct block_iterator * | iterator
| ) |  |

Definition at line 570 of file block.c.

References block_iterator_step(), block::dict, block_iterator::dict_iter, dict_iterator_first(), FIRST_LOCAL_BLOCK, initialize_block_iterator(), and block_iterator::which.

Referenced by blpy_block_syms_iternext(), gdbscm_block_next_symbol_x(), gdbscm_block_symbols(), and generate_c_for_variable_locations().

## ◆ block_iterator_next()

struct symbol* block_iterator_next | ( | struct block_iterator * | iterator | ) |

Definition at line 584 of file block.c.

References block_iterator_step(), block_iterator::dict_iter, dict_iterator_next(), FIRST_LOCAL_BLOCK, and block_iterator::which.

Referenced by blpy_block_syms_iternext(), gdbscm_block_next_symbol_x(), gdbscm_block_symbols(), and generate_c_for_variable_locations().

## ◆ block_iterator_step()

static struct symbol* block_iterator_step | ( | struct block_iterator * | iterator,
|  | int | first
| ) |  |
| static

Definition at line 531 of file block.c.

References BLOCK_DICT, BLOCKVECTOR_BLOCK, COMPUNIT_BLOCKVECTOR, block_iterator::dict_iter, dict_iterator_first(), dict_iterator_next(), find_iterator_compunit_symtab(), FIRST_LOCAL_BLOCK, gdb_assert, block_iterator::idx, and block_iterator::which.

Referenced by block_iterator_first(), and block_iterator_next().

## ◆ block_linkage_function()

struct symbol* block_linkage_function | ( | const struct block * | bl | ) |

Definition at line 100 of file block.c.

References BLOCK_FUNCTION, block_inlined_p(), and BLOCK_SUPERBLOCK.

Referenced by do_compile_dwarf_expr_to_c(), dwarf2_compile_expr_to_ax(), dwarf2_find_location_expression(), find_old_style_renaming_symbol(), find_pc_sect_function(), gen_expr(), dwarf_evaluate_loc_desc::get_frame_base(), get_pc_function_start(), locexpr_describe_location_piece(), parse_exp_in_context_1(), remove_irrelevant_renamings(), and resolve_sal_pc().

## ◆ block_lookup_symbol()

struct symbol* block_lookup_symbol | ( | const struct block * | block,
|  | const char * | name,
|  | symbol_name_match_type | match_type,
|  | const domain_enum | domain
| ) |  |

Definition at line 675 of file block.c.

References ALL_BLOCK_SYMBOLS_WITH_NAME, BLOCK_FUNCTION, symbol::domain, name, SYMBOL_DOMAIN, SYMBOL_IS_ARGUMENT, SYMBOL_LANGUAGE, and symbol_matches_domain().

Referenced by get_out_value_type(), lookup_language_this(), lookup_symbol_in_block(), lookup_symbol_via_quick_fns(), maintenance_check_psymtabs(), and spu_catch_start().

## ◆ block_lookup_symbol_primary()

struct symbol* block_lookup_symbol_primary | ( | const struct block * | block,
|  | const char * | name,
|  | const domain_enum | domain
| ) |  |

Definition at line 734 of file block.c.

References BLOCK_SUPERBLOCK, block::dict, dict_iter_match_first(), dict_iter_match_next(), FULL, gdb_assert, name, SYMBOL_DOMAIN, SYMBOL_LANGUAGE, and symbol_matches_domain().

Referenced by lookup_symbol_in_objfile_symtabs().

## ◆ block_objfile()

struct objfile* block_objfile | ( | const struct block * | block | ) |

Definition at line 46 of file block.c.

References BLOCK_FUNCTION, block_global_block(), COMPUNIT_OBJFILE, global_block::compunit_symtab, and symbol_objfile().

Referenced by block_gdbarch(), and block_static_link().

## ◆ block_scope()

const char* block_scope | ( | const struct block * | block | ) |

Definition at line 295 of file block.c.

References BLOCK_NAMESPACE, and BLOCK_SUPERBLOCK.

Referenced by cp_lookup_symbol_nonlocal(), cp_lookup_transparent_type(), d_lookup_symbol_nonlocal(), lookup_local_symbol(), rust_crate_for_block(), rust_lookup_symbol_nonlocal(), and super_name().

## ◆ block_set_scope()

void block_set_scope | ( | struct block * | block,
|  | const char * | scope,
|  | struct obstack * | obstack
| ) |  |

Definition at line 312 of file block.c.

References block_initialize_namespace(), and BLOCK_NAMESPACE.

Referenced by cp_set_block_scope(), and read_func_scope().

## ◆ block_set_using()

void block_set_using | ( | struct block * | block,
|  | struct using_direct * | using_decl,
|  | struct obstack * | obstack
| ) |  |

Definition at line 337 of file block.c.

References block_initialize_namespace(), and BLOCK_NAMESPACE.

Referenced by finish_block_internal().

## ◆ block_static_block()

const struct block* block_static_block | ( | const struct block * | block | ) |

Definition at line 364 of file block.c.

References BLOCK_SUPERBLOCK.

Referenced by ada_lookup_symbol_nonlocal(), blpy_get_static_block(), convert_symbol_sym(), default_collect_symbol_completion_matches_break_on(), gdbscm_block_static_block(), generate_c_for_variable_locations(), get_hosting_frame(), lookup_local_symbol(), lookup_symbol_in_static_block(), make_symbol_overload_list_namespace(), make_symbol_overload_list_qualified(), and munge_name_and_block().

## ◆ block_static_link()

struct dynamic_prop* block_static_link | ( | const struct block * | block | ) |

Definition at line 433 of file block.c.

References BLOCK_FUNCTION, block_objfile(), and objfile_lookup_static_link().

Referenced by get_hosting_frame().

## ◆ block_using()

struct using_direct* block_using | ( | const struct block * | block | ) |

Definition at line 324 of file block.c.

References BLOCK_NAMESPACE.

Referenced by ada_add_block_renamings(), cp_lookup_symbol_via_imports(), d_lookup_symbol_imports(), and make_symbol_overload_list_using().

## ◆ blockvector_contains_pc()

int blockvector_contains_pc | ( | const struct blockvector * | bv,
|  | CORE_ADDR | pc
| ) |  |

Definition at line 214 of file block.c.

References find_block_in_blockvector().

Referenced by recursively_find_pc_sect_compunit_symtab().

## ◆ blockvector_for_pc()

const struct blockvector* blockvector_for_pc | ( | CORE_ADDR | pc,
|  | const struct block ** | pblock
| ) |  |

Definition at line 257 of file block.c.

References blockvector_for_pc_sect(), and find_pc_mapped_section().

Referenced by block_starting_point_at().

## ◆ blockvector_for_pc_sect()

const struct blockvector* blockvector_for_pc_sect | ( | CORE_ADDR | pc,
|  | struct obj_section * | section,
|  | const struct block ** | pblock,
|  | struct compunit_symtab * | cust
| ) |  |

Definition at line 184 of file block.c.

References COMPUNIT_BLOCKVECTOR, find_block_in_blockvector(), and find_pc_sect_compunit_symtab().

Referenced by block_for_pc_sect(), blockvector_for_pc(), and resolve_sal_pc().

## ◆ call_site_for_pc()

struct call_site* call_site_for_pc | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |

Definition at line 224 of file block.c.

References _, COMPUNIT_CALL_SITE_HTAB, find_pc_compunit_symtab(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_PRINT_NAME, NO_ENTRY_VALUE_ERROR, paddress(), and throw_error().

Referenced by call_site_find_chain_1(), and dwarf_expr_reg_to_entry_parameter().

## ◆ contained_in()

int contained_in | ( | const struct block * | a,
|  | const struct block * | b
| ) |  |

Definition at line 73 of file block.c.

References BLOCK_FUNCTION, block_inlined_p(), and BLOCK_SUPERBLOCK.

Referenced by block_innermost_frame(), block_starting_point_at(), do_one_display(), frame_id_inner(), info_display_command(), resolve_subexp(), update_innermost_block(), watchpoint_check(), write_var_from_sym(), and yyparse().

## ◆ find_block_in_blockvector()

static struct block* find_block_in_blockvector | ( | const struct blockvector * | bl,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 135 of file block.c.

References addrmap_find(), BLOCK_END, BLOCK_START, BLOCKVECTOR_BLOCK, BLOCKVECTOR_MAP, BLOCKVECTOR_NBLOCKS, gdb_assert, and STATIC_BLOCK.

Referenced by blockvector_contains_pc(), and blockvector_for_pc_sect().

## ◆ find_iterator_compunit_symtab()

static struct compunit_symtab* find_iterator_compunit_symtab | ( | struct block_iterator * | iterator | ) |
| static

Definition at line 519 of file block.c.

References block_iterator::compunit_symtab, block_iterator::d, block_iterator::idx, and compunit_symtab::includes.

Referenced by block_iter_match_step(), and block_iterator_step().

## ◆ get_block_compunit_symtab()

static struct compunit_symtab* get_block_compunit_symtab | ( | const struct block * | block | ) |
| static

Definition at line 448 of file block.c.

References BLOCK_SUPERBLOCK, global_block::compunit_symtab, and gdb_assert.

Referenced by initialize_block_iterator().

## ◆ initialize_block_iterator()

static void initialize_block_iterator | ( | const struct block * | block,
|  | struct block_iterator * | iter
| ) |  |
| static

Definition at line 465 of file block.c.

References block_iterator::block, BLOCK_SUPERBLOCK, block_iterator::compunit_symtab, block_iterator::d, FIRST_LOCAL_BLOCK, get_block_compunit_symtab(), GLOBAL_BLOCK, block_iterator::idx, compunit_symtab::includes, STATIC_BLOCK, compunit_symtab::user, and block_iterator::which.

Referenced by block_iter_match_first(), and block_iterator_first().

## ◆ set_block_compunit_symtab()

void set_block_compunit_symtab | ( | struct block * | block,
|  | struct compunit_symtab * | cu
| ) |  |

Definition at line 420 of file block.c.

References BLOCK_SUPERBLOCK, global_block::compunit_symtab, and gdb_assert.

Referenced by end_symtab_with_blockvector(), and finalize_symtab().