diff --git a/defs.h b/defs.h index 1ddfc5e9..6467a9cc 100644 --- a/defs.h +++ b/defs.h @@ -7920,6 +7920,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 3e6677d9..6b3d3fbd 100644 --- a/gdb-10.2.patch +++ b/gdb-10.2.patch @@ -16110,4 +16110,30 @@ exit 0 + (dynamic_castgdb_stderr)->set_stream(original_stderr_stream); } - /* \ No newline at end of file + /* +--- 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 003424fa..28ec635e 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. */