disasm.c \
displaced-stepping.c \
dummy-frame.c \
- dwarf2/abbrev.c \
- dwarf2/abbrev-table-cache.c \
- dwarf2/ada-imported.c \
- dwarf2/aranges.c \
- dwarf2/attribute.c \
- dwarf2/cooked-index.c \
- dwarf2/cooked-index-entry.c \
- dwarf2/cooked-index-shard.c \
- dwarf2/cooked-index-worker.c \
- dwarf2/cooked-indexer.c \
- dwarf2/cu.c \
- dwarf2/die.c \
- dwarf2/dwz.c \
- dwarf2/expr.c \
- dwarf2/frame-tailcall.c \
- dwarf2/frame.c \
- dwarf2/index-cache.c \
- dwarf2/index-common.c \
- dwarf2/index-write.c \
- dwarf2/leb.c \
- dwarf2/line-header.c \
- dwarf2/loc.c \
- dwarf2/macro.c \
- dwarf2/parent-map.c \
- dwarf2/read.c \
- dwarf2/read-debug-names.c \
- dwarf2/read-gdb-index.c \
- dwarf2/section.c \
- dwarf2/stringify.c \
- dwarf2/unit-head.c \
extract-store-integer.c \
eval.c \
event-top.c \
$(CONFIG_SRCS)
TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
+# Files that are used to support certain debuginfo formats
+DWARF2_SRCS = \
+ dwarf2/abbrev.c \
+ dwarf2/abbrev-table-cache.c \
+ dwarf2/ada-imported.c \
+ dwarf2/aranges.c \
+ dwarf2/attribute.c \
+ dwarf2/cooked-index.c \
+ dwarf2/cooked-index-entry.c \
+ dwarf2/cooked-index-shard.c \
+ dwarf2/cooked-index-worker.c \
+ dwarf2/cooked-indexer.c \
+ dwarf2/cu.c \
+ dwarf2/die.c \
+ dwarf2/dwz.c \
+ dwarf2/expr.c \
+ dwarf2/frame-tailcall.c \
+ dwarf2/frame.c \
+ dwarf2/index-cache.c \
+ dwarf2/index-common.c \
+ dwarf2/index-write.c \
+ dwarf2/leb.c \
+ dwarf2/line-header.c \
+ dwarf2/loc.c \
+ dwarf2/macro.c \
+ dwarf2/parent-map.c \
+ dwarf2/read.c \
+ dwarf2/read-debug-names.c \
+ dwarf2/read-gdb-index.c \
+ dwarf2/section.c \
+ dwarf2/stringify.c \
+ dwarf2/unit-head.c
+DWARF2_OBS = $(patsubst %.c,%.o, $(DWARF2_SRCS))
+
COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
mi/mi-common.o \
version.o \
subsystem to be disabled at configure time, in the form of
--disable-gdb-compile.
+* A new configure option was added, allowing support for DWARF debug
+ information to be disabled at configure time. The flag is
+ --disable-gdb-dwarf-support.
+
* A new configure option was added, allowing support for mdebug/ecoff
debug information to be disabled at configure time. The flag to do
that is --disable-gdb-mdebug-support.
supported).
`--disable-gdb-compile'
- Build GDB without support for the 'compile' command.
+ Build GDB without support for the 'compile' command. DWARF support
+ is required for this feature.
+
+`--disable-gdb-dwarf-support'
+ Build GDB without support for reading DWARF debug information.
`--disable-gdb-mdebug-support'
Build GDB without support for reading mdebug debug information.
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
+/* defined if dwarf format was requested. */
+#undef DWARF_FORMAT_AVAILABLE
+
/* Handle .ctf type-info sections */
#undef ENABLE_LIBCTF
with_auto_load_safe_path
enable_targets
enable_gdb_mdebug_support
+enable_gdb_dwarf_support
with_amd_dbgapi
enable_tui
enable_gdbtk
--enable-gdb-mdebug-support
Enable support for the mdebug debuginfo format
(default 'yes')
+ --enable-gdb-dwarf-support
+ Enable support for the dwarf debuginfo format
+ (default 'yes')
--enable-tui enable full-screen terminal user interface (TUI)
--enable-gdbtk enable gdbtk graphical user interface (GUI)
--enable-profiling enable profiling of GDB
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11506 "configure"
+#line 11510 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11612 "configure"
+#line 11616 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
fi
+# Check whether to support dwarf debug information
+# Check whether --enable-gdb-dwarf-support was given.
+if test "${enable_gdb_dwarf_support+set}" = set; then :
+ enableval=$enable_gdb_dwarf_support;
+ case $enableval in
+ yes | no)
+ ;;
+ *)
+ as_fn_error $? "bad value $enableval for --enable-gdb-dwarf-support" "$LINENO" 5
+ ;;
+ esac
+
+else
+ enable_gdb_dwarf_support=yes
+fi
+
+
+if test "x${enable_gdb_dwarf_support}" != "xno"; then
+
+$as_echo "#define DWARF_FORMAT_AVAILABLE 1" >>confdefs.h
+
+ CONFIG_SRCS="$CONFIG_SRCS \$(DWARF2_SRCS)"
+ CONFIG_OBS="$CONFIG_OBS \$(DWARF2_OBS)"
+fi
+
# See whether 64-bit bfd lib has been enabled.
OLD_CPPFLAGS=$CPPFLAGS
# Put the old CPPFLAGS last, in case the user's CPPFLAGS point somewhere
esac
else
- enable_gdb_compile=yes
+ enable_gdb_compile=default
fi
-if test "${enable_gdb_compile}" = yes; then
-
-$as_echo "#define HAVE_COMPILE 1" >>confdefs.h
-
- CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GCC_COMPILE_OBS)"
-else
+case ${enable_gdb_compile}-${enable_gdb_dwarf_support} in
+ yes-no)
+ as_fn_error $? "enabling gdb compile requires dwarf support" "$LINENO" 5
+ ;;
+ default-no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Defaulting compile support to 'no'" >&5
+$as_echo "$as_me: WARNING: Defaulting compile support to 'no'" >&2;}
+ # Fallthrough.
+ ;&
+ no-*)
# Even if compile support is not enabled, we need this file to define
# the "compile" command.
CONFIG_OBS="$CONFIG_OBS compile/compile.o"
CONFIG_SRCS="$CONFIG_SRCS compile/compile.c"
-fi
+ ;;
+ default-yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Defaulting compile support to 'yes'" >&5
+$as_echo "$as_me: WARNING: Defaulting compile support to 'yes'" >&2;}
+ # Fallthrough.
+ ;&
+ yes-*)
+
+$as_echo "#define HAVE_COMPILE 1" >>confdefs.h
+
+ CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GCC_COMPILE_OBS)"
+ ;;
+esac
# ---------------------------- #
# Check for source highlight. #
[defined if mdebug format was requested.])
fi
+# Check whether to support dwarf debug information
+AC_ARG_ENABLE(gdb-dwarf-support,
+AS_HELP_STRING([--enable-gdb-dwarf-support],
+ [Enable support for the dwarf debuginfo format (default 'yes')]),
+[GDB_CHECK_YES_NO_VAL([$enableval], [--enable-gdb-dwarf-support])],
+[enable_gdb_dwarf_support=yes])
+
+if test "x${enable_gdb_dwarf_support}" != "xno"; then
+ AC_DEFINE(DWARF_FORMAT_AVAILABLE, 1,
+ [defined if dwarf format was requested.])
+ CONFIG_SRCS="$CONFIG_SRCS \$(DWARF2_SRCS)"
+ CONFIG_OBS="$CONFIG_OBS \$(DWARF2_OBS)"
+fi
+
BFD_64_BIT
# Provide defaults for some variables set by the per-host and per-target
AS_HELP_STRING([--enable-gdb-compile],
[enable support for the compile subsystem, default 'yes']),
[GDB_CHECK_YES_NO_VAL([$enableval], [--enable-gdb-compile])],
- [enable_gdb_compile=yes])
+ [enable_gdb_compile=default])
-if test "${enable_gdb_compile}" = yes; then
- AC_DEFINE(HAVE_COMPILE, 1, [Define if compiling support to gdb compile.])
- CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GCC_COMPILE_OBS)"
-else
+case ${enable_gdb_compile}-${enable_gdb_dwarf_support} in
+ yes-no)
+ AC_MSG_ERROR([enabling gdb compile requires dwarf support])
+ ;;
+ default-no)
+ AC_MSG_WARN([Defaulting compile support to 'no'])
+ # Fallthrough.
+ ;&
+ no-*)
# Even if compile support is not enabled, we need this file to define
# the "compile" command.
CONFIG_OBS="$CONFIG_OBS compile/compile.o"
CONFIG_SRCS="$CONFIG_SRCS compile/compile.c"
-fi
+ ;;
+ default-yes)
+ AC_MSG_WARN([Defaulting compile support to 'yes'])
+ # Fallthrough.
+ ;&
+ yes-*)
+ AC_DEFINE(HAVE_COMPILE, 1, [Define if compiling support to gdb compile.])
+ CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GCC_COMPILE_OBS)"
+ ;;
+esac
# ---------------------------- #
# Check for source highlight. #
bool armcc_cfa_offsets_reversed = false;
};
+/* 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. */
void **this_cache,
fn_prev_register cookie);
+#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 */
const property_addr_info *next;
};
-/* 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 true if PROP could be converted and the static value is passed
- back into VALUE, otherwise returns false.
-
- 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,
- const frame_info_ptr &frame,
- const property_addr_info *addr_stack,
- CORE_ADDR *value,
- gdb::array_view<CORE_ADDR> push_values = {});
-
/* A helper for the compiler interface that compiles a single dynamic
property to C code.
Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if
it cannot resolve the parameter for any reason. */
+#if defined(DWARF_FORMAT_AVAILABLE)
+
+/* 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 true if PROP could be converted and the static value is passed
+ back into VALUE, otherwise returns false.
+
+ 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,
+ const frame_info_ptr &frame,
+ const property_addr_info *addr_stack,
+ CORE_ADDR *value,
+ gdb::array_view<CORE_ADDR> push_values = {});
+
extern struct value *value_of_dwarf_reg_entry (struct type *type,
const frame_info_ptr &frame,
enum call_site_parameter_kind kind,
union call_site_parameter_u kind_u);
+
+#else /* DWARF_FORMAT_AVAILABLE */
+
+static inline bool
+dwarf2_evaluate_property (const struct dynamic_prop *, const frame_info_ptr &,
+ const property_addr_info *, CORE_ADDR *,
+ gdb::array_view<CORE_ADDR> = {})
+{
+ return false;
+}
+
+static inline struct value *
+value_of_dwarf_reg_entry (struct type *type, const frame_info_ptr &frame,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u)
+{
+ error (_("No dwarf support available."));
+}
+
+#endif /* DWARF_FORMAT_AVAILABLE */
+
#endif /* GDB_DWARF2_LOC_H */
DEBUG_NAMES,
};
+#if defined(DWARF_FORMAT_AVAILABLE)
+
/* Try to locate the sections we need for DWARF 2 debugging
information. If these are found, begin reading the DWARF and
return true. Otherwise, return false. NAMES points to the dwarf2
extern void dwarf2_build_frame_info (struct objfile *);
+/* Append the DWARF-2 frame unwinders to GDBARCH's list. */
+
+void dwarf2_append_unwinders (struct gdbarch *gdbarch);
+
+#else /* DWARF_FORMAT_AVAILABLE */
+
+static inline bool
+dwarf2_initialize_objfile (struct objfile *,
+ const struct dwarf2_debug_sections * = nullptr,
+ bool = false)
+{
+ warning (_("No dwarf support available."));
+ return false;
+}
+
+static inline void
+dwarf2_build_frame_info (struct objfile *)
+{
+ warning (_("No dwarf support available."));
+}
+
+#endif /* DWARF_FORMAT_AVAILABLE */
+
#endif /* GDB_DWARF2_PUBLIC_H */
standard_unwinders =
{
&dummy_frame_unwind,
+#if defined(DWARF_FORMAT_AVAILABLE)
/* The DWARF tailcall sniffer must come before the inline sniffer.
Otherwise, we can end up in a situation where a DWARF frame finds
tailcall information, but then the inline sniffer claims a frame
activated if the newer frame was created using the DWARF
unwinder, and it also found tailcall information. */
&dwarf2_tailcall_frame_unwind,
+#endif
&inline_frame_unwind,
};
return builtin_type (objfile->arch ());
}
-/* See gdbtypes.h. */
+/* See dwarf2/call-site.h. */
CORE_ADDR
call_site::pc () const
{
+ /* dwarf2_per_objfile is defined in dwarf/read.c, so if that is disabled
+ at configure time, we won't be able to use this relocate function.
+ This is dwarf-specific, and would ideally be in call-site.h, but
+ including dwarf2/read.h in dwarf2/call-site.h will lead to things being
+ included in the wrong order and many compilation errors will happen.
+ This is the next best thing. */
+#if defined(DWARF_FORMAT_AVAILABLE)
return per_objfile->relocate (m_unrelocated_pc);
+#else
+ gdb_assert_not_reached ("unexpected call_site object found");
+#endif
}
void _initialize_gdbtypes ();