This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 4/8] [AArch64] Teach prologue unwinder to terminate gracefully
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pierre Langlois <pierre dot langlois at arm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 08 Jul 2015 17:24:32 +0100
- Subject: Re: [PATCH 4/8] [AArch64] Teach prologue unwinder to terminate gracefully
- Authentication-results: sourceware.org; auth=none
- References: <1436273518-5959-1-git-send-email-pierre dot langlois at arm dot com> <1436273518-5959-5-git-send-email-pierre dot langlois at arm dot com>
Pierre Langlois <pierre.langlois@arm.com> writes:
> @@ -944,28 +947,21 @@ aarch64_scan_prologue (struct frame_info *this_frame,
> /* Allocate an aarch64_prologue_cache and fill it with information
> about the prologue of *THIS_FRAME. */
>
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 != NULL)
> + return *this_cache;
> +
> + cache = FRAME_OBSTACK_ZALLOC (struct aarch64_prologue_cache);
> + cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
> + *this_cache = cache;
> +
> + TRY
> + {
> + aarch64_make_prologue_cache_1 (this_frame, cache);
> + }
> + CATCH (ex, RETURN_MASK_ERROR)
> + {
> + if (ex.error != NOT_AVAILABLE_ERROR)
> + throw_exception (ex);
> + }
> + END_CATCH
> +
> return cache;
> }
>
> +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
> + = aarch64_make_prologue_cache (this_frame, this_cache);
> +
> + if (!cache->available_p)
> + return UNWIND_UNAVAILABLE;
> +
> + /* Halt the backtrace at "_start". */
> + if (cache->prev_pc <= gdbarch_tdep (get_frame_arch (this_frame))->lowest_pc)
> + return UNWIND_OUTERMOST;
> +
> + /* We've hit a wall, stop. */
> + if (cache->prev_sp == 0)
> + return UNWIND_OUTERMOST;
As Pedro pointed out, the indentation is wrong.
OK with changes.
--
Yao (éå)