diff options
Diffstat (limited to 'gdb/dwarf2/frame.h')
-rw-r--r-- | gdb/dwarf2/frame.h | 80 |
1 files changed, 67 insertions, 13 deletions
diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h index 2167310..9357cc1 100644 --- a/gdb/dwarf2/frame.h +++ b/gdb/dwarf2/frame.h @@ -1,6 +1,6 @@ /* Frame unwinder for frames with DWARF Call Frame Information. - Copyright (C) 2003-2024 Free Software Foundation, Inc. + Copyright (C) 2003-2025 Free Software Foundation, Inc. Contributed by Mark Kettenis. @@ -19,12 +19,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef DWARF2_FRAME_H -#define DWARF2_FRAME_H 1 +#ifndef GDB_DWARF2_FRAME_H +#define GDB_DWARF2_FRAME_H struct gdbarch; class frame_info_ptr; -struct dwarf2_per_cu_data; +struct dwarf2_per_cu; struct agent_expr; struct axs_value; @@ -198,11 +198,14 @@ struct dwarf2_frame_state bool armcc_cfa_offsets_reversed = false; }; -/* When this is true the DWARF frame unwinders can be used if they are - registered with the gdbarch. Not all architectures can or do use the - DWARF unwinders. Setting this to true on a target that does not - otherwise support the DWARF unwinders has no effect. */ -extern bool dwarf2_frame_unwinders_enabled_p; +/* If DWARF supoprt was requested, create the real prototype for the + append_unwinders function. Otherwise, create a fake inline function. + + There is no need to emit a warning for some of these, because they aren't + actively reading DWARF when this is called, they're just initializing GDB. + + These should probably be moved to dwarf2/public.h. */ +#if defined(DWARF_FORMAT_AVAILABLE) /* Set the architecture-specific register state initialization function for GDBARCH to INIT_REG. */ @@ -257,13 +260,12 @@ CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame); in other cases. These are only used when 0 is returned. */ extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, - struct dwarf2_per_cu_data *data, - int *regnum_out, LONGEST *offset_out, + dwarf2_per_cu *data, int *regnum_out, + LONGEST *offset_out, CORE_ADDR *text_offset_out, const gdb_byte **cfa_start_out, const gdb_byte **cfa_end_out); - /* Allocate a new instance of the function unique data. The main purpose of this custom function data object is to allow caching the @@ -294,4 +296,56 @@ extern void *dwarf2_frame_get_fn_data (const frame_info_ptr &this_frame, void **this_cache, fn_prev_register cookie); -#endif /* dwarf2-frame.h */ +#else /* DWARF_FORMAT_AVAILABLE */ + +static inline void dwarf2_append_unwinders (struct gdbarch *gdbarch) { } + +static inline void dwarf2_frame_set_init_reg ( + gdbarch *gdbarch, void (*init_reg) (struct gdbarch *,int, + dwarf2_frame_state_reg *, + const frame_info_ptr &)) { } + +static inline const struct frame_base * + dwarf2_frame_base_sniffer (const frame_info_ptr &this_frame) +{ + warning (_("No dwarf support available.")); + return nullptr; +} + +static inline void dwarf2_frame_set_signal_frame_p + (gdbarch *gdbarch, int (*signal_frame_p) (struct gdbarch *, + const frame_info_ptr &)) { } + +static inline void *dwarf2_frame_get_fn_data (const frame_info_ptr &this_frame, + void **this_cache, + fn_prev_register cookie) +{ + return nullptr; +} + +static inline void *dwarf2_frame_allocate_fn_data + (const frame_info_ptr &this_frame, void **this_cache, + fn_prev_register cookie, unsigned long size) +{ + return nullptr; +} + +static inline int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, + struct dwarf2_per_cu_data *data, + int *regnum_out, LONGEST *offset_out, + CORE_ADDR *text_offset_out, + const gdb_byte **cfa_start_out, + const gdb_byte **cfa_end_out) +{ + return 0; +} + +static inline void + dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch, + int (*adjust_regnum) (struct gdbarch *, + int, int)) +{} + +#endif /* DWARF_FORMAT_AVAILABLE */ + +#endif /* GDB_DWARF2_FRAME_H */ |