diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2018-09-14 20:09:46 -0700 |
---|---|---|
committer | Sandra Loosemore <sandra@codesourcery.com> | 2018-09-14 20:09:46 -0700 |
commit | f70e088ff4ebf79a4bea45e84a8b042706e6e083 (patch) | |
tree | da9dc168f2a89bf65e0851dc087df05f122ecaa0 /gdb/nios2-tdep.c | |
parent | 6c414b69235baf00bd8846cef4d31d8b42436c16 (diff) | |
download | gdb-f70e088ff4ebf79a4bea45e84a8b042706e6e083.zip gdb-f70e088ff4ebf79a4bea45e84a8b042706e6e083.tar.gz gdb-f70e088ff4ebf79a4bea45e84a8b042706e6e083.tar.bz2 |
Provide type_align gdbarch function for nios2.
2018-09-14 Sandra Loosemore <sandra@codesourcery.com>
gdb/
* nios2-tdep.c (nios2_type_align): New.
(nios2_gdb_arch_init): Install type_align hook.
Diffstat (limited to 'gdb/nios2-tdep.c')
-rw-r--r-- | gdb/nios2-tdep.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index c7d5b9f..eb5285a 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -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); |