From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19516 invoked by alias); 12 Dec 2004 16:27:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19498 invoked from network); 12 Dec 2004 16:26:58 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 12 Dec 2004 16:26:58 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iBCGQwD2021468 for ; Sun, 12 Dec 2004 11:26:58 -0500 Received: from localhost.redhat.com (vpn50-50.rdu.redhat.com [172.16.50.50]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iBCGQvr07093; Sun, 12 Dec 2004 11:26:57 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 81CC03EF9; Sun, 12 Dec 2004 11:24:49 -0500 (EST) Message-ID: <41BC70D0.9070001@gnu.org> Date: Sun, 12 Dec 2004 16:36:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Randolph Chung Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: [commit] Move zero PC check to frame.c; Was: [RFC] Infinite backtraces... References: <20041203024314.GR6359@tausq.org> <20041203025737.GT994@adacore.com> <20041203045252.GU6359@tausq.org> <20041203165430.GC16491@adacore.com> <20041203180324.GE6359@tausq.org> <20041203182049.GF16491@adacore.com> <20041206071739.GI6359@tausq.org> <20041207094028.GA2524@adacore.com> <20041207155603.GX6359@tausq.org> <20041207163147.GQ2524@adacore.com> <20041208014443.GG6359@tausq.org> In-Reply-To: <20041208014443.GG6359@tausq.org> Content-Type: multipart/mixed; boundary="------------040507010505030107080108" X-SW-Source: 2004-12/txt/msg00329.txt.bz2 This is a multi-part message in MIME format. --------------040507010505030107080108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1404 Randolph Chung wrote: >>I had the same analysis that it should never happen. If Andrew agrees, >>I would recommend simply putting an assertion instead. Putting a dummy >>value is not that satisfactory, as you don't know what this is going >>to be used for. > > > i've committed the following > > 2004-12-05 Randolph Chung > > * hppa-tdep.c (hppa_stub_Frame_unwind_cache): Stop unwinding if > unwinding from a frame with pc == 0. > (hppa_stub_frame_this_id): Likewise. > (hppa_stub_frame_prev_register): Only provide real values if the frame > cache is not NULL. FYI, > Index: hppa-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/hppa-tdep.c,v > retrieving revision 1.185 > diff -u -p -r1.185 hppa-tdep.c > --- hppa-tdep.c 6 Dec 2004 03:32:26 -0000 1.185 > +++ hppa-tdep.c 8 Dec 2004 01:41:08 -0000 > @@ -2111,17 +2124,21 @@ hppa_stub_frame_unwind_cache (struct fra > struct gdbarch *gdbarch = get_frame_arch (next_frame); > struct hppa_stub_unwind_cache *info; > struct unwind_table_entry *u; > > if (*this_cache) > return *this_cache; > > + if (frame_pc_unwind (next_frame) == 0) > + return NULL; > + I've checked in the attached. This test is generic so might as well live in frame.c (you'll note that I've made the conditions on which it triggers more robust). committed, Andrew --------------040507010505030107080108 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1685 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. Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.196 diff -p -u -r1.196 frame.c --- frame.c 8 Dec 2004 01:56:16 -0000 1.196 +++ frame.c 12 Dec 2004 16:23:55 -0000 @@ -1257,6 +1257,18 @@ get_prev_frame (struct frame_info *this_ 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); } Index: hppa-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-tdep.c,v retrieving revision 1.189 diff -p -u -r1.189 hppa-tdep.c --- hppa-tdep.c 8 Dec 2004 06:12:40 -0000 1.189 +++ hppa-tdep.c 12 Dec 2004 16:23:57 -0000 @@ -2105,9 +2105,6 @@ hppa_stub_frame_unwind_cache (struct fra 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); --------------040507010505030107080108--