aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/sparc-nat.c')
-rw-r--r--gdb/sparc-nat.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index b9f48b3..e85b5e9 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -53,7 +53,7 @@
#ifdef HAVE_STRUCT_REG
typedef struct reg gregset_t;
typedef struct fpreg fpregset_t;
-#else
+#else
typedef struct regs gregset_t;
typedef struct fp_status fpregset_t;
#endif
@@ -94,14 +94,14 @@ gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr)
/* Register set description. */
const struct sparc_gregmap *sparc_gregmap;
const struct sparc_fpregmap *sparc_fpregmap;
-void (*sparc_supply_gregset) (const struct sparc_gregmap *,
- struct regcache *, int , const void *);
+void (*sparc_supply_gregset) (const struct sparc_gregmap *, struct regcache *,
+ int, const void *);
void (*sparc_collect_gregset) (const struct sparc_gregmap *,
const struct regcache *, int, void *);
void (*sparc_supply_fpregset) (const struct sparc_fpregmap *,
- struct regcache *, int , const void *);
+ struct regcache *, int, const void *);
void (*sparc_collect_fpregset) (const struct sparc_fpregmap *,
- const struct regcache *, int , void *);
+ const struct regcache *, int, void *);
int (*sparc_gregset_supplies_p) (struct gdbarch *, int);
int (*sparc_fpregset_supplies_p) (struct gdbarch *, int);
@@ -118,10 +118,8 @@ sparc32_gregset_supplies_p (struct gdbarch *gdbarch, int regnum)
return 1;
/* Control registers. */
- if (regnum == SPARC32_PC_REGNUM
- || regnum == SPARC32_NPC_REGNUM
- || regnum == SPARC32_PSR_REGNUM
- || regnum == SPARC32_Y_REGNUM)
+ if (regnum == SPARC32_PC_REGNUM || regnum == SPARC32_NPC_REGNUM
+ || regnum == SPARC32_PSR_REGNUM || regnum == SPARC32_Y_REGNUM)
return 1;
return 0;
@@ -166,7 +164,7 @@ sparc_fetch_inferior_registers (process_stratum_target *proc_target,
gregset_t regs;
if (gdb_ptrace (PTRACE_GETREGS, ptid, (PTRACE_TYPE_ARG3) &regs) == -1)
- perror_with_name (_("Couldn't get registers"));
+ perror_with_name (_ ("Couldn't get registers"));
/* Deep down, sparc_supply_rwindow reads memory, so needs the global
thread context to be set. */
@@ -182,8 +180,9 @@ sparc_fetch_inferior_registers (process_stratum_target *proc_target,
{
fpregset_t fpregs;
- if (gdb_ptrace (PTRACE_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs) == -1)
- perror_with_name (_("Couldn't get floating point status"));
+ if (gdb_ptrace (PTRACE_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs)
+ == -1)
+ perror_with_name (_ ("Couldn't get floating point status"));
sparc_supply_fpregset (sparc_fpregmap, regcache, -1, &fpregs);
}
@@ -201,12 +200,12 @@ sparc_store_inferior_registers (process_stratum_target *proc_target,
gregset_t regs;
if (gdb_ptrace (PTRACE_GETREGS, ptid, (PTRACE_TYPE_ARG3) &regs) == -1)
- perror_with_name (_("Couldn't get registers"));
+ perror_with_name (_ ("Couldn't get registers"));
sparc_collect_gregset (sparc_gregmap, regcache, regnum, &regs);
if (gdb_ptrace (PTRACE_SETREGS, ptid, (PTRACE_TYPE_ARG3) &regs) == -1)
- perror_with_name (_("Couldn't write registers"));
+ perror_with_name (_ ("Couldn't write registers"));
/* Deal with the stack regs. */
if (regnum == -1 || regnum == SPARC_SP_REGNUM
@@ -232,8 +231,9 @@ sparc_store_inferior_registers (process_stratum_target *proc_target,
{
fpregset_t fpregs, saved_fpregs;
- if (gdb_ptrace (PTRACE_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs) == -1)
- perror_with_name (_("Couldn't get floating-point registers"));
+ if (gdb_ptrace (PTRACE_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs)
+ == -1)
+ perror_with_name (_ ("Couldn't get floating-point registers"));
memcpy (&saved_fpregs, &fpregs, sizeof (fpregs));
sparc_collect_fpregset (sparc_fpregmap, regcache, regnum, &fpregs);
@@ -244,9 +244,9 @@ sparc_store_inferior_registers (process_stratum_target *proc_target,
to write the registers if nothing changed. */
if (memcmp (&saved_fpregs, &fpregs, sizeof (fpregs)) != 0)
{
- if (gdb_ptrace (PTRACE_SETFPREGS, ptid,
- (PTRACE_TYPE_ARG3) &fpregs) == -1)
- perror_with_name (_("Couldn't write floating-point registers"));
+ if (gdb_ptrace (PTRACE_SETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs)
+ == -1)
+ perror_with_name (_ ("Couldn't write floating-point registers"));
}
if (regnum != -1)
@@ -254,24 +254,22 @@ sparc_store_inferior_registers (process_stratum_target *proc_target,
}
}
-
/* Implement the to_xfer_partial target_ops method for
TARGET_OBJECT_WCOOKIE. Fetch StackGhost Per-Process XOR cookie. */
enum target_xfer_status
-sparc_xfer_wcookie (enum target_object object,
- const char *annex, gdb_byte *readbuf,
- const gdb_byte *writebuf, ULONGEST offset, ULONGEST len,
- ULONGEST *xfered_len)
+sparc_xfer_wcookie (enum target_object object, const char *annex,
+ gdb_byte *readbuf, const gdb_byte *writebuf,
+ ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
{
unsigned long wcookie = 0;
- char *buf = (char *)&wcookie;
+ char *buf = (char *) &wcookie;
gdb_assert (object == TARGET_OBJECT_WCOOKIE);
gdb_assert (readbuf && writebuf == NULL);
if (offset == sizeof (unsigned long))
- return TARGET_XFER_EOF; /* Signal EOF. */
+ return TARGET_XFER_EOF; /* Signal EOF. */
if (offset > sizeof (unsigned long))
return TARGET_XFER_E_IO;
@@ -292,7 +290,7 @@ sparc_xfer_wcookie (enum target_object object,
if (ptrace (PT_WCOOKIE, pid, (PTRACE_TYPE_ARG3) &wcookie, 0) == -1)
{
if (errno != EINVAL)
- perror_with_name (_("Couldn't get StackGhost cookie"));
+ perror_with_name (_ ("Couldn't get StackGhost cookie"));
/* Although PT_WCOOKIE is defined on OpenBSD 3.1 and later,
the request wasn't implemented until after OpenBSD 3.4. If
@@ -310,9 +308,9 @@ sparc_xfer_wcookie (enum target_object object,
*xfered_len = (ULONGEST) len;
return TARGET_XFER_OK;
}
-
void _initialize_sparc_nat ();
+
void
_initialize_sparc_nat ()
{