From 39ee2ff0da5594221eb8fc5789e002a3b14df2f2 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 12 Dec 2004 16:26:17 +0000 Subject: [PATCH] 2004-12-12 Andrew Cagney * frame.c (get_prev_frame): When unwinding normal frames, check that the PC isn't zero. * hppa-tdep.c (hppa_stub_frame_unwind_cache): Delete check for a zero PC. --- gdb/ChangeLog | 5 +++++ gdb/frame.c | 12 ++++++++++++ gdb/hppa-tdep.c | 3 --- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2b42da6fdca..59161b46efd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2004-12-12 Andrew Cagney + * frame.c (get_prev_frame): When unwinding normal frames, check + that the PC isn't zero. + * hppa-tdep.c (hppa_stub_frame_unwind_cache): Delete check for a + zero PC. + * MAINTAINERS: Reword description of what "Target Instruction Set Architectures" covers. diff --git a/gdb/frame.c b/gdb/frame.c index b2297305999..99ad24d1efa 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1257,6 +1257,18 @@ get_prev_frame (struct frame_info *this_frame) return NULL; } + /* Assume that the only way to get a zero PC is through something + like a SIGSEGV or a dummy frame, and hence that NORMAL frames + will never unwind a zero PC. */ + if (this_frame->level > 0 + && get_frame_type (this_frame) == NORMAL_FRAME + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { + frame_debug_got_null_frame (gdb_stdlog, this_frame, "zero PC"); + return NULL; + } + return get_prev_frame_1 (this_frame); } diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index b04b3c6eb3b..58fe2498165 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2105,9 +2105,6 @@ hppa_stub_frame_unwind_cache (struct frame_info *next_frame, if (*this_cache) return *this_cache; - if (frame_pc_unwind (next_frame) == 0) - return NULL; - info = FRAME_OBSTACK_ZALLOC (struct hppa_stub_unwind_cache); *this_cache = info; info->saved_regs = trad_frame_alloc_saved_regs (next_frame); -- 2.30.2