+2021-06-29 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * frame-unwind.h (struct frame_unwind) <name>: New. Update
+ instances everywhere to include this field.
+ * frame-unwind.c (frame_unwind_try_unwinder,
+ frame_unwind_find_by_frame): Add debug messages.
+
2021-06-29 Simon Marchi <simon.marchi@polymtl.ca>
* frame.h (frame_debug_printf): New.
/* AArch64 prologue unwinder. */
static frame_unwind aarch64_prologue_unwind =
{
+ "aarch64 prologue",
NORMAL_FRAME,
aarch64_prologue_frame_unwind_stop_reason,
aarch64_prologue_this_id,
/* AArch64 stub unwinder. */
static frame_unwind aarch64_stub_unwind =
{
+ "aarch64 stub",
NORMAL_FRAME,
aarch64_stub_frame_unwind_stop_reason,
aarch64_stub_this_id,
return 1;
}
-static const struct frame_unwind alpha_mdebug_frame_unwind = {
+static const struct frame_unwind alpha_mdebug_frame_unwind =
+{
+ "alpha mdebug",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
alpha_mdebug_frame_this_id,
return 0;
}
-static const struct frame_unwind alpha_sigtramp_frame_unwind = {
+static const struct frame_unwind alpha_sigtramp_frame_unwind =
+{
+ "alpha sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
alpha_sigtramp_frame_this_id,
return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
}
-static const struct frame_unwind alpha_heuristic_frame_unwind = {
+static const struct frame_unwind alpha_heuristic_frame_unwind =
+{
+ "alpha prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
alpha_heuristic_frame_this_id,
|| (startswith (name, "Xintr"))));
}
-static const struct frame_unwind amd64obsd_trapframe_unwind = {
+static const struct frame_unwind amd64obsd_trapframe_unwind =
+{
/* FIXME: kettenis/20051219: This really is more like an interrupt
frame, but SIGTRAMP_FRAME would print <signal handler called>,
which really is not what we want here. */
+ "amd64 openbsd trap",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
amd64obsd_trapframe_this_id,
static const struct frame_unwind amd64_frame_unwind =
{
+ "amd64 prologue",
NORMAL_FRAME,
amd64_frame_unwind_stop_reason,
amd64_frame_this_id,
static const struct frame_unwind amd64_sigtramp_frame_unwind =
{
+ "amd64 sigtramp",
SIGTRAMP_FRAME,
amd64_sigtramp_frame_unwind_stop_reason,
amd64_sigtramp_frame_this_id,
static const struct frame_unwind amd64_epilogue_frame_unwind =
{
+ "amd64 epilogue",
NORMAL_FRAME,
amd64_epilogue_frame_unwind_stop_reason,
amd64_epilogue_frame_this_id,
static const struct frame_unwind amd64_windows_frame_unwind =
{
+ "amd64 windows",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
&amd64_windows_frame_this_id,
accepts the frame. */
static const struct frame_unwind arc_frame_unwind = {
+ "arc prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
arc_frame_this_id,
context. */
static const struct frame_unwind arc_sigtramp_frame_unwind = {
+ "arc sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
arc_sigtramp_frame_this_id,
}
static frame_unwind arm_prologue_unwind = {
+ "arm prologue",
NORMAL_FRAME,
arm_prologue_unwind_stop_reason,
arm_prologue_this_id,
}
struct frame_unwind arm_exidx_unwind = {
+ "arm exidx",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
arm_prologue_this_id,
static const struct frame_unwind arm_epilogue_frame_unwind =
{
+ "arm epilogue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
arm_epilogue_frame_this_id,
}
struct frame_unwind arm_stub_unwind = {
+ "arm stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
arm_stub_this_id,
struct frame_unwind arm_m_exception_unwind =
{
+ "arm m exception",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
arm_m_exception_this_id,
}
static const struct frame_unwind avr_frame_unwind = {
+ "avr prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
avr_frame_this_id,
static const struct frame_unwind bfin_frame_unwind =
{
+ "bfin prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
bfin_frame_this_id,
static const struct frame_unwind bpf_frame_unwind =
{
+ "bpf prologue",
NORMAL_FRAME,
bpf_frame_unwind_stop_reason,
bpf_frame_this_id,
static const struct frame_unwind cris_sigtramp_frame_unwind =
{
+ "cris sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
cris_sigtramp_frame_this_id,
static const struct frame_unwind cris_frame_unwind =
{
+ "cris prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
cris_frame_this_id,
unwinder. */
static const struct frame_unwind csky_unwind_cache = {
+ "cski prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
csky_frame_this_id,
}
static frame_unwind csky_stub_unwind = {
+ "csky stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
csky_stub_this_id,
const struct frame_unwind dummy_frame_unwind =
{
+ "dummy",
DUMMY_FRAME,
default_frame_unwind_stop_reason,
dummy_frame_this_id,
const struct frame_unwind dwarf2_tailcall_frame_unwind =
{
+ "dwarf2 tailcall",
TAILCALL_FRAME,
default_frame_unwind_stop_reason,
tailcall_frame_this_id,
static const struct frame_unwind dwarf2_frame_unwind =
{
+ "dwarf2",
NORMAL_FRAME,
dwarf2_frame_unwind_stop_reason,
dwarf2_frame_this_id,
static const struct frame_unwind dwarf2_signal_frame_unwind =
{
+ "dwarf2 signal",
SIGTRAMP_FRAME,
dwarf2_frame_unwind_stop_reason,
dwarf2_frame_this_id,
try
{
+ frame_debug_printf ("trying unwinder \"%s\"", unwinder->name);
res = unwinder->sniffer (unwinder, this_frame, this_cache);
}
catch (const gdb_exception &ex)
{
+ frame_debug_printf ("caught exception: %s", ex.message->c_str ());
+
/* Catch all exceptions, caused by either interrupt or error.
Reset *THIS_CACHE, unless something reinitialized the frame
cache meanwhile, in which case THIS_FRAME/THIS_CACHE are now
}
if (res)
- return 1;
+ {
+ frame_debug_printf ("yes");
+ return 1;
+ }
else
{
+ frame_debug_printf ("no");
/* Don't set *THIS_CACHE to NULL here, because sniffer has to do
so. */
frame_cleanup_after_sniffer (this_frame);
void
frame_unwind_find_by_frame (struct frame_info *this_frame, void **this_cache)
{
+ frame_debug_printf ("this_frame=%d", frame_relative_level (this_frame));
+
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct frame_unwind_table *table
= (struct frame_unwind_table *) gdbarch_data (gdbarch, frame_unwind_data);
struct frame_unwind
{
+ const char *name;
/* The frame's type. Should this instead be a collection of
predicates that test the frame for various attributes? */
enum frame_type type;
static const struct frame_unwind frv_linux_sigtramp_frame_unwind =
{
+ "frv linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
frv_linux_sigtramp_frame_this_id,
}
static const struct frame_unwind frv_frame_unwind = {
+ "frv prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
frv_frame_this_id,
static const struct frame_unwind ft32_frame_unwind =
{
+ "ft32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
ft32_frame_this_id,
}
static const struct frame_unwind h8300_frame_unwind = {
+ "h8300 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
h8300_frame_this_id,
}
static const struct frame_unwind hppa_linux_sigtramp_frame_unwind = {
+ "hppa linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
hppa_linux_sigtramp_frame_this_id,
static const struct frame_unwind hppa_frame_unwind =
{
+ "hppa unwind table",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
hppa_frame_this_id,
static const struct frame_unwind hppa_fallback_frame_unwind =
{
+ "hppa prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
hppa_fallback_frame_this_id,
}
static const struct frame_unwind hppa_stub_frame_unwind = {
+ "hppa stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
hppa_stub_frame_this_id,
}
static const struct frame_unwind i386obsd_trapframe_unwind = {
+ "i386 openbsd trap",
/* FIXME: kettenis/20051219: This really is more like an interrupt
frame, but SIGTRAMP_FRAME would print <signal handler called>,
which really is not what we want here. */
static const struct frame_unwind i386_frame_unwind =
{
+ "i386 prologue",
NORMAL_FRAME,
i386_frame_unwind_stop_reason,
i386_frame_this_id,
static const struct frame_unwind i386_epilogue_frame_unwind =
{
+ "i386 epilogue",
NORMAL_FRAME,
i386_epilogue_frame_unwind_stop_reason,
i386_epilogue_frame_this_id,
static const struct frame_unwind i386_stack_tramp_frame_unwind =
{
+ "i386 stack tramp",
NORMAL_FRAME,
i386_epilogue_frame_unwind_stop_reason,
i386_epilogue_frame_this_id,
static const struct frame_unwind i386_sigtramp_frame_unwind =
{
+ "i386 sigtramp",
SIGTRAMP_FRAME,
i386_sigtramp_frame_unwind_stop_reason,
i386_sigtramp_frame_this_id,
static const struct frame_unwind ia64_frame_unwind =
{
+ "ia64 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
&ia64_frame_this_id,
static const struct frame_unwind ia64_sigtramp_frame_unwind =
{
+ "ia64 sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
ia64_sigtramp_frame_this_id,
static const struct frame_unwind ia64_libunwind_frame_unwind =
{
+ "ia64 libunwind",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
ia64_libunwind_frame_this_id,
static const struct frame_unwind ia64_libunwind_sigtramp_frame_unwind =
{
+ "ia64 libunwind sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
ia64_libunwind_sigtramp_frame_this_id,
}
const struct frame_unwind inline_frame_unwind = {
+ "inline",
INLINE_FRAME,
default_frame_unwind_stop_reason,
inline_frame_this_id,
}
static const struct frame_unwind iq2000_frame_unwind = {
+ "iq2000 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
iq2000_frame_this_id,
static const struct frame_unwind jit_frame_unwind =
{
+ "jit",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
jit_frame_this_id,
}
static const struct frame_unwind lm32_frame_unwind = {
+ "lm32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
lm32_frame_this_id,
static const struct frame_unwind m32c_unwind = {
+ "m32c prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
m32c_this_id,
}
static const struct frame_unwind m32r_linux_sigtramp_frame_unwind = {
+ "m32r linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
m32r_linux_sigtramp_frame_this_id,
}
static const struct frame_unwind m32r_frame_unwind = {
+ "m32r prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
m32r_frame_this_id,
}
static const struct frame_unwind m68hc11_frame_unwind = {
+ "m68hc11 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
m68hc11_frame_this_id,
static const struct frame_unwind m68k_linux_sigtramp_frame_unwind =
{
+ "m68k linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
m68k_linux_sigtramp_frame_this_id,
static const struct frame_unwind m68k_frame_unwind =
{
+ "m68k prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
m68k_frame_this_id,
static const struct frame_unwind mep_frame_unwind = {
+ "mep prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mep_frame_this_id,
static const struct frame_unwind microblaze_frame_unwind =
{
+ "microblaze prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
microblaze_frame_this_id,
static const struct frame_unwind mips_sde_frame_unwind =
{
+ "mips sde sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
mips_sde_frame_this_id,
static const struct frame_unwind mips_insn16_frame_unwind =
{
+ "mips insn16 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mips_insn16_frame_this_id,
static const struct frame_unwind mips_micro_frame_unwind =
{
+ "mips micro prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mips_micro_frame_this_id,
static const struct frame_unwind mips_insn32_frame_unwind =
{
+ "mips insn32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mips_insn32_frame_this_id,
static const struct frame_unwind mips_stub_frame_unwind =
{
+ "mips stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mips_stub_frame_this_id,
}
static const struct frame_unwind mn10300_frame_unwind = {
+ "mn10300 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mn10300_frame_this_id,
}
static const struct frame_unwind moxie_frame_unwind = {
+ "moxie prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
moxie_frame_this_id,
}
static const struct frame_unwind msp430_unwind = {
+ "msp430 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
msp430_this_id,
static const struct frame_unwind nds32_frame_unwind =
{
+ "nds32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nds32_frame_this_id,
static const struct frame_unwind nds32_epilogue_frame_unwind =
{
+ "nds32 epilogue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nds32_epilogue_frame_this_id,
static const struct frame_unwind nios2_frame_unwind =
{
+ "nios2 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nios2_frame_this_id,
static const struct frame_unwind nios2_stub_frame_unwind =
{
+ "nios2 stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nios2_stub_frame_this_id,
/* Data structures for the normal prologue-analysis-based unwinder. */
static const struct frame_unwind or1k_frame_unwind = {
+ "or1k prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
or1k_frame_this_id,
}
static const struct frame_unwind ppcfbsd_sigtramp_frame_unwind = {
+ "ppc freebsd sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
ppcfbsd_sigtramp_frame_this_id,
}
static const struct frame_unwind ppcobsd_sigtramp_frame_unwind = {
+ "ppc openbsd sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
ppcobsd_sigtramp_frame_this_id,
struct frame_unwind *unwinder
= GDBARCH_OBSTACK_ZALLOC (newarch, struct frame_unwind);
+ unwinder->name = "python";
unwinder->type = NORMAL_FRAME;
unwinder->stop_reason = default_frame_unwind_stop_reason;
unwinder->this_id = pyuw_this_id;
const struct frame_unwind record_btrace_frame_unwind =
{
+ "record-btrace",
NORMAL_FRAME,
record_btrace_frame_unwind_stop_reason,
record_btrace_frame_this_id,
const struct frame_unwind record_btrace_tailcall_frame_unwind =
{
+ "record-btrace tailcall",
TAILCALL_FRAME,
record_btrace_frame_unwind_stop_reason,
record_btrace_frame_this_id,
static const struct frame_unwind riscv_frame_unwind =
{
+ /*.name =*/ "riscv prologue",
/*.type =*/ NORMAL_FRAME,
/*.stop_reason =*/ default_frame_unwind_stop_reason,
/*.this_id =*/ riscv_frame_this_id,
static const struct frame_unwind rl78_unwind =
{
+ "rl78 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
rl78_this_id,
/* AIX signal handler frame unwinder */
static const struct frame_unwind aix_sighandle_frame_unwind = {
+ "rs6000 aix sighandle",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
aix_sighandle_frame_this_id,
static const struct frame_unwind rs6000_frame_unwind =
{
+ "rs6000 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
rs6000_frame_this_id,
static const struct frame_unwind rs6000_epilogue_frame_unwind =
{
+ "rs6000 epilogue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
rs6000_epilogue_frame_this_id, rs6000_epilogue_frame_prev_register,
analyzer. */
static const struct frame_unwind rx_frame_unwind = {
+ "rx prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
rx_frame_this_id,
analyzer. */
static const struct frame_unwind rx_exception_unwind = {
+ "rx exception",
/* SIGTRAMP_FRAME could be used here, but backtraces are less informative. */
NORMAL_FRAME,
default_frame_unwind_stop_reason,
/* Data structures for the normal prologue-analysis-based unwinder. */
static const struct frame_unwind s12z_frame_unwind = {
+ "s12z prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
s12z_frame_this_id,
/* S390 sigtramp frame unwinder. */
static const struct frame_unwind s390_sigtramp_frame_unwind = {
+ "s390 linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
s390_sigtramp_frame_this_id,
/* Default S390 frame unwinder. */
static const struct frame_unwind s390_frame_unwind = {
+ "s390 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
s390_frame_this_id,
/* S390 stub frame unwinder. */
static const struct frame_unwind s390_stub_frame_unwind = {
+ "s390 stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
s390_stub_frame_this_id,
static const struct frame_unwind score_prologue_unwind =
{
+ "score prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
score_prologue_this_id,
const struct frame_unwind sentinel_frame_unwind =
{
+ "sentinel",
SENTINEL_FRAME,
default_frame_unwind_stop_reason,
sentinel_frame_this_id,
}
static const struct frame_unwind sh_frame_unwind = {
+ "sh prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sh_frame_this_id,
static const struct frame_unwind sh_stub_unwind =
{
+ "sh stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sh_stub_this_id,
static const struct frame_unwind sparc32nbsd_sigcontext_frame_unwind =
{
+ "sparc32 netbsd sigcontext",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc32nbsd_sigcontext_frame_this_id,
}
static const struct frame_unwind sparc32obsd_sigtramp_frame_unwind =
{
+ "sparc32 openbsd sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc32obsd_sigtramp_frame_this_id,
static const struct frame_unwind sparc32_sol2_sigtramp_frame_unwind =
{
+ "sparc32 solaris sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc32_sol2_sigtramp_frame_this_id,
static const struct frame_unwind sparc32_frame_unwind =
{
+ "sparc32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sparc32_frame_this_id,
static const struct frame_unwind sparc64fbsd_sigtramp_frame_unwind =
{
+ "sparc64 freebsd sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc64fbsd_sigtramp_frame_this_id,
static const struct frame_unwind sparc64nbsd_sigcontext_frame_unwind =
{
+ "sparc64 netbsd sigcontext",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc64nbsd_sigcontext_frame_this_id,
static const struct frame_unwind sparc64obsd_frame_unwind =
{
+ "sparc64 openbsd sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc64obsd_frame_this_id,
static const struct frame_unwind sparc64obsd_trapframe_unwind =
{
+ "sparc64 openbsd trap",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sparc64obsd_trapframe_this_id,
static const struct frame_unwind sparc64_sol2_sigtramp_frame_unwind =
{
+ "sparc64 solaris sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
sparc64_sol2_sigtramp_frame_this_id,
static const struct frame_unwind sparc64_frame_unwind =
{
+ "sparc64 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sparc64_frame_this_id,
static const struct frame_unwind tic6x_frame_unwind =
{
+ "tic6x prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
tic6x_frame_this_id,
static const struct frame_unwind tic6x_stub_unwind =
{
+ "tic6x stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
tic6x_stub_this_id,
}
static const struct frame_unwind tilegx_frame_unwind = {
+ "tilegx prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
tilegx_frame_this_id,
}
static const struct frame_unwind v850_frame_unwind = {
+ "v850 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
v850_frame_this_id,
static const struct frame_unwind vax_frame_unwind =
{
+ "vax prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
vax_frame_this_id,
}
static const struct frame_unwind xstormy16_frame_unwind = {
+ "xstormy16 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
xstormy16_frame_this_id,
static const struct frame_unwind
xtensa_unwind =
{
+ "xtensa prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
xtensa_frame_this_id,