This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH RFC] Protoize remote-adapt.c, remote-array.c
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH RFC] Protoize remote-adapt.c, remote-array.c
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 29 Sep 2000 20:05:29 -0700
More protoization...
I did end up removing a FIXME comment. I believe it was admonishing
the maintainer to merge array_write_inferior_memory() and
array_read_inferior_memory() into a single function. I see no reason
to do this; both of these functions are of reasonable size and are
complex enough that it makes sense to leave them separate.
* remote-adapt.c (adapt_insert_breakpoint, adapt_remove_breakpoint):
Protoize.
* remote-array.c (write_monitor, array_xfer_memory): Protoize.
Index: remote-adapt.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-adapt.c,v
retrieving revision 1.4
diff -u -r1.4 remote-adapt.c
--- remote-adapt.c 2000/09/01 00:12:10 1.4
+++ remote-adapt.c 2000/09/30 02:51:43
@@ -1293,10 +1293,14 @@
#define MAX_BREAKS 8
static int num_brkpts = 0;
+
+/* Insert a breakpoint at ADDR. SAVE is normally the address of the
+ pattern buffer where the instruction that the breakpoint overwrites
+ is saved. It is unused here since the Adapt Monitor is responsible
+ for saving/restoring the original instruction. */
+
static int
-adapt_insert_breakpoint (addr, save)
- CORE_ADDR addr;
- char *save; /* Throw away, let adapt save instructions */
+adapt_insert_breakpoint (CORE_ADDR addr, char *save)
{
if (num_brkpts < MAX_BREAKS)
{
@@ -1314,10 +1318,13 @@
}
}
+
+/* Remove a breakpoint at ADDR. SAVE is normally the previously
+ saved pattern, but is unused here as the Adapt Monitor is
+ responsible for saving/restoring instructions. */
+
static int
-adapt_remove_breakpoint (addr, save)
- CORE_ADDR addr;
- char *save; /* Throw away, let adapt save instructions */
+adapt_remove_breakpoint (CORE_ADDR addr, char *save)
{
if (num_brkpts > 0)
{
Index: remote-array.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-array.c,v
retrieving revision 1.6
diff -u -r1.6 remote-array.c
--- remote-array.c 2000/09/01 00:12:10 1.6
+++ remote-array.c 2000/09/30 02:51:44
@@ -216,9 +216,7 @@
* write_monitor -- send raw data to monitor.
*/
static void
-write_monitor (data, len)
- char data[];
- int len;
+write_monitor (char data[], int len)
{
if (SERIAL_WRITE (array_desc, data, len))
fprintf (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));
@@ -1020,14 +1018,15 @@
return (count);
}
-/* FIXME-someday! merge these two. */
+/* Transfer LEN bytes between GDB address MYADDR and target address
+ MEMADDR. If WRITE is non-zero, transfer them to the target,
+ otherwise transfer them from the target. TARGET is unused.
+
+ Returns the number of bytes transferred. */
+
static int
-array_xfer_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
+array_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct target_ops *target)
{
if (write)
return array_write_inferior_memory (memaddr, myaddr, len);