/* DWARF 2 location expression support for GDB.
- Copyright (C) 2003-2015 Free Software Foundation, Inc.
+ Copyright (C) 2003-2017 Free Software Foundation, Inc.
This file is part of GDB.
offset in the parent objfile. */
CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);
+short dwarf2_version (struct dwarf2_per_cu_data *per_cu);
+
/* Find a particular location expression from a location list. */
const gdb_byte *dwarf2_find_location_expression
(struct dwarf2_loclist_baton *baton,
struct obstack *,
LONGEST *);
+struct type *dwarf2_fetch_die_type_sect_off (sect_offset,
+ struct dwarf2_per_cu_data *);
+
struct type *dwarf2_get_die_type (cu_offset die_offset,
struct dwarf2_per_cu_data *per_cu);
struct property_addr_info *next;
};
-/* Converts a dynamic property into a static one. ADDR_STACK is the stack
- of addresses that might be needed to evaluate the property.
+/* Converts a dynamic property into a static one. FRAME is the frame in which
+ the property is evaluated; if NULL, the selected frame (if any) is used
+ instead.
+
+ ADDR_STACK is the stack of addresses that might be needed to evaluate the
+ property. When evaluating a property that is not related to a type, it can
+ be NULL.
+
Returns 1 if PROP could be converted and the static value is passed back
into VALUE, otherwise returns 0. */
int dwarf2_evaluate_property (const struct dynamic_prop *prop,
+ struct frame_info *frame,
struct property_addr_info *addr_stack,
CORE_ADDR *value);
evaluated.
SYM the originating symbol, used for error reporting. */
-void dwarf2_compile_property_to_c (struct ui_file *stream,
+void dwarf2_compile_property_to_c (string_file &stream,
const char *result_name,
struct gdbarch *gdbarch,
unsigned char *registers_used,
extern void dwarf2_compile_expr_to_ax (struct agent_expr *expr,
struct axs_value *loc,
- struct gdbarch *arch,
unsigned int addr_size,
const gdb_byte *op_ptr,
const gdb_byte *op_end,
/* A helper function to convert a DWARF register to an arch register.
ARCH is the architecture.
DWARF_REG is the register.
- This will throw an exception if the DWARF register cannot be
- translated to an architecture register. */
+ If DWARF_REG is bad then a complaint is issued and -1 is returned.
+ Note: Some targets get this wrong. */
+
+extern int dwarf_reg_to_regnum (struct gdbarch *arch, int dwarf_reg);
+
+/* A wrapper on dwarf_reg_to_regnum to throw an exception if the
+ DWARF register cannot be translated to an architecture register.
+ This takes a ULONGEST instead of an int because some callers actually have
+ a ULONGEST. Negative values passed as ints will still be flagged as
+ invalid. */
-extern int dwarf2_reg_to_regnum_or_error (struct gdbarch *arch, int dwarf_reg);
+extern int dwarf_reg_to_regnum_or_error (struct gdbarch *arch,
+ ULONGEST dwarf_reg);
#endif /* dwarf2loc.h */