This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] aarch64: extend decode_adrp to decode immediate offset
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Kyle McMartin <kmcmarti at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 3 Jun 2014 09:22:28 +0100
- Subject: Re: [PATCH 1/2] aarch64: extend decode_adrp to decode immediate offset
- Authentication-results: sourceware.org; auth=none
- References: <20140603050011 dot GA15355 at redacted dot bos dot redhat dot com> <20140603050153 dot GB15355 at redacted dot bos dot redhat dot com>
Hi,
On 3 June 2014 06:01, Kyle McMartin <kmcmarti@redhat.com> wrote:
> @@ -264,16 +264,28 @@ decode_add_sub_imm (CORE_ADDR addr, uint32_t insn, unsigned *rd, unsigned *rn,
> Return 1 if the opcodes matches and is decoded, otherwise 0. */
>
> static int
> -decode_adrp (CORE_ADDR addr, uint32_t insn, unsigned *rd)
> +decode_adrp (CORE_ADDR addr, uint32_t insn, int *page, unsigned *rd,
> + int64_t *imm)
Given that this now decodes both adrp and adr the function name seems
inappropriate, how about following the convention used in the other
decode_ functions and changing to something like decode_adrp_adr ()..
?
Returning both 'page' and 'imm' isn't necessary and I don't think it
makes sense given that logically both adr and adrp are used to
construct an address. Looking at this patch and the following patch I
think you can achieve the same functionality by having the decodes of
both adrp and adr return a value in 'imm'. In the case of an adrp
decode just returning: imm = page << 12 ....
Cheers
/Marcus