/* GDB interface to ARM RDI library.
- Copyright 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "bfd.h"
#include "symfile.h"
#include "target.h"
-#include "gdb_wait.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
#include "gdbthread.h"
#include "gdbcore.h"
#include "breakpoint.h"
+#include "completer.h"
+#include "regcache.h"
#ifdef USG
#include <sys/types.h>
static int arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr,
int len, int should_write,
+ struct mem_attrib *attrib,
struct target_ops *target);
static void arm_rdi_prepare_to_store (void);
static void arm_rdi_fetch_registers (int regno);
-static void arm_rdi_resume (int pid, int step, enum target_signal siggnal);
+static void arm_rdi_resume (ptid_t pid, int step,
+ enum target_signal siggnal);
static int arm_rdi_start_remote (char *dummy);
static void arm_rdi_send (char *buf);
-static int arm_rdi_wait (int pid, struct target_waitstatus *status);
+static ptid_t arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status);
static void arm_rdi_kill (void);
these to forward output from the target system and so forth. */
void
-voiddummy (void)
+voiddummy (void *dummy)
{
fprintf_unfiltered (gdb_stdout, "void dummy\n");
}
{
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
Adp_CloseDevice ();
- error ("RID_open failed\n");
+ error ("RDI_open failed\n");
}
rslt = angel_RDI_info (RDIInfo_Target, &arg1, &arg2);
for (entry = local_bp_list; entry != NULL; entry = entry->next)
{
if (preventry)
- free (preventry);
+ xfree (preventry);
}
}
printf_filtered ("Connected to ARM RDI target.\n");
closed_already = 0;
- inferior_pid = 42;
+ inferior_ptid = pid_to_ptid (42);
}
-/* Start an inferior process and set inferior_pid to its pid.
+/* Start an inferior process and set inferior_ptid to its pid.
EXEC_FILE is the file to run.
ARGS is a string containing the arguments to the program.
ENV is the environment vector to pass. Errors reported with error().
strcat (arg_buf, " ");
strcat (arg_buf, args);
- inferior_pid = 42;
+ inferior_ptid = pid_to_ptid (42);
insert_breakpoints (); /* Needed to get correct instruction in cache */
if (env != NULL)
printf_filtered ("RDI_close: %s\n", rdi_error_message (rslt));
}
closed_already = 1;
- inferior_pid = 0;
+ inferior_ptid = null_ptid;
Adp_CloseDevice ();
generic_mourn_inferior ();
}
/* Tell the remote machine to resume. */
static void
-arm_rdi_resume (int pid, int step, enum target_signal siggnal)
+arm_rdi_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
int rslt;
PointHandle point;
STATUS just as `wait' would. Returns "pid" (though it's not clear
what, if anything, that means in the case of this target). */
-static int
-arm_rdi_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status)
{
status->kind = (execute_status == RDIError_NoError ?
TARGET_WAITKIND_EXITED : TARGET_WAITKIND_STOPPED);
/* convert stopped code from target into right signal */
status->value.sig = rdi_error_signal (execute_status);
- return inferior_pid;
+ return inferior_ptid;
}
/* Read the remote registers into the block REGS. */
/* Read or write LEN bytes from inferior memory at MEMADDR,
transferring to or from debugger address MYADDR. Write to inferior
if SHOULD_WRITE is nonzero. Returns length of data written or
- read; 0 for error. */
+ read; 0 for error. TARGET is unused. */
/* ARGSUSED */
static int
-arm_rdi_xfer_memory (memaddr, myaddr, len, should_write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int should_write;
- struct target_ops *target; /* ignored */
+arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int should_write,
+ struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+ struct target_ops *target ATTRIBUTE_UNUSED)
{
int rslt, i;
{
preventry->next = entry->next;
}
- free (entry);
+ xfree (entry);
}
return 0;
}
return TARGET_SIGNAL_UNKNOWN;
}
}
+
+static void
+arm_rdi_stop(void)
+{
+ angel_RDI_stop_request();
+}
+
\f
/* Define the target operations structure. */
arm_rdi_ops.to_detach = arm_rdi_detach;
arm_rdi_ops.to_resume = arm_rdi_resume;
arm_rdi_ops.to_wait = arm_rdi_wait;
+ arm_rdi_ops.to_stop = arm_rdi_stop;
arm_rdi_ops.to_fetch_registers = arm_rdi_fetch_registers;
arm_rdi_ops.to_store_registers = arm_rdi_store_registers;
arm_rdi_ops.to_prepare_to_store = arm_rdi_prepare_to_store;
}
if (log_filename)
- free (log_filename);
+ xfree (log_filename);
log_filename = xstrdup (arg);
void
_initialize_remote_rdi (void)
{
+ struct cmd_list_element *c;
+
init_rdi_ops ();
add_target (&arm_rdi_ops);
Adp_SetLogfile (log_filename);
Adp_SetLogEnable (log_enable);
- add_cmd ("rdilogfile", class_maintenance,
- rdilogfile_command,
- "Set filename for ADP packet log.\n\
+ c = add_cmd ("rdilogfile", class_maintenance,
+ rdilogfile_command,
+ "Set filename for ADP packet log.\n\
This file is used to log Angel Debugger Protocol packets.\n\
With a single argument, sets the logfile name to that value.\n\
Without an argument, shows the current logfile name.\n\
See also: rdilogenable\n",
&maintenancelist);
+ c->completer = filename_completer;
add_cmd ("rdilogenable", class_maintenance,
rdilogenable_command,