From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75011 invoked by alias); 8 Jul 2015 16:34:56 -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 74986 invoked by uid 89); 8 Jul 2015 16:34:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 08 Jul 2015 16:34:53 +0000 Received: by pdrg1 with SMTP id g1so16934514pdr.2 for ; Wed, 08 Jul 2015 09:34:51 -0700 (PDT) X-Received: by 10.70.43.72 with SMTP id u8mr22299079pdl.33.1436373291176; Wed, 08 Jul 2015 09:34:51 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id k9sm3033241pdp.60.2015.07.08.09.34.49 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 08 Jul 2015 09:34:50 -0700 (PDT) From: Yao Qi To: Pierre Langlois Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/8] [AArch64] Teach stub unwinder to terminate gracefully References: <1436273518-5959-1-git-send-email-pierre.langlois@arm.com> <1436273518-5959-6-git-send-email-pierre.langlois@arm.com> Date: Wed, 08 Jul 2015 16:34:00 -0000 In-Reply-To: <1436273518-5959-6-git-send-email-pierre.langlois@arm.com> (Pierre Langlois's message of "Tue, 7 Jul 2015 13:51:55 +0100") Message-ID: <86lheqmwux.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/msg00233.txt.bz2 Pierre Langlois writes: > The stub unwinder is used on AArch64 if the target's memory is not > readable at the current PC. If we purposely kill the inferior before The stub unwinder is used if the target memory is not readable, for example, PC is 0x0. Many GDB ports use stub unwinder to handle this case. This is not aarch64 specific. Please update your commit log to reflect this. > diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c > index 87a6d61..57976b7 100644 > --- a/gdb/aarch64-tdep.c > +++ b/gdb/aarch64-tdep.c > @@ -1109,13 +1109,36 @@ aarch64_make_stub_cache (struct frame_info *this_= frame, void **this_cache) > cache->saved_regs =3D trad_frame_alloc_saved_regs (this_frame); > *this_cache =3D cache; >=20=20 > - cache->prev_sp > - =3D get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); > - cache->prev_pc =3D get_frame_pc (this_frame); > + TRY > + { > + cache->prev_sp > + =3D get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); I feel this is a better way to indent the code, cache->prev_sp =3D get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); > + cache->prev_pc =3D get_frame_pc (this_frame); > + cache->available_p =3D 1; > + } > + CATCH (ex, RETURN_MASK_ERROR) > + { > + if (ex.error !=3D NOT_AVAILABLE_ERROR) > + throw_exception (ex); > + } > + END_CATCH >=20=20 > return cache; > } >=20=20 > +static enum unwind_stop_reason > +aarch64_stub_frame_unwind_stop_reason (struct frame_info *this_frame, > + void **this_cache) > +{ We need comments to this function. > + struct aarch64_prologue_cache *cache > + =3D aarch64_make_stub_cache (this_frame, this_cache); I realise that prologue cache is used for stub unwinder. If stub unwinder doesn't use all the fields of prologue cache, probably, we can create a stub cache. However, it can be a follow-up patch. This patch is good to me with the change. --=20 Yao (=E9=BD=90=E5=B0=A7)