diff --git a/defs.h b/defs.h index 34dfb60c..4f028b4d 100644 --- a/defs.h +++ b/defs.h @@ -7903,6 +7903,7 @@ extern unsigned char *gdb_prettyprint_arrays; extern unsigned int *gdb_repeat_count_threshold; extern unsigned char *gdb_stop_print_at_null; extern unsigned int *gdb_output_radix; +int is_kvaddr(ulong); /* * gdb/top.c diff --git a/gdb-10.2.patch b/gdb-10.2.patch index d7b8a432..c1a83c59 100644 --- a/gdb-10.2.patch +++ b/gdb-10.2.patch @@ -16111,3 +16111,29 @@ exit 0 } /* +--- gdb-10.2/gdb/frame.c.orig ++++ gdb-10.2/gdb/frame.c +@@ -2331,6 +2331,10 @@ inside_entry_func (frame_info *this_frame) + This function should not contain target-dependent tests, such as + checking whether the program-counter is zero. */ + ++#ifdef CRASH_MERGE ++extern "C" int is_kvaddr(ulong); ++#endif ++ + struct frame_info * + get_prev_frame (struct frame_info *this_frame) + { +@@ -2353,7 +2357,11 @@ get_prev_frame (struct frame_info *this_frame) + get_frame_id (this_frame); + + frame_pc_p = get_frame_pc_if_available (this_frame, &frame_pc); +- ++#ifdef CRASH_MERGE ++ if (!is_kvaddr(frame_pc)) { ++ return NULL; ++ } ++#endif + /* tausq/2004-12-07: Dummy frames are skipped because it doesn't make much + sense to stop unwinding at a dummy frame. One place where a dummy + frame may have an address "inside_main_func" is on HPUX. On HPUX, the diff --git a/gdb_interface.c b/gdb_interface.c index 8f99a0d7..7ec1a71f 100644 --- a/gdb_interface.c +++ b/gdb_interface.c @@ -947,6 +947,12 @@ gdb_lookup_module_symbol(ulong addr, ulong *offset) } } +int +is_kvaddr(ulong addr) +{ + return IS_KVADDR(addr); +} + /* * Used by gdb_interface() to catch gdb-related errors, if desired. */