This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/8] [AArch64] Teach prologue unwinder to terminate gracefully


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]