Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@gcc.gnu.org>
To: Paul Brook <paul@codesourcery.com>
Cc: gdb-patches@sources.redhat.com, Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: [patch] Arm EABI support
Date: Mon, 13 Dec 2004 17:30:00 -0000	[thread overview]
Message-ID: <1102958255.27716.35.camel@pc960.cambridge.arm.com> (raw)
In-Reply-To: <200412131511.28167.paul@codesourcery.com>

On Mon, 2004-12-13 at 15:11, Paul Brook wrote:
> The attached patch adds gdb support for the new Arm EABI. This involves a new 
> calling convention, slightly different elf header flags, and different 
> default floating point format.
> 
> Tested with cross to arm-none-elf and arm-none-eabi.
> Ok?
> 
> 2004-12-13  Paul Brook  <paul@codesourcery.com>
> 
>  * arm-tdep.c (arm_type_align): New function.
>  (arm_push_dummy_call): Use it.  Ensure proper argument alignment.
>  (arm_extract_struct_value_address): Remove.
>  (arm_use_struct_convention): Rename...
>  (arm_return_in_memory): ... To this.  Return nonzero for all small
>  aggregates under the EABI.
>  (arm_return_value): New function.
>  (arm_elf_osabi_sniffer): Add EF_ARM_EABI_VER4:.
>  (arm_gdbarch_init): Set different fpu and abi defaults for EABI
>  objects.  Use set_gdbarch_return_value instead of obsolete functions.
>  (arm_init_abi_eabi_v4): New function.
>  (_initialize_arm_tdep): Register GDB_OSABI_ARM_EABI_V4.
>  * arm-tdep.h (enum arm_abi_variant): Add.
>  (struct gdbarch_tdep): Add abi field.
>  * defs.h (enum gdb_osabi): Add GDB_OSABI_ARM_EABI_V4.
>  * osabi.c (gdb_osabi_name): Add "ARM EABI v4".
>  * testsuite/long_long.exp: Exclude eabi targets from arm FPA float
>  format test.

OK, apart from the following issues:

+/* Return the alignment (in bytes) of the given type.  */
+
+static int
+arm_type_align (struct type *t)

Is this EABI-specific?  If so, it should be part of the function call
name.  If not, then I think this bit of code:

+      if (gdbarch_tdep (gdbarch)->abi == ARM_ABI_APCS_GNU)
+       {
+         /* The old APCS ABI does not require doubleword alignment.  */
+         align = INT_REGISTER_SIZE;
+       }
+      else
+       {
+         align = arm_type_align (arg_type);

Should be reworked so that we always call it.

+    case TYPE_CODE_UNDEF:
+    case TYPE_CODE_FUNC:
+    case TYPE_CODE_VOID:
+    case TYPE_CODE_STRING:
+    case TYPE_CODE_ERROR:
+    case TYPE_CODE_MEMBER:
+    case TYPE_CODE_METHOD:
+    case TYPE_CODE_TEMPLATE:
+    case TYPE_CODE_TEMPLATE_ARG:
+    case TYPE_CODE_NAMESPACE:
+    case TYPE_CODE_TYPEDEF:
+    default:
+      /* Should never happen, so make something up.  */

Why explicitly mention those values & default?  Are they the same case
or not?  My suspicion is that the default should raise an assertion (new
type?)

+   ...
+    case TYPE_CODE_REF:
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_BOOL:
+      return TYPE_LENGTH (t);

Wouldn't it be more sensible to limit this with an abi-specific
max_align value (or 8 if this is for the EABI only).

R.


  reply	other threads:[~2004-12-13 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-13 15:46 Paul Brook
2004-12-13 17:30 ` Richard Earnshaw [this message]
2004-12-13 18:25 ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1102958255.27716.35.camel@pc960.cambridge.arm.com \
    --to=rearnsha@gcc.gnu.org \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=paul@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox