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/ppc-obsd-tdep.c | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | gdb-users/simark/clang-format.zip gdb-users/simark/clang-format.tar.gz gdb-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdb/ppc-obsd-tdep.c')
-rw-r--r-- | gdb/ppc-obsd-tdep.c | 80 |
1 files changed, 33 insertions, 47 deletions
diff --git a/gdb/ppc-obsd-tdep.c b/gdb/ppc-obsd-tdep.c index d407c23..bd80a6c 100644 --- a/gdb/ppc-obsd-tdep.c +++ b/gdb/ppc-obsd-tdep.c @@ -35,7 +35,6 @@ /* Register offsets from <machine/reg.h>. */ struct ppc_reg_offsets ppcobsd_reg_offsets; struct ppc_reg_offsets ppcobsd_fpreg_offsets; - /* Core file support. */ @@ -44,9 +43,8 @@ struct ppc_reg_offsets ppcobsd_fpreg_offsets; REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ void -ppcobsd_supply_gregset (const struct regset *regset, - struct regcache *regcache, int regnum, - const void *gregs, size_t len) +ppcobsd_supply_gregset (const struct regset *regset, struct regcache *regcache, + int regnum, const void *gregs, size_t len) { ppc_supply_gregset (regset, regcache, regnum, gregs, len); ppc_supply_fpregset (regset, regcache, regnum, gregs, len); @@ -68,17 +66,11 @@ ppcobsd_collect_gregset (const struct regset *regset, /* OpenBSD/powerpc register set. */ -const struct regset ppcobsd_gregset = -{ - &ppcobsd_reg_offsets, - ppcobsd_supply_gregset -}; +const struct regset ppcobsd_gregset + = { &ppcobsd_reg_offsets, ppcobsd_supply_gregset }; -const struct regset ppcobsd_fpregset = -{ - &ppcobsd_fpreg_offsets, - ppc_supply_fpregset -}; +const struct regset ppcobsd_fpregset + = { &ppcobsd_fpreg_offsets, ppc_supply_fpregset }; /* Iterate over core file register note sections. */ @@ -90,7 +82,6 @@ ppcobsd_iterate_over_regset_sections (struct gdbarch *gdbarch, { cb (".reg", 412, 412, &ppcobsd_gregset, NULL, cb_data); } - /* Signal trampolines. */ @@ -109,16 +100,13 @@ ppcobsd_iterate_over_regset_sections (struct gdbarch *gdbarch, static const int ppcobsd_page_size = 4096; /* Offset for sigreturn(2). */ -static const int ppcobsd_sigreturn_offset[] = { - 0x98, /* OpenBSD 3.8 */ - 0x0c, /* OpenBSD 3.2 */ - -1 -}; +static const int ppcobsd_sigreturn_offset[] = { 0x98, /* OpenBSD 3.8 */ + 0x0c, /* OpenBSD 3.2 */ + -1 }; static int ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, - void **this_cache) + frame_info_ptr this_frame, void **this_cache) { struct gdbarch *gdbarch = get_frame_arch (this_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -137,7 +125,7 @@ ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self, unsigned long insn; if (!safe_frame_unwind_memory (this_frame, start_pc + *offset, - {buf, sizeof buf})) + { buf, sizeof buf })) continue; /* Check for "li r0,SYS_sigreturn". */ @@ -146,8 +134,8 @@ ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self, continue; /* Check for "sc". */ - insn = extract_unsigned_integer (buf + PPC_INSN_SIZE, - PPC_INSN_SIZE, byte_order); + insn = extract_unsigned_integer (buf + PPC_INSN_SIZE, PPC_INSN_SIZE, + byte_order); if (insn != 0x44000002) continue; @@ -177,7 +165,7 @@ ppcobsd_sigtramp_frame_cache (frame_info_ptr this_frame, void **this_cache) func = get_frame_pc (this_frame); func &= ~(ppcobsd_page_size - 1); - if (!safe_frame_unwind_memory (this_frame, func, {buf, sizeof buf})) + if (!safe_frame_unwind_memory (this_frame, func, { buf, sizeof buf })) return cache; /* Calculate the offset where we can find `struct sigcontext'. We @@ -212,11 +200,11 @@ ppcobsd_sigtramp_frame_cache (frame_info_ptr this_frame, void **this_cache) } static void -ppcobsd_sigtramp_frame_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +ppcobsd_sigtramp_frame_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { - struct trad_frame_cache *cache = - ppcobsd_sigtramp_frame_cache (this_frame, this_cache); + struct trad_frame_cache *cache + = ppcobsd_sigtramp_frame_cache (this_frame, this_cache); trad_frame_get_id (cache, this_id); } @@ -225,22 +213,20 @@ static struct value * ppcobsd_sigtramp_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) { - struct trad_frame_cache *cache = - ppcobsd_sigtramp_frame_cache (this_frame, this_cache); + struct trad_frame_cache *cache + = ppcobsd_sigtramp_frame_cache (this_frame, this_cache); return trad_frame_get_register (cache, this_frame, regnum); } -static const struct frame_unwind ppcobsd_sigtramp_frame_unwind = { - "ppc openbsd sigtramp", - SIGTRAMP_FRAME, - default_frame_unwind_stop_reason, - ppcobsd_sigtramp_frame_this_id, - ppcobsd_sigtramp_frame_prev_register, - NULL, - ppcobsd_sigtramp_frame_sniffer -}; - +static const struct frame_unwind ppcobsd_sigtramp_frame_unwind + = { "ppc openbsd sigtramp", + SIGTRAMP_FRAME, + default_frame_unwind_stop_reason, + ppcobsd_sigtramp_frame_this_id, + ppcobsd_sigtramp_frame_prev_register, + NULL, + ppcobsd_sigtramp_frame_sniffer }; static void ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -253,16 +239,17 @@ ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_return_value (gdbarch, ppc_sysv_abi_broken_return_value); /* OpenBSD uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_ilp32_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_ilp32_fetch_link_map_offsets); - set_gdbarch_iterate_over_regset_sections - (gdbarch, ppcobsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, ppcobsd_iterate_over_regset_sections); frame_unwind_append_unwinder (gdbarch, &ppcobsd_sigtramp_frame_unwind); } void _initialize_ppcobsd_tdep (); + void _initialize_ppcobsd_tdep () { @@ -290,7 +277,6 @@ _initialize_ppcobsd_tdep () /* Floating-point registers. */ ppcobsd_reg_offsets.f0_offset = 128; ppcobsd_reg_offsets.fpscr_offset = -1; - } if (ppcobsd_fpreg_offsets.fpscr_offset == 0) |