/* Remote debugging interface for Hitachi E7000 ICE, for GDB
- Copyright 1993, 1994, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain for Cygnus Support.
#include "gdbarch.h"
#include "inferior.h"
#include "target.h"
-#include "gdb_wait.h"
#include "value.h"
#include "command.h"
-#include <signal.h>
#include "gdb_string.h"
#include "gdbcmd.h"
#include <sys/types.h>
#include "serial.h"
#include "remote-utils.h"
#include "symfile.h"
+#include "regcache.h"
#include <time.h>
#include <ctype.h>
#define SR_REGNUM -1
#endif
-extern void notice_quit (void);
-
extern void report_transfer_performance (unsigned long, time_t, time_t);
extern char *sh_processor_type;
while (1)
{
c = readchar (timeout);
-#if 0
- notice_quit ();
- if (quit_flag == 1)
- {
- if (ctrl_c)
- {
- putchar_e7000 (CTRLC);
- --ctrl_c;
- }
- else
- {
- quit ();
- }
- }
-#endif
if (echo)
{
or \t\ttarget e7000 pc\n");
}
-#if !defined(__GO32__) && !defined(_WIN32)
+#if !defined(__GO32__) && !defined(_WIN32) && !defined(__CYGWIN__)
/* FIXME! test for ':' is ambiguous */
if (n == 1 && strchr (dev_name, ':') == 0)
{
int try;
int quit_trying;
- immediate_quit = 1; /* Allow user to interrupt it */
+ immediate_quit++; /* Allow user to interrupt it */
/* Hello? Are you there? */
sync = 0;
if (!sync)
{
fprintf_unfiltered (gdb_stderr, "Giving up after %d tries...\n", try);
- error ("Unable to syncronize with target.\n");
+ error ("Unable to synchronize with target.\n");
}
puts_e7000debug ("\r");
puts_e7000debug ("b -\r"); /* Clear breakpoints */
expect_prompt ();
- immediate_quit = 0;
+ immediate_quit--;
/* This is really the job of start_remote however, that makes an assumption
that the target is about to print out a status message of some sort. That
if (!e7000_desc)
perror_with_name (dev_name);
- SERIAL_SETBAUDRATE (e7000_desc, baudrate);
+ if (SERIAL_SETBAUDRATE (e7000_desc, baudrate))
+ {
+ SERIAL_CLOSE (dev_name);
+ perror_with_name (dev_name);
+ }
SERIAL_RAW (e7000_desc);
#ifdef GDB_TARGET_IS_H8300
when you want to detach and do something else with your gdb. */
static void
-e7000_detach (int from_tty)
+e7000_detach (char *arg, int from_tty)
{
pop_target (); /* calls e7000_close to do the real work */
if (from_tty)
/* Tell the remote machine to resume. */
static void
-e7000_resume (int pid, int step, int sig)
+e7000_resume (ptid_t ptid, int step, enum target_signal sigal)
{
if (step)
puts_e7000debug ("S\r");
}
void
-fetch_regs_from_dump (nextchar, want)
- int (*nextchar) ();
- char *want;
+fetch_regs_from_dump (int (*nextchar) (), char *want)
{
int regno;
char buf[MAX_REGISTER_RAW_SIZE];
}
else
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
store_signed_integer (buf,
REGISTER_RAW_SIZE (regno),
}
static void
-e7000_files_info (void)
+e7000_files_info (struct target_ops *ops)
{
printf_unfiltered ("\tAttached to %s at %d baud.\n", dev_name, baudrate);
}
#endif
+/* 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
-e7000_xfer_inferior_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
+e7000_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr,
+ int len, int write,
+ struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+ struct target_ops *target ATTRIBUTE_UNUSED)
{
if (write)
return e7000_write_inferior_memory (memaddr, myaddr, len);
}
static void
-e7000_kill (char *args, int from_tty)
+e7000_kill (void)
{
}
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
- inferior_pid = 0; /* No process now */
+ inferior_ptid = null_ptid; /* No process now */
/* This is necessary because many things were based on the PC at the time that
we attached to the monitor, which is no longer valid now that we have loaded
{0};
static int
-e7000_insert_breakpoint (CORE_ADDR addr, unsigned char *shadow)
+e7000_insert_breakpoint (CORE_ADDR addr, char *shadow)
{
int i;
char buf[200];
}
static int
-e7000_remove_breakpoint (CORE_ADDR addr, unsigned char *shadow)
+e7000_remove_breakpoint (CORE_ADDR addr, char *shadow)
{
int i;
char buf[200];
/* Wait until the remote machine stops, then return, storing status in
STATUS just as `wait' would. */
-static int
-e7000_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+e7000_wait (ptid_t ptid, struct target_waitstatus *status)
{
int stop_reason;
int regno;
break;
default:
/* Get the user's attention - this should never happen. */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
- return 0;
+ return inferior_ptid;
}
/* Stop the running program. */
e7000_ops.to_thread_alive = 0;
e7000_ops.to_stop = e7000_stop;
e7000_ops.to_pid_to_exec_file = NULL;
- e7000_ops.to_core_file_to_sym_file = NULL;
e7000_ops.to_stratum = process_stratum;
e7000_ops.DONT_USE = 0;
e7000_ops.to_has_all_memory = 1;