From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25249 invoked by alias); 7 Dec 2004 09:40:41 -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 24885 invoked from network); 7 Dec 2004 09:40:28 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (212.157.227.139) by sourceware.org with SMTP; 7 Dec 2004 09:40:28 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 48C6947DAB; Tue, 7 Dec 2004 10:40:28 +0100 (CET) Date: Tue, 07 Dec 2004 10:07:00 -0000 From: Joel Brobecker To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] Infinite backtraces... Message-ID: <20041207094028.GA2524@adacore.com> References: <20041202231255.GM994@adacore.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041206071739.GI6359@tausq.org> User-Agent: Mutt/1.4i X-SW-Source: 2004-12/txt/msg00197.txt.bz2 Hello Randolph, > 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. I haven't tested this patch yet, but it looks pretty good, as it is close to something that I did on my side. Just a question: What happens if hppa_stub_frame_prev_register() doesn't set anything? You added "if (info) then hppa_frame_prev ().". Could it ever happen that info is NULL? One thing that I'm thinking is that this will no longer stop the backtrace once your change to hide the stubs goes in (except in the very unlikely case when we're inside the initial stub). Is it still worth including this patch under these conditions? > 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 6 Dec 2004 07:11:29 -0000 > @@ -2111,10 +2115,13 @@ 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; > + > info = FRAME_OBSTACK_ZALLOC (struct hppa_stub_unwind_cache); > *this_cache = info; > info->saved_regs = trad_frame_alloc_saved_regs (next_frame); > @@ -2149,7 +2164,11 @@ hppa_stub_frame_this_id (struct frame_in > { > struct hppa_stub_unwind_cache *info > = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache); > - *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame)); > + > + if (info) > + *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame)); > + else > + *this_id = null_frame_id; > } > > static void > @@ -2161,8 +2180,11 @@ hppa_stub_frame_prev_register (struct fr > { > struct hppa_stub_unwind_cache *info > = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache); > - hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum, > - optimizedp, lvalp, addrp, realnump, valuep); > + > + if (info) > + hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum, > + optimizedp, lvalp, addrp, realnump, > + valuep); > } > > static const struct frame_unwind hppa_stub_frame_unwind = { -- Joel