summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-04-16 15:22:02 +0000
committerMark Kettenis <kettenis@gnu.org>2003-04-16 15:22:02 +0000
commit71acebc43897800d3536763185bd5d3eb06e63ca (patch)
treead43651c3ef8388c09ab34bb92cdb891e30b5a85
parent02f0809e17ec2818c443b558203fd44b45abc502 (diff)
downloadgdb-71acebc43897800d3536763185bd5d3eb06e63ca.tar.gz
* i386-linux-nat.c: Add some whitespace to make things morecarlton_dictionary-20030416-merge
readable. (fetch_register, store_register, fetch_inferior_registers, store_inferior_registers): Get rid of assignment in if-statement. (store_register): Fix typo in error message.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/i386-linux-nat.c25
2 files changed, 24 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ce1361386fb..fcd5d478271 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-16 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c: Add some whitespace to make things more
+ readable.
+ (fetch_register, store_register, fetch_inferior_registers,
+ store_inferior_registers): Get rid of assignment in if-statement.
+ (store_register): Fix typo in error message.
+
2003-04-16 Andrew Cagney <cagney@redhat.com>
* utils.c (xmmalloc): Always allocate something, matches
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 5ea78026095..3744124ebc5 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -107,10 +107,13 @@ static int regmap[] =
/* Which ptrace request retrieves which registers?
These apply to the corresponding SET requests as well. */
+
#define GETREGS_SUPPLIES(regno) \
((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
+
#define GETFPREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
+
#define GETFPXREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
@@ -178,8 +181,9 @@ fetch_register (int regno)
}
/* GNU/Linux LWP ID's are process ID's. */
- if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+ tid = TIDGET (inferior_ptid);
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0);
@@ -203,14 +207,15 @@ store_register (int regno)
return;
/* GNU/Linux LWP ID's are process ID's. */
- if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+ tid = TIDGET (inferior_ptid);
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
errno = 0;
regcache_collect (regno, &val);
ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
if (errno != 0)
- error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno),
+ error ("Couldn't write register %s (#%d): %s.", REGISTER_NAME (regno),
regno, safe_strerror (errno));
}
@@ -522,8 +527,9 @@ fetch_inferior_registers (int regno)
}
/* GNU/Linux LWP ID's are process ID's. */
- if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+ tid = TIDGET (inferior_ptid);
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
@@ -593,8 +599,9 @@ store_inferior_registers (int regno)
}
/* GNU/Linux LWP ID's are process ID's. */
- if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+ tid = TIDGET (inferior_ptid);
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
/* Use the PTRACE_SETFPXREGS requests whenever possible, since it
transfers more registers in one system call. But remember that