GDB (xrefs)

Classes | Functions
/tmp/gdb-8.1/gdb/findvar.c File Reference
`#include "defs.h"`
`#include "symtab.h"`
`#include "gdbtypes.h"`
`#include "frame.h"`
`#include "value.h"`
`#include "gdbcore.h"`
`#include "inferior.h"`
`#include "target.h"`
`#include "symfile.h"`
`#include "regcache.h"`
`#include "user-regs.h"`
`#include "block.h"`
`#include "objfiles.h"`
`#include "language.h"`
`#include "dwarf2loc.h"`
`#include "selftest.h"`

Go to the source code of this file.

## Classes
struct | minsym_lookup_data

## Functions
template<typename T , typename >
T | extract_integer (const gdb_byte *addr, int len, enum bfd_endian byte_order)
template LONGEST | extract_integer< LONGEST > (const gdb_byte *addr, int len, enum bfd_endian byte_order)
template ULONGEST | extract_integer< ULONGEST > (const gdb_byte *addr, int len, enum bfd_endian byte_order)
int | extract_long_unsigned_integer (const gdb_byte *addr, int orig_len, enum bfd_endian byte_order, LONGEST *pval)
CORE_ADDR | extract_typed_address (const gdb_byte *buf, struct type *type)
template<typename T , typename >
void | store_integer (gdb_byte *addr, int len, enum bfd_endian byte_order, T val)
template void | store_integer (gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
template void | store_integer (gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
void | store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
void | copy_integer_to_size (gdb_byte *dest, int dest_size, const gdb_byte *source, int source_size, bool is_signed, enum bfd_endian byte_order)
struct value * | value_of_register (int regnum, struct frame_info *frame)
struct value * | value_of_register_lazy (struct frame_info *frame, int regnum)
CORE_ADDR | unsigned_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
CORE_ADDR | signed_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
void | unsigned_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
void | address_to_signed_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
enum symbol_needs_kind | symbol_read_needs (struct symbol *sym)
int | symbol_read_needs_frame (struct symbol *sym)
static int | minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data)
static struct frame_info * | follow_static_link (struct frame_info *frame, const struct dynamic_prop *static_link)
static struct frame_info * | get_hosting_frame (struct symbol *var, const struct block *var_block, struct frame_info *frame)
struct value * | default_read_var_value (struct symbol *var, const struct block *var_block, struct frame_info *frame)
struct value * | read_var_value (struct symbol *var, const struct block *var_block, struct frame_info *frame)
struct value * | default_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id)
void | read_frame_register_value (struct value *value, struct frame_info *frame)
struct value * | value_from_register (struct type *type, int regnum, struct frame_info *frame)
CORE_ADDR | address_from_register (int regnum, struct frame_info *frame)
void | _initialize_findvar (void)

## Function Documentation

## ◆ _initialize_findvar()

void _initialize_findvar | ( | void |  | ) |

Definition at line 1094 of file findvar.c.

References selftests::register_test().

## ◆ address_from_register()

CORE_ADDR address_from_register | ( | int | regnum,
|  | struct frame_info * | frame
| ) |  |

Definition at line 952 of file findvar.c.

References _, builtin_type::builtin_data_ptr, builtin_type(), error(), error_value_optimized_out(), gdbarch_convert_register_p(), gdbarch_num_pseudo_regs(), gdbarch_num_regs(), gdbarch_register_to_value(), gdbarch_value_from_register(), get_frame_arch(), null_frame_id, read_frame_register_value(), regnum, release_value(), TYPE_LENGTH, unpack_long(), value_as_address(), value_free(), and value_optimized_out().

Referenced by read_addr_from_reg(), and dwarf_evaluate_loc_desc::read_addr_from_reg().

## ◆ address_to_signed_pointer()

void address_to_signed_pointer | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | gdb_byte * | buf,
|  | CORE_ADDR | addr
| ) |  |

Definition at line 340 of file findvar.c.

References gdbarch_byte_order(), store_signed_integer(), and TYPE_LENGTH.

Referenced by mips_gdbarch_init().

## ◆ copy_integer_to_size()

void copy_integer_to_size | ( | gdb_byte * | dest,
|  | int | dest_size,
|  | const gdb_byte * | source,
|  | int | source_size,
|  | bool | is_signed,
|  | enum bfd_endian | byte_order
| ) |  |

Definition at line 224 of file findvar.c.

References memset().

Referenced by regcache::raw_collect_integer(), and regcache::raw_supply_integer().

## ◆ default_read_var_value()

struct value* default_read_var_value | ( | struct symbol * | var,
|  | const struct block * | var_block,
|  | struct frame_info * | frame
| ) |  |

Definition at line 587 of file findvar.c.

References _, allocate_optimized_out_value(), allocate_value(), BLOCK_START, BMSYMBOL_VALUE_ADDRESS, check_typedef(), error(), gdb_assert, gdb_assert_not_reached, gdbarch_byte_order(), gdbarch_iterate_over_objfiles_in_search_order(), get_frame_arch(), get_frame_args_address(), get_frame_locals_address(), get_hosting_frame(), get_type_arch(), is_dynamic_type(), LOC_ARG, LOC_BLOCK, LOC_COMPUTED, LOC_CONST, LOC_CONST_BYTES, LOC_LABEL, LOC_LOCAL, LOC_OPTIMIZED_OUT, LOC_REF_ARG, LOC_REGISTER, LOC_REGPARM_ADDR, LOC_STATIC, LOC_TYPEDEF, LOC_UNRESOLVED, lookup_pointer_type(), memset(), bound_minimal_symbol::minsym, minsym_lookup_iterator_cb(), MSYMBOL_OBJ_SECTION, MSYMBOL_VALUE_RAW_ADDRESS, minsym_lookup_data::name, not_lval, bound_minimal_symbol::objfile, obj_section::objfile, objfile_flavour_name(), overlay_debugging, resolve_dynamic_type(), minsym_lookup_data::result, store_signed_integer(), store_typed_address(), symbol_arch(), SYMBOL_BLOCK_VALUE, SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_LINKAGE_NAME, SYMBOL_NEEDS_FRAME, SYMBOL_NEEDS_REGISTERS, SYMBOL_OBJ_SECTION, symbol_objfile(), symbol_overlayed_address(), SYMBOL_PRINT_NAME, symbol_read_needs(), SYMBOL_REGISTER_OPS, SYMBOL_TYPE, SYMBOL_VALUE, SYMBOL_VALUE_ADDRESS, SYMBOL_VALUE_BYTES, target_has_registers, target_translate_tls_address(), obj_section::the_bfd_section, TYPE_LENGTH, value_as_address(), value_at(), value_at_lazy(), value_contents_raw(), value_from_register(), and VALUE_LVAL.

Referenced by ada_read_var_value().

## ◆ default_value_from_register()

struct value* default_value_from_register | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | int | regnum,
|  | struct frame_id frame_id |
| ) |  |

Definition at line 821 of file findvar.c.

References allocate_value(), frame_find_by_id(), gdbarch_byte_order(), get_frame_id(), get_next_frame_sentinel_okay(), lval_register, null_frame_id, register_size(), regnum, set_value_offset(), TYPE_LENGTH, VALUE_LVAL, VALUE_NEXT_FRAME_ID, and VALUE_REGNUM.

Referenced by gdbarch_alloc(), s390_value_from_register(), and spu_value_from_register().

## ◆ extract_integer()

template<typename T , typename >

T extract_integer | ( | const gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order
| ) |  |

Definition at line 51 of file findvar.c.

References _, and error().

## ◆ extract_integer< LONGEST >()

template LONGEST extract_integer< LONGEST > | ( | const gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order
| ) |  |

Referenced by extract_signed_integer().

## ◆ extract_integer< ULONGEST >()

template ULONGEST extract_integer< ULONGEST > | ( | const gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order
| ) |  |

Referenced by extract_unsigned_integer().

## ◆ extract_long_unsigned_integer()

int extract_long_unsigned_integer | ( | const gdb_byte * | addr,
|  | int | orig_len,
|  | enum bfd_endian | byte_order,
|  | LONGEST * | pval
| ) |  |

Definition at line 104 of file findvar.c.

References extract_unsigned_integer().

## ◆ extract_typed_address()

CORE_ADDR extract_typed_address | ( | const gdb_byte * | buf,
|  | struct type * | type
| ) |  |

Definition at line 154 of file findvar.c.

References _, gdbarch_pointer_to_address(), get_type_arch(), internal_error(), TYPE_CODE, TYPE_CODE_PTR, and TYPE_IS_REFERENCE.

Referenced by ada_val_print_num(), amd64_get_longjmp_target(), c_val_print_ptr(), c_val_print_struct(), cp_print_value_fields(), darwin_current_sos(), darwin_load_image_infos(), darwin_read_exec_load_addr_from_dyld(), elf_gnu_ifunc_resolve_by_got(), elf_locate_base(), get_running_thread_id(), gnuv3_decode_method_ptr(), handle_stap_probe(), i386_unwind_pc(), jit_read_code_entry(), jit_read_descriptor(), ld_so_xfer_auxv(), lm_info_read(), m68k_unwind_pc(), microblaze_unwind_pc(), nios2_unwind_pc(), open_symbol_file_object(), print_ref_address(), read_known_tasks_array(), read_known_tasks_list(), read_memory_typed_address(), resolve_dynamic_type_internal(), rs6000_aix_extract_ld_info(), scan_dyntag(), tic6x_unwind_pc(), unpack_long(), and xtensa_unwind_pc().

## ◆ follow_static_link()

static struct frame_info* follow_static_link | ( | struct frame_info * | frame,
|  | const struct dynamic_prop * | static_link
| ) |  |
| static

Definition at line 433 of file findvar.c.

References dwarf2_evaluate_property(), get_frame_base(), get_frame_function(), get_prev_frame(), QUIT, and SYMBOL_BLOCK_OPS.

Referenced by get_hosting_frame().

## ◆ get_hosting_frame()

static struct frame_info* get_hosting_frame | ( | struct symbol * | var,
|  | const struct block * | var_block,
|  | struct frame_info * | frame
| ) |  |
| static

Definition at line 476 of file findvar.c.

References _, BLOCK_FUNCTION, block_global_block(), block_inlined_p(), block_innermost_frame(), block_static_block(), block_static_link(), BLOCK_SUPERBLOCK, error(), follow_static_link(), get_frame_block(), get_prev_frame(), QUIT, SYMBOL_PRINT_NAME, and symbol_read_needs_frame().

Referenced by default_read_var_value().

## ◆ minsym_lookup_iterator_cb()

static int minsym_lookup_iterator_cb | ( | struct objfile * | objfile,
|  | void * | cb_data
| ) |  |
| static

Definition at line 416 of file findvar.c.

References gdb_assert, lookup_minimal_symbol(), bound_minimal_symbol::minsym, minsym_lookup_data::name, and minsym_lookup_data::result.

Referenced by default_read_var_value().

## ◆ read_frame_register_value()

void read_frame_register_value | ( | struct value * | value,
|  | struct frame_info * | frame
| ) |  |

Definition at line 862 of file findvar.c.

References check_typedef(), gdb_assert, get_frame_arch(), get_frame_register_value(), lval_register, offset, reg_offset, register_size(), regnum, type_length_units(), value_contents_copy(), VALUE_LVAL, value_offset(), VALUE_REGNUM, and value_type().

Referenced by address_from_register(), and value_from_register().

## ◆ read_var_value()

struct value* read_var_value | ( | struct symbol * | var,
|  | const struct block * | var_block,
|  | struct frame_info * | frame
| ) |  |

Definition at line 807 of file findvar.c.

References gdb_assert, language_defn::la_read_var_value, language_def(), and SYMBOL_LANGUAGE.

Referenced by bpfinishpy_init(), convert_one_symbol(), do_compile_dwarf_expr_to_c(), enumerate_locals(), finish_command_fsm_should_stop(), frapy_read_var(), gdbscm_frame_read_var(), gdbscm_symbol_value(), insert_exception_resume_breakpoint(), print_variable_and_value(), read_frame_arg(), read_frame_local(), return_command(), sympy_value(), value_of_this(), value_of_variable(), and value_struct_elt_for_reference().

## ◆ signed_pointer_to_address()

CORE_ADDR signed_pointer_to_address | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | const gdb_byte * | buf
| ) |  |

Definition at line 320 of file findvar.c.

References extract_signed_integer(), gdbarch_byte_order(), and TYPE_LENGTH.

Referenced by mips_gdbarch_init().

## ◆ store_integer() [1/3]

template<typename T , typename >

void store_integer | ( | gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order,
|  | T | val
| ) |  |

Definition at line 168 of file findvar.c.

Referenced by regcache::cooked_write(), regcache::raw_write(), store_signed_integer(), and store_unsigned_integer().

## ◆ store_integer() [2/3]

template void store_integer | ( | gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order,
|  | LONGEST | val
| ) |  |

## ◆ store_integer() [3/3]

template void store_integer | ( | gdb_byte * | addr,
|  | int | len,
|  | enum bfd_endian | byte_order,
|  | ULONGEST | val
| ) |  |

## ◆ store_typed_address()

void store_typed_address | ( | gdb_byte * | buf,
|  | struct type * | type,
|  | CORE_ADDR | addr
| ) |  |

Definition at line 207 of file findvar.c.

References _, gdbarch_address_to_pointer(), get_type_arch(), internal_error(), TYPE_CODE, TYPE_CODE_PTR, and TYPE_IS_REFERENCE.

Referenced by default_read_var_value(), pack_long(), pack_unsigned_long(), tlb_value_read(), and value_from_pointer().

## ◆ symbol_read_needs()

enum symbol_needs_kind symbol_read_needs | ( | struct symbol * | sym | ) |

Definition at line 351 of file findvar.c.

References _, gdb_assert_not_reached, LOC_ARG, LOC_BLOCK, LOC_COMPUTED, LOC_CONST, LOC_CONST_BYTES, LOC_LABEL, LOC_LOCAL, LOC_OPTIMIZED_OUT, LOC_REF_ARG, LOC_REGISTER, LOC_REGPARM_ADDR, LOC_STATIC, LOC_TYPEDEF, LOC_UNDEF, LOC_UNRESOLVED, SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_NEEDS_FRAME, and SYMBOL_NEEDS_NONE.

Referenced by default_read_var_value(), and symbol_read_needs_frame().

## ◆ symbol_read_needs_frame()

int symbol_read_needs_frame | ( | struct symbol * | sym | ) |

Definition at line 392 of file findvar.c.

References SYMBOL_NEEDS_FRAME, and symbol_read_needs().

Referenced by convert_one_symbol(), gdbscm_symbol_needs_frame_p(), gdbscm_symbol_value(), get_hosting_frame(), sympy_needs_frame(), sympy_value(), update_innermost_block(), value_of_variable(), write_var_from_sym(), and yyparse().

## ◆ unsigned_address_to_pointer()

void unsigned_address_to_pointer | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | gdb_byte * | buf,
|  | CORE_ADDR | addr
| ) |  |

Definition at line 331 of file findvar.c.

References gdbarch_byte_order(), store_unsigned_integer(), and TYPE_LENGTH.

Referenced by gdbarch_alloc().

## ◆ unsigned_pointer_to_address()

CORE_ADDR unsigned_pointer_to_address | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | const gdb_byte * | buf
| ) |  |

Definition at line 311 of file findvar.c.

References extract_unsigned_integer(), gdbarch_byte_order(), and TYPE_LENGTH.

Referenced by gdbarch_alloc().

## ◆ value_from_register()

struct value* value_from_register | ( | struct type * | type,
|  | int | regnum,
|  | struct frame_info * | frame
| ) |  |

Definition at line 902 of file findvar.c.

References allocate_value(), check_typedef(), gdbarch_convert_register_p(), gdbarch_register_to_value(), gdbarch_value_from_register(), get_frame_arch(), get_frame_id(), get_next_frame_sentinel_okay(), lval_register, mark_value_bytes_optimized_out(), mark_value_bytes_unavailable(), read_frame_register_value(), regnum, TYPE_LENGTH, value_contents_raw(), VALUE_LVAL, VALUE_NEXT_FRAME_ID, and VALUE_REGNUM.

Referenced by default_read_var_value(), dwarf2_evaluate_loc_desc_full(), dwarf_expr_executor::get_reg_value(), dwarf_evaluate_loc_desc::get_reg_value(), set_gdbarch_value_from_register(), and store_regs().

## ◆ value_of_register()

struct value* value_of_register | ( | int | regnum,
|  | struct frame_info * | frame
| ) |  |

Definition at line 263 of file findvar.c.

References gdbarch_num_pseudo_regs(), gdbarch_num_regs(), get_frame_arch(), regnum, value_fetch_lazy(), value_of_register_lazy(), and value_of_user_reg().

Referenced by default_print_registers_info(), evaluate_subexp_standard(), frapy_read_register(), gdbscm_frame_read_register(), output_register(), pending_framepy_read_register(), value_of_aarch64_user_reg(), value_of_arm_user_reg(), value_of_builtin_frame_fp_reg(), value_of_builtin_frame_pc_reg(), value_of_builtin_frame_ps_reg(), value_of_builtin_frame_sp_reg(), value_of_mips_user_reg(), and value_of_nds32_reg().

## ◆ value_of_register_lazy()

struct value* value_of_register_lazy | ( | struct frame_info * | frame,
|  | int | regnum
| ) |  |

Definition at line 284 of file findvar.c.

References allocate_value_lazy(), frame_id_p(), gdb_assert, gdbarch_num_pseudo_regs(), gdbarch_num_regs(), get_frame_arch(), get_frame_id(), get_next_frame_sentinel_okay(), lval_register, register_type(), regnum, VALUE_LVAL, VALUE_NEXT_FRAME_ID, and VALUE_REGNUM.

Referenced by frame_unwind_got_register(), and value_of_register().