This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/TileGX 4/6]use skip_prologue_using_sal for skipping prologue
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jiong Wang <jiwang at tilera dot com>
- Cc: gdb-patches at sourceware dot org, Walter Lee <walt at tilera dot com>
- Date: Fri, 18 Jan 2013 17:40:57 +0400
- Subject: Re: [RFC/TileGX 4/6]use skip_prologue_using_sal for skipping prologue
- References: <50F915DF.7020802@tilera.com>
On Fri, Jan 18, 2013 at 05:29:03PM +0800, Jiong Wang wrote:
> use skip_prologue_using_sal, instead of old find_pc_line, for skip prologue
>
> gdb/ChangeLog:
>
> * tilegx-tdep.c (tilegx_skip_prologue): Use skip_prologue_using_sal.
>
> please review.
>
> ---
> Regards,
> Jiong
> Tilera Corporation.
>
> ---
> gdb/tilegx-tdep.c | 22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
> index 638be6c..7f36bed 100644
> --- a/gdb/tilegx-tdep.c
> +++ b/gdb/tilegx-tdep.c
> @@ -731,28 +731,28 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
> /* This is the implementation of gdbarch method skip_prologue. */
>
> static CORE_ADDR
> -tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
> +tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
This is not an objection, but IMO "start_pc" is more confusing
than "pc". I would have understood better the change if it was
done to match the name used in the gdbarch_skip_prologue_ftype,
but there it uses "ip" (which, frankly, isn't great either).
This is highly subjective, so feel free to ignore.
> + CORE_ADDR post_prologue_pc
> + = skip_prologue_using_sal (gdbarch, func_start);
> + if (post_prologue_pc != 0)
> + return max (start_pc, post_prologue_pc);
Can you add an empty line between the variable declarations,
and the rest of the code? (this is a GDB coding convention).
> return tilegx_analyze_prologue (gdbarch,
> - pc, pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
> + start_pc,
> + start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
The indentation should be done using tabs first, and then spaces
if necessary. Again, a GDB convention.
Thanks,
--
Joel