From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50154 invoked by alias); 8 Jul 2015 16:24:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 48838 invoked by uid 89); 8 Jul 2015 16:24:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mail-pd0-f177.google.com Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 08 Jul 2015 16:24:38 +0000 Received: by pdrg1 with SMTP id g1so16795873pdr.2 for ; Wed, 08 Jul 2015 09:24:36 -0700 (PDT) X-Received: by 10.70.100.168 with SMTP id ez8mr21972127pdb.129.1436372676665; Wed, 08 Jul 2015 09:24:36 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id yp5sm3013778pbb.22.2015.07.08.09.24.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 08 Jul 2015 09:24:36 -0700 (PDT) From: Yao Qi To: Pierre Langlois Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/8] [AArch64] Teach prologue unwinder to terminate gracefully References: <1436273518-5959-1-git-send-email-pierre.langlois@arm.com> <1436273518-5959-5-git-send-email-pierre.langlois@arm.com> Date: Wed, 08 Jul 2015 16:24:00 -0000 In-Reply-To: <1436273518-5959-5-git-send-email-pierre.langlois@arm.com> (Pierre Langlois's message of "Tue, 7 Jul 2015 13:51:54 +0100") Message-ID: <86pp42mxbz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00232.txt.bz2 Pierre Langlois writes: > @@ -944,28 +947,21 @@ aarch64_scan_prologue (struct frame_info *this_fram= e, > /* Allocate an aarch64_prologue_cache and fill it with information > about the prologue of *THIS_FRAME. */ >=20=20 This comment should be moved to aarch64_make_prologue_cache below, and we need add something for argument this_cache. Secondly, we need comments for this function too. > -static struct aarch64_prologue_cache * > -aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_= cache) > +static void > +aarch64_make_prologue_cache_1 (struct frame_info *this_frame, > + struct aarch64_prologue_cache *cache) > + > +static struct aarch64_prologue_cache * > +aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_= cache) > +{ > + struct aarch64_prologue_cache *cache; > + > + if (*this_cache) if (*this_cache !=3D NULL) > + return *this_cache; > + > + cache =3D FRAME_OBSTACK_ZALLOC (struct aarch64_prologue_cache); > + cache->saved_regs =3D trad_frame_alloc_saved_regs (this_frame); > + *this_cache =3D cache; > + > + TRY > + { > + aarch64_make_prologue_cache_1 (this_frame, cache); > + } > + CATCH (ex, RETURN_MASK_ERROR) > + { > + if (ex.error !=3D NOT_AVAILABLE_ERROR) > + throw_exception (ex); > + } > + END_CATCH > + > return cache; > } >=20=20 > +static enum unwind_stop_reason > +aarch64_prologue_frame_unwind_stop_reason (struct frame_info *this_frame, > + void **this_cache) The indentation looks odd. > +{ > + struct aarch64_prologue_cache *cache > + =3D aarch64_make_prologue_cache (this_frame, this_cache); > + > + if (!cache->available_p) > + return UNWIND_UNAVAILABLE; > + > + /* Halt the backtrace at "_start". */ > + if (cache->prev_pc <=3D gdbarch_tdep (get_frame_arch (this_frame))->lo= west_pc) > + return UNWIND_OUTERMOST; > + > + /* We've hit a wall, stop. */ > + if (cache->prev_sp =3D=3D 0) > + return UNWIND_OUTERMOST; As Pedro pointed out, the indentation is wrong. OK with changes. --=20 Yao (=E9=BD=90=E5=B0=A7)