]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Provide type_align gdbarch function for nios2.
authorSandra Loosemore <sandra@codesourcery.com>
Sat, 15 Sep 2018 03:09:46 +0000 (20:09 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Sat, 15 Sep 2018 03:09:46 +0000 (20:09 -0700)
2018-09-14  Sandra Loosemore  <sandra@codesourcery.com>

gdb/
* nios2-tdep.c (nios2_type_align): New.
(nios2_gdb_arch_init): Install type_align hook.

gdb/ChangeLog
gdb/nios2-tdep.c

index 4e667b7ec56ed9febce0b39713ba6ea0b89c70ca..6fe0526597c60c0f51da355281539966723b9fed 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-14  Sandra Loosemore  <sandra@codesourcery.com>
+
+       * nios2-tdep.c (nios2_type_align): New.
+       (nios2_gdb_arch_init): Install type_align hook.
+
 2018-09-10  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * eval.c (fake_method::fake_method): Call xzalloc directly for a
index c7d5b9f58f678e760a1f83d8a4284629369b4707..eb5285a4a27e6dfe8b6dc98303e665b15f91c0a7 100644 (file)
@@ -2230,6 +2230,15 @@ nios2_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
   return 1;
 }
 
+/* Implement the type_align gdbarch function.  */
+
+static ULONGEST
+nios2_type_align (struct gdbarch *gdbarch, struct type *type)
+{
+  type = check_typedef (type);
+  return std::min<ULONGEST> (4, TYPE_LENGTH (type));
+}
+
 /* Initialize the Nios II gdbarch.  */
 
 static struct gdbarch *
@@ -2293,6 +2302,8 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_float_bit (gdbarch, 32);
   set_gdbarch_double_bit (gdbarch, 64);
 
+  set_gdbarch_type_align (gdbarch, nios2_type_align);
+
   set_gdbarch_float_format (gdbarch, floatformats_ieee_single);
   set_gdbarch_double_format (gdbarch, floatformats_ieee_double);