#include "bfd.h"
#include "symfile.h"
#include "target.h"
-#include "wait.h"
+#include "gdb_wait.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
#include "gdbthread.h"
#include "gdbcore.h"
+#include "breakpoint.h"
#ifdef USG
#include <sys/types.h>
static int execute_status;
/* Send heatbeat packets? */
-static int rdi_heartbeat = 0;
+static int rdi_heartbeat = 0;
/* Target has ROM at address 0. */
static int rom_at_zero = 0;
/* Enable logging? */
-static int log_enable = 0;
+static int log_enable = 0;
/* Name of the log file. Default is "rdi.log". */
static char *log_filename;
/* split name after whitespace, pass tail as arg to open command */
- devName = strdup(name);
- p = strchr(devName,' ');
+ devName = xstrdup (name);
+ p = strchr (devName, ' ');
if (p)
{
*p = '\0';
/* Make the basic low-level connection. */
- Adp_CloseDevice ();
+ arm_rdi_close (0);
rslt = Adp_OpenDevice (devName, openArgs, rdi_heartbeat);
if (rslt != adp_ok)
{
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
Adp_CloseDevice ();
- error("RID_open failed\n");
+ error ("RID_open failed\n");
}
rslt = angel_RDI_info (RDIInfo_Target, &arg1, &arg2);
static void
arm_rdi_mourn_inferior ()
{
+ /* We remove the inserted breakpoints in case the user wants to
+ issue another target and load commands to rerun his application;
+ This is something that wouldn't work on a native target, for instance,
+ as the process goes away when the inferior exits, but it works with
+ some remote targets like this one. That is why this is done here. */
+ remove_breakpoints();
unpush_target (&arm_rdi_ops);
generic_mourn_inferior ();
}
arm_rdi_ops.to_magic = OPS_MAGIC;
}
-static void rdilogfile_command (char *arg, int from_tty)
+static void
+rdilogfile_command (char *arg, int from_tty)
{
if (!arg || strlen (arg) == 0)
{
printf_filtered ("rdi log file is '%s'\n", log_filename);
return;
}
-
+
if (log_filename)
free (log_filename);
-
- log_filename = strdup (arg);
+
+ log_filename = xstrdup (arg);
Adp_SetLogfile (log_filename);
}
-static void rdilogenable_command (char *args, int from_tty)
+static void
+rdilogenable_command (char *args, int from_tty)
{
if (!args || strlen (args) == 0)
{
printf_filtered ("rdi log is %s\n", log_enable ? "enabled" : "disabled");
return;
}
-
- if (!strcasecmp (args,"1") ||
- !strcasecmp (args,"y") ||
- !strcasecmp (args,"yes") ||
- !strcasecmp (args,"on") ||
- !strcasecmp (args,"t") ||
- !strcasecmp (args,"true"))
- Adp_SetLogEnable (log_enable=1);
- else if (!strcasecmp (args,"0") ||
- !strcasecmp (args,"n") ||
- !strcasecmp (args,"no") ||
- !strcasecmp (args,"off") ||
- !strcasecmp (args,"f") ||
- !strcasecmp (args,"false"))
- Adp_SetLogEnable (log_enable=0);
+
+ if (!strcasecmp (args, "1") ||
+ !strcasecmp (args, "y") ||
+ !strcasecmp (args, "yes") ||
+ !strcasecmp (args, "on") ||
+ !strcasecmp (args, "t") ||
+ !strcasecmp (args, "true"))
+ Adp_SetLogEnable (log_enable = 1);
+ else if (!strcasecmp (args, "0") ||
+ !strcasecmp (args, "n") ||
+ !strcasecmp (args, "no") ||
+ !strcasecmp (args, "off") ||
+ !strcasecmp (args, "f") ||
+ !strcasecmp (args, "false"))
+ Adp_SetLogEnable (log_enable = 0);
else
printf_filtered ("rdilogenable: unrecognized argument '%s'\n"
- " try y or n\n",args);
+ " try y or n\n", args);
}
void
init_rdi_ops ();
add_target (&arm_rdi_ops);
- log_filename = strdup("rdi.log");
- Adp_SetLogfile(log_filename);
- Adp_SetLogEnable(log_enable);
+ log_filename = xstrdup ("rdi.log");
+ Adp_SetLogfile (log_filename);
+ Adp_SetLogEnable (log_enable);
add_cmd ("rdilogfile", class_maintenance,
rdilogfile_command,
See also: rdilogenable\n",
&maintenancelist);
- add_cmd("rdilogenable", class_maintenance,
+ add_cmd ("rdilogenable", class_maintenance,
rdilogenable_command,
"Set enable logging of ADP packets.\n\
This will log ADP packets exchanged between gdb and the\n\
A true value disables vector catching, false enables vector catching.\n\
This is evaluated at the time the 'target rdi' command is executed\n",
&setlist),
- &showlist);
+ &showlist);
add_show_from_set
(add_set_cmd ("rdiheartbeat", no_class,
it will confuse ARM and EPI JTAG interface boxes as well\n\
as the Angel Monitor.\n",
&setlist),
- &showlist);
+ &showlist);
}
/* A little dummy to make linking with the library succeed. */