/* Remote debugging for the ARM RDP interface.
- Copyright 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "inferior.h"
-#include "gdb_wait.h"
#include "value.h"
#include "callback.h"
#include "command.h"
#include "remote-utils.h"
#include "gdb_string.h"
#include "gdbcore.h"
+#include "regcache.h"
#ifdef HAVE_TIME_H
#include <time.h>
static char *commandline = NULL;
static int
-remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr,
- char *myaddr,
- int len,
- int write, struct target_ops *target);
+remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+ int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
/* Stuff for talking to the serial layer. */
*pi = get_byte ();
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
va_end (alist);
if (dst != buf)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
*/
if (commandline != NULL)
- free (commandline);
+ xfree (commandline);
- commandline = malloc (strlen (command) + strlen (args) + 2);
- if (commandline != NULL)
- {
- strcpy (commandline, command);
- strcat (commandline, " ");
- strcat (commandline, args);
- }
+ xasprintf (&commandline, "%s %s", command, args);
}
static void
char *copy = alloca (args[2].n);
int done = callback->read (callback, args[0].n, copy, args[2].n);
if (done > 0)
- remote_rdp_xfer_inferior_memory (args[1].n, copy, done, 1, 0);
+ remote_rdp_xfer_inferior_memory (args[1].n, copy, done, 1, 0, 0);
args->n = args[2].n - done;
return 1;
}
commandline[255] = '\0';
}
remote_rdp_xfer_inferior_memory (args[0].n,
- commandline, len + 1, 1, 0);
+ commandline, len + 1, 1, 0, 0);
}
else
- remote_rdp_xfer_inferior_memory (args[0].n, "", 1, 1, 0);
+ remote_rdp_xfer_inferior_memory (args[0].n, "", 1, 1, 0, 0);
return 1;
default:
buf,
len,
0,
+ 0,
0);
}
else
break;
default:
- error ("Unimplented SWI argument");
+ error ("Unimplemented SWI argument");
}
type = type >> 2;
to the target, or zero for no signal. */
static void
-remote_rdp_resume (int pid, int step, enum target_signal siggnal)
+remote_rdp_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
if (step)
rdp_step ();
or -1 in case of error; store status through argument pointer STATUS,
just as `wait' would. */
-static int
-remote_rdp_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+remote_rdp_wait (ptid_t ptid, struct target_waitstatus *status)
{
switch (ds.rdi_stopped_status)
{
#endif
}
- return inferior_pid;
+ return inferior_ptid;
}
/* Get ready to modify the registers array. On machines which store
/* Do nothing, since we can store individual regs */
}
+/* 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
-remote_rdp_xfer_inferior_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
+remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+ int write,
+ struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+ struct target_ops *target ATTRIBUTE_UNUSED)
{
/* I infer from D Taylor's code that there's a limit on the amount
we can transfer in one chunk.. */
/* This gives us a chance to set up the command line */
rdp_set_command_line (exec_file, allargs);
- inferior_pid = 42;
+ inferior_ptid = pid_to_ptid (42);
insert_breakpoints (); /* Needed to get correct instruction in cache */
/*
remote_rdp_ops.to_thread_alive = 0;
remote_rdp_ops.to_stop = 0;
remote_rdp_ops.to_pid_to_exec_file = NULL;
- remote_rdp_ops.to_core_file_to_sym_file = NULL;
remote_rdp_ops.to_stratum = process_stratum;
remote_rdp_ops.DONT_USE = NULL;
remote_rdp_ops.to_has_all_memory = 1;