diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:36:23 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:46:02 -0500 |
commit | c583a2520616c2736cffc389c89a48b159366e6c (patch) | |
tree | b4925f26506fcee96c16119431c01760f05db95d /gdb/alpha-netbsd-tdep.c | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | binutils-users/simark/clang-format.zip binutils-users/simark/clang-format.tar.gz binutils-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdb/alpha-netbsd-tdep.c')
-rw-r--r-- | gdb/alpha-netbsd-tdep.c | 82 |
1 files changed, 31 insertions, 51 deletions
diff --git a/gdb/alpha-netbsd-tdep.c b/gdb/alpha-netbsd-tdep.c index 5ea7d28..d4b71a0 100644 --- a/gdb/alpha-netbsd-tdep.c +++ b/gdb/alpha-netbsd-tdep.c @@ -36,10 +36,10 @@ /* Core file support. */ /* Sizeof `struct reg' in <machine/reg.h>. */ -#define ALPHANBSD_SIZEOF_GREGS (32 * 8) +#define ALPHANBSD_SIZEOF_GREGS (32 * 8) /* Sizeof `struct fpreg' in <machine/reg.h. */ -#define ALPHANBSD_SIZEOF_FPREGS ((32 * 8) + 8) +#define ALPHANBSD_SIZEOF_FPREGS ((32 * 8) + 8) /* Supply register REGNUM from the buffer specified by FPREGS and LEN in the floating-point register set REGSET to register cache @@ -47,8 +47,8 @@ static void alphanbsd_supply_fpregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *fpregs, size_t len) + struct regcache *regcache, int regnum, + const void *fpregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) fpregs; int i; @@ -71,28 +71,20 @@ alphanbsd_supply_fpregset (const struct regset *regset, static void alphanbsd_aout_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t len) + struct regcache *regcache, int regnum, + const void *gregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) gregs; int i; /* Table to map a GDB register number to a trapframe register index. */ - static const int regmap[] = - { - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15, - 30, 31, 32, 16, - 17, 18, 19, 20, - 21, 22, 23, 24, - 25, 29, 26 - }; + static const int regmap[] + = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 30, 31, 32, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 29, 26 }; gdb_assert (len >= ALPHANBSD_SIZEOF_GREGS); - for (i = 0; i < ARRAY_SIZE(regmap); i++) + for (i = 0; i < ARRAY_SIZE (regmap); i++) { if (regnum == i || regnum == -1) regcache->raw_supply (i, regs + regmap[i] * 8); @@ -115,8 +107,8 @@ alphanbsd_aout_supply_gregset (const struct regset *regset, static void alphanbsd_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t len) + struct regcache *regcache, int regnum, + const void *gregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) gregs; int i; @@ -139,19 +131,11 @@ alphanbsd_supply_gregset (const struct regset *regset, /* NetBSD/alpha register sets. */ -static const struct regset alphanbsd_gregset = -{ - NULL, - alphanbsd_supply_gregset, - NULL, - REGSET_VARIABLE_SIZE -}; +static const struct regset alphanbsd_gregset + = { NULL, alphanbsd_supply_gregset, NULL, REGSET_VARIABLE_SIZE }; -static const struct regset alphanbsd_fpregset = -{ - NULL, - alphanbsd_supply_fpregset -}; +static const struct regset alphanbsd_fpregset + = { NULL, alphanbsd_supply_fpregset }; /* Iterate over supported core file register note sections. */ @@ -166,7 +150,6 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, ALPHANBSD_SIZEOF_FPREGS, &alphanbsd_fpregset, NULL, cb_data); } - /* Signal trampolines. */ @@ -186,15 +169,14 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, sequence and can then check whether we really are executing in the signal trampoline. If not, -1 is returned, otherwise the offset from the start of the return sequence is returned. */ -static const gdb_byte sigtramp_retcode[] = -{ - 0x00, 0x00, 0x1e, 0xa6, /* ldq a0, 0(sp) */ - 0x10, 0x00, 0xde, 0x23, /* lda sp, 16(sp) */ - 0x27, 0x01, 0x1f, 0x20, /* lda v0, 295(zero) */ - 0x83, 0x00, 0x00, 0x00, /* call_pal callsys */ +static const gdb_byte sigtramp_retcode[] = { + 0x00, 0x00, 0x1e, 0xa6, /* ldq a0, 0(sp) */ + 0x10, 0x00, 0xde, 0x23, /* lda sp, 16(sp) */ + 0x27, 0x01, 0x1f, 0x20, /* lda v0, 295(zero) */ + 0x83, 0x00, 0x00, 0x00, /* call_pal callsys */ }; -#define RETCODE_NWORDS 4 -#define RETCODE_SIZE (RETCODE_NWORDS * 4) +#define RETCODE_NWORDS 4 +#define RETCODE_SIZE (RETCODE_NWORDS * 4) static LONGEST alphanbsd_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) @@ -227,8 +209,8 @@ alphanbsd_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) } static int -alphanbsd_pc_in_sigtramp (struct gdbarch *gdbarch, - CORE_ADDR pc, const char *func_name) +alphanbsd_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, + const char *func_name) { return (nbsd_pc_in_sigtramp (pc, func_name) || alphanbsd_sigtramp_offset (gdbarch, pc) >= 0); @@ -244,11 +226,9 @@ alphanbsd_sigcontext_addr (frame_info_ptr frame) return 0; return get_frame_base (get_next_frame (frame)); } - static void -alphanbsd_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch) +alphanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { alpha_gdbarch_tdep *tdep = gdbarch_tdep<alpha_gdbarch_tdep> (gdbarch); @@ -265,8 +245,8 @@ alphanbsd_init_abi (struct gdbarch_info info, set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); /* NetBSD/alpha has SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset; tdep->pc_in_sigtramp = alphanbsd_pc_in_sigtramp; @@ -275,12 +255,12 @@ alphanbsd_init_abi (struct gdbarch_info info, tdep->jb_pc = 2; tdep->jb_elt_size = 8; - set_gdbarch_iterate_over_regset_sections - (gdbarch, alphanbsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, alphanbsd_iterate_over_regset_sections); } - void _initialize_alphanbsd_tdep (); + void _initialize_alphanbsd_tdep () { |