gdb: introduce symtab_create_debug_printf
[binutils-gdb.git] / gdb / dwarf2 / loc.h
index 33a5e8adc109309b3fe45d54ad9d73ad68404a0d..a9834d32066bb5ca5613bd0faf2652fe50ba2983 100644 (file)
@@ -1,6 +1,6 @@
 /* DWARF 2 location expression support for GDB.
 
-   Copyright (C) 2003-2021 Free Software Foundation, Inc.
+   Copyright (C) 2003-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -72,14 +72,16 @@ struct call_site_parameter *dwarf_expr_reg_to_entry_parameter
 
 /* Evaluate a location description, starting at DATA and with length
    SIZE, to find the current location of variable of TYPE in the context
-   of FRAME.  */
+   of FRAME.  AS_LVAL defines if the resulting struct value is expected to
+   be a value or a location description.  */
 
 struct value *dwarf2_evaluate_loc_desc (struct type *type,
                                        struct frame_info *frame,
                                        const gdb_byte *data,
                                        size_t size,
                                        dwarf2_per_cu_data *per_cu,
-                                       dwarf2_per_objfile *per_objfile);
+                                       dwarf2_per_objfile *per_objfile,
+                                       bool as_lval = true);
 
 /* A chain of addresses that might be needed to resolve a dynamic
    property.  */
@@ -112,14 +114,16 @@ struct property_addr_info
    Returns true if PROP could be converted and the static value is passed
    back into VALUE, otherwise returns false.
 
-   If PUSH_INITIAL_VALUE is true, then the top value of ADDR_STACK
-   will be pushed before evaluating a location expression.  */
+   Any values in PUSH_VALUES will be pushed before evaluating the location
+   expression, PUSH_VALUES[0] will be pushed first, then PUSH_VALUES[1],
+   etc.  This means the during evaluation PUSH_VALUES[0] will be at the
+   bottom of the stack.  */
 
 bool dwarf2_evaluate_property (const struct dynamic_prop *prop,
                               struct frame_info *frame,
                               const struct property_addr_info *addr_stack,
                               CORE_ADDR *value,
-                              bool push_initial_value = false);
+                              gdb::array_view<CORE_ADDR> push_values = {});
 
 /* A helper for the compiler interface that compiles a single dynamic
    property to C code.
@@ -280,6 +284,11 @@ extern int dwarf_reg_to_regnum (struct gdbarch *arch, int dwarf_reg);
 extern int dwarf_reg_to_regnum_or_error (struct gdbarch *arch,
                                         ULONGEST dwarf_reg);
 
+/* Helper function which throws an error if a synthetic pointer is
+   invalid.  */
+
+extern void invalid_synthetic_pointer ();
+
 /* Fetch the value pointed to by a synthetic pointer.  */
 
 extern struct value *indirect_synthetic_pointer
@@ -287,4 +296,4 @@ extern struct value *indirect_synthetic_pointer
    dwarf2_per_objfile *per_objfile, struct frame_info *frame,
    struct type *type, bool resolve_abstract_p = false);
 
-#endif /* dwarf2loc.h */
+#endif /* DWARF2LOC_H */