summaryrefslogtreecommitdiff
path: root/gdb/remote-e7000.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote-e7000.c')
-rw-r--r--gdb/remote-e7000.c406
1 files changed, 188 insertions, 218 deletions
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index 6de03150083..6022c4d065e 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -1,5 +1,5 @@
/* Remote debugging interface for Hitachi E7000 ICE, for GDB
- Copyright 1993, 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain for Cygnus Support.
@@ -61,6 +61,31 @@
#define ACK 0x06
#define CTRLZ 0x1a
+/* This file is used by 2 different targets, sh-elf and h8300. The
+ h8300 is not multiarched and doesn't use the registers defined in
+ tm-sh.h. To avoid using a macro GDB_TARGET_IS_SH, we do runtime check
+ of the target, which requires that these namse below are always
+ defined also in the h8300 case. */
+
+#if !defined (PR_REGNUM)
+#define PR_REGNUM -1
+#endif
+#if !defined (GBR_REGNUM)
+#define GBR_REGNUM -1
+#endif
+#if !defined (VBR_REGNUM)
+#define VBR_REGNUM -1
+#endif
+#if !defined (MACH_REGNUM)
+#define MACH_REGNUM -1
+#endif
+#if !defined (MACL_REGNUM)
+#define MACL_REGNUM -1
+#endif
+#if !defined (SR_REGNUM)
+#define SR_REGNUM -1
+#endif
+
extern void notice_quit (void);
extern void report_transfer_performance (unsigned long, time_t, time_t);
@@ -123,8 +148,7 @@ static int timeout = 20;
/* Send data to e7000debug. */
static void
-puts_e7000debug (buf)
- char *buf;
+puts_e7000debug (char *buf)
{
if (!e7000_desc)
error ("Use \"target e7000 ...\" first.");
@@ -143,8 +167,7 @@ puts_e7000debug (buf)
}
static void
-putchar_e7000 (x)
- int x;
+putchar_e7000 (int x)
{
char b[1];
@@ -153,15 +176,13 @@ putchar_e7000 (x)
}
static void
-write_e7000 (s)
- char *s;
+write_e7000 (char *s)
{
SERIAL_WRITE (e7000_desc, s, strlen (s));
}
static int
-normal (x)
- int x;
+normal (int x)
{
if (x == '\n')
return '\r';
@@ -173,8 +194,7 @@ normal (x)
returns -1, else returns next char. Discards chars > 127. */
static int
-readchar (timeout)
- int timeout;
+readchar (int timeout)
{
int c;
@@ -205,7 +225,7 @@ readchar (timeout)
#if 0
char *
-tl (x)
+tl (int x)
{
static char b[8][10];
static int p;
@@ -231,8 +251,7 @@ tl (x)
out. Let the user break out immediately. */
static void
-expect (string)
- char *string;
+expect (char *string)
{
char *p = string;
int c;
@@ -302,20 +321,19 @@ expect (string)
into states from which we can't recover. */
static void
-expect_prompt ()
+expect_prompt (void)
{
expect (":");
}
static void
-expect_full_prompt ()
+expect_full_prompt (void)
{
expect ("\r:");
}
static int
-convert_hex_digit (ch)
- int ch;
+convert_hex_digit (int ch)
{
if (ch >= '0' && ch <= '9')
return ch - '0';
@@ -327,8 +345,7 @@ convert_hex_digit (ch)
}
static int
-get_hex (start)
- int *start;
+get_hex (int *start)
{
int value = convert_hex_digit (*start);
int try;
@@ -348,9 +365,7 @@ get_hex (start)
them in registers starting at REGNO. */
static void
-get_hex_regs (n, regno)
- int n;
- int regno;
+get_hex_regs (int n, int regno)
{
long val;
int i;
@@ -371,10 +386,7 @@ get_hex_regs (n, regno)
user types "run" after having attached. */
static void
-e7000_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
+e7000_create_inferior (char *execfile, char *args, char **env)
{
int entry_pt;
@@ -423,8 +435,7 @@ static char *dir = "";
/* Grab the next token and buy some space for it */
static char *
-next (ptr)
- char **ptr;
+next (char **ptr)
{
char *p = *ptr;
char *s;
@@ -447,9 +458,7 @@ next (ptr)
}
static void
-e7000_login_command (args, from_tty)
- char *args;
- int from_tty;
+e7000_login_command (char *args, int from_tty)
{
if (args)
{
@@ -471,9 +480,7 @@ e7000_login_command (args, from_tty)
/* Start an ftp transfer from the E7000 to a host */
static void
-e7000_ftp_command (args, from_tty)
- char *args;
- int from_tty;
+e7000_ftp_command (char *args, int from_tty)
{
/* FIXME: arbitrary limit on machine names and such. */
char buf[200];
@@ -503,10 +510,7 @@ e7000_ftp_command (args, from_tty)
}
static int
-e7000_parse_device (args, dev_name, baudrate)
- char *args;
- char *dev_name;
- int baudrate;
+e7000_parse_device (char *args, char *dev_name, int baudrate)
{
char junk[128];
int n = 0;
@@ -558,8 +562,7 @@ or \t\ttarget e7000 pc\n");
/* Stub for catch_errors. */
static int
-e7000_start_remote (dummy)
- char *dummy;
+e7000_start_remote (char *dummy)
{
int loop;
int sync;
@@ -649,9 +652,7 @@ e7000_start_remote (dummy)
}
static void
-e7000_open (args, from_tty)
- char *args;
- int from_tty;
+e7000_open (char *args, int from_tty)
{
int n;
@@ -686,8 +687,7 @@ e7000_open (args, from_tty)
/* Close out all files and local state before this target loses control. */
static void
-e7000_close (quitting)
- int quitting;
+e7000_close (int quitting)
{
if (e7000_desc)
{
@@ -700,8 +700,7 @@ e7000_close (quitting)
when you want to detach and do something else with your gdb. */
static void
-e7000_detach (from_tty)
- int from_tty;
+e7000_detach (int from_tty)
{
pop_target (); /* calls e7000_close to do the real work */
if (from_tty)
@@ -711,8 +710,7 @@ e7000_detach (from_tty)
/* Tell the remote machine to resume. */
static void
-e7000_resume (pid, step, sig)
- int pid, step, sig;
+e7000_resume (int pid, int step, int sig)
{
if (step)
puts_e7000debug ("S\r");
@@ -732,8 +730,6 @@ e7000_resume (pid, step, sig)
BREAK POINT
*/
-#ifdef GDB_TARGET_IS_H8300
-
char *want_h8300h = "PC=%p CCR=%c\n\
ER0 - ER3 %0 %1 %2 %3\n\
ER4 - ER7 %4 %5 %6 %7\n";
@@ -751,17 +747,13 @@ char *want_nopc_h8300s = "%p CCR=%c EXR=%9\n\
ER0 - ER3 %0 %1 %2 %3\n\
ER4 - ER7 %4 %5 %6 %7";
-#endif
-
-#ifdef GDB_TARGET_IS_SH
-
-char *want = "PC=%16 SR=%22\n\
+char *want_sh = "PC=%16 SR=%22\n\
PR=%17 GBR=%18 VBR=%19\n\
MACH=%20 MACL=%21\n\
R0-7 %0 %1 %2 %3 %4 %5 %6 %7\n\
R8-15 %8 %9 %10 %11 %12 %13 %14 %15\n";
-char *want_nopc = "%16 SR=%22\n\
+char *want_nopc_sh = "%16 SR=%22\n\
PR=%17 GBR=%18 VBR=%19\n\
MACH=%20 MACL=%21\n\
R0-7 %0 %1 %2 %3 %4 %5 %6 %7\n\
@@ -777,7 +769,7 @@ R4_BANK0-R7_BANK0 %29 %30 %31 %32\n\
R0_BANK1-R3_BANK1 %33 %34 %35 %36\n\
R4_BANK1-R7_BANK1 %37 %38 %39 %40";
-char *want_sh3_nopc = "%16 SR=%22\n\
+char *want_nopc_sh3 = "%16 SR=%22\n\
PR=%17 GBR=%18 VBR=%19\n\
MACH=%20 MACL=%21 SSR=%22 SPC=%23\n\
R0-7 %0 %1 %2 %3 %4 %5 %6 %7\n\
@@ -787,16 +779,14 @@ char *want_sh3_nopc = "%16 SR=%22\n\
R0_BANK1-R3_BANK1 %33 %34 %35 %36\n\
R4_BANK1-R7_BANK1 %37 %38 %39 %40";
-#endif
-
static int
-gch ()
+gch (void)
{
return readchar (timeout);
}
static unsigned int
-gbyte ()
+gbyte (void)
{
int high = convert_hex_digit (gch ());
int low = convert_hex_digit (gch ());
@@ -913,29 +903,34 @@ fetch_regs_from_dump (nextchar, want)
}
static void
-e7000_fetch_registers ()
+e7000_fetch_registers (void)
{
int regno;
char *wanted;
puts_e7000debug ("R\r");
-#ifdef GDB_TARGET_IS_SH
- wanted = want;
if (TARGET_ARCHITECTURE->arch == bfd_arch_sh)
- switch (TARGET_ARCHITECTURE->mach)
- {
- case bfd_mach_sh3:
- case bfd_mach_sh3e:
- case bfd_mach_sh4:
- wanted = want_sh3;
- }
-#else
- if (h8300smode)
- wanted = want_h8300s;
- else
- wanted = want_h8300h;
+ {
+ wanted = want_sh;
+ switch (TARGET_ARCHITECTURE->mach)
+ {
+ case bfd_mach_sh3:
+ case bfd_mach_sh3e:
+ case bfd_mach_sh4:
+ wanted = want_sh3;
+ }
+ }
+#ifdef GDB_TARGET_IS_H8300
+ if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
+ {
+ if (h8300smode)
+ wanted = want_h8300s;
+ else
+ wanted = want_h8300h;
+ }
#endif
+
fetch_regs_from_dump (gch, wanted);
/* And supply the extra ones the simulator uses */
@@ -951,8 +946,7 @@ e7000_fetch_registers ()
errno value. */
static void
-e7000_fetch_register (regno)
- int regno;
+e7000_fetch_register (int regno)
{
e7000_fetch_registers ();
}
@@ -960,7 +954,7 @@ e7000_fetch_register (regno)
/* Store the remote registers from the contents of the block REGS. */
static void
-e7000_store_registers ()
+e7000_store_registers (void)
{
int regno;
@@ -973,8 +967,7 @@ e7000_store_registers ()
/* Store register REGNO, or all if REGNO == 0. Return errno value. */
static void
-e7000_store_register (regno)
- int regno;
+e7000_store_register (int regno)
{
char buf[200];
@@ -984,70 +977,77 @@ e7000_store_register (regno)
return;
}
-#ifdef GDB_TARGET_IS_H8300
- if (regno <= 7)
+ if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
{
- sprintf (buf, ".ER%d %x\r", regno, read_register (regno));
- puts_e7000debug (buf);
- }
- else if (regno == PC_REGNUM)
- {
- sprintf (buf, ".PC %x\r", read_register (regno));
- puts_e7000debug (buf);
- }
- else if (regno == CCR_REGNUM)
- {
- sprintf (buf, ".CCR %x\r", read_register (regno));
- puts_e7000debug (buf);
+ if (regno <= 7)
+ {
+ sprintf (buf, ".ER%d %lx\r", regno, read_register (regno));
+ puts_e7000debug (buf);
+ }
+ else if (regno == PC_REGNUM)
+ {
+ sprintf (buf, ".PC %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
+#ifdef CCR_REGNUM
+ else if (regno == CCR_REGNUM)
+ {
+ sprintf (buf, ".CCR %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
+#endif
}
-#endif /* GDB_TARGET_IS_H8300 */
-#ifdef GDB_TARGET_IS_SH
- switch (regno)
+ else if (TARGET_ARCHITECTURE->arch == bfd_arch_sh)
{
- default:
- sprintf (buf, ".R%d %x\r", regno, read_register (regno));
- puts_e7000debug (buf);
- break;
-
- case PC_REGNUM:
- sprintf (buf, ".PC %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ if (regno == PC_REGNUM)
+ {
+ sprintf (buf, ".PC %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case SR_REGNUM:
- sprintf (buf, ".SR %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == SR_REGNUM)
+ {
+ sprintf (buf, ".SR %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case PR_REGNUM:
- sprintf (buf, ".PR %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == PR_REGNUM)
+ {
+ sprintf (buf, ".PR %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case GBR_REGNUM:
- sprintf (buf, ".GBR %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == GBR_REGNUM)
+ {
+ sprintf (buf, ".GBR %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case VBR_REGNUM:
- sprintf (buf, ".VBR %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == VBR_REGNUM)
+ {
+ sprintf (buf, ".VBR %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case MACH_REGNUM:
- sprintf (buf, ".MACH %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == MACH_REGNUM)
+ {
+ sprintf (buf, ".MACH %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
- case MACL_REGNUM:
- sprintf (buf, ".MACL %x\r", read_register (regno));
- puts_e7000debug (buf);
- break;
+ else if (regno == MACL_REGNUM)
+ {
+ sprintf (buf, ".MACL %lx\r", read_register (regno));
+ puts_e7000debug (buf);
+ }
+ else
+ {
+ sprintf (buf, ".R%d %lx\r", regno, read_register (regno));
+ puts_e7000debug (buf);
+ }
}
-#endif /* GDB_TARGET_IS_SH */
-
expect_prompt ();
}
@@ -1058,21 +1058,19 @@ e7000_store_register (regno)
debugged. */
static void
-e7000_prepare_to_store ()
+e7000_prepare_to_store (void)
{
/* Do nothing, since we can store individual regs */
}
static void
-e7000_files_info ()
+e7000_files_info (void)
{
printf_unfiltered ("\tAttached to %s at %d baud.\n", dev_name, baudrate);
}
static int
-stickbyte (where, what)
- char *where;
- unsigned int what;
+stickbyte (char *where, unsigned int what)
{
static CONST char digs[] = "0123456789ABCDEF";
@@ -1085,10 +1083,7 @@ stickbyte (where, what)
/* Write a small ammount of memory. */
static int
-write_small (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
+write_small (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
int i;
char buf[200];
@@ -1098,7 +1093,7 @@ write_small (memaddr, myaddr, len)
if (((memaddr + i) & 3) == 0 && (i + 3 < len))
{
/* Can be done with a long word */
- sprintf (buf, "m %x %x%02x%02x%02x;l\r",
+ sprintf (buf, "m %lx %x%02x%02x%02x;l\r",
memaddr + i,
myaddr[i], myaddr[i + 1], myaddr[i + 2], myaddr[i + 3]);
puts_e7000debug (buf);
@@ -1106,7 +1101,7 @@ write_small (memaddr, myaddr, len)
}
else
{
- sprintf (buf, "m %x %x\r", memaddr + i, myaddr[i]);
+ sprintf (buf, "m %lx %x\r", memaddr + i, myaddr[i]);
puts_e7000debug (buf);
}
}
@@ -1132,10 +1127,7 @@ write_small (memaddr, myaddr, len)
*/
static int
-write_large (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
+write_large (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
int i;
#define maxstride 128
@@ -1229,10 +1221,7 @@ write_large (memaddr, myaddr, len)
then. */
static int
-e7000_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
+e7000_write_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
if (len < 16 || using_tcp || using_pc)
return write_small (memaddr, myaddr, len);
@@ -1250,10 +1239,7 @@ e7000_write_inferior_memory (memaddr, myaddr, len)
*/
static int
-e7000_read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
+e7000_read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
int count;
int c;
@@ -1268,7 +1254,7 @@ e7000_read_inferior_memory (memaddr, myaddr, len)
return 0;
}
- sprintf (buf, "m %x;l\r", memaddr);
+ sprintf (buf, "m %lx;l\r", memaddr);
puts_e7000debug (buf);
for (count = 0; count < len; count += 4)
@@ -1332,10 +1318,8 @@ e7000_read_inferior_memory (memaddr, myaddr, len)
*/
static int
-e7000_read_inferior_memory_large (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
+e7000_read_inferior_memory_large (CORE_ADDR memaddr, unsigned char *myaddr,
+ int len)
{
int count;
int c;
@@ -1349,7 +1333,7 @@ e7000_read_inferior_memory_large (memaddr, myaddr, len)
return 0;
}
- sprintf (buf, "d %x %x\r", memaddr, memaddr + len - 1);
+ sprintf (buf, "d %lx %lx\r", memaddr, memaddr + len - 1);
puts_e7000debug (buf);
count = 0;
@@ -1397,10 +1381,8 @@ e7000_read_inferior_memory_large (memaddr, myaddr, len)
#if 0
static int
-fast_but_for_the_pause_e7000_read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+fast_but_for_the_pause_e7000_read_inferior_memory (CORE_ADDR memaddr,
+ char *myaddr, int len)
{
int loop;
int c;
@@ -1503,16 +1485,12 @@ e7000_xfer_inferior_memory (memaddr, myaddr, len, write, target)
}
static void
-e7000_kill (args, from_tty)
- char *args;
- int from_tty;
+e7000_kill (char *args, int from_tty)
{
}
static void
-e7000_load (args, from_tty)
- char *args;
- int from_tty;
+e7000_load (char *args, int from_tty)
{
struct cleanup *old_chain;
asection *section;
@@ -1603,7 +1581,7 @@ e7000_load (args, from_tty)
section_size = bfd_get_section_size_before_reloc (section);
if (!quiet)
- printf_filtered ("[Loading section %s at 0x%x (%d bytes)]\n",
+ printf_filtered ("[Loading section %s at 0x%x (%ud bytes)]\n",
bfd_get_section_name (pbfd, section),
section_address,
section_size);
@@ -1698,7 +1676,7 @@ e7000_load (args, from_tty)
instructions. */
static void
-e7000_mourn_inferior ()
+e7000_mourn_inferior (void)
{
remove_breakpoints ();
unpush_target (&e7000_ops);
@@ -1718,9 +1696,7 @@ static CORE_ADDR breakaddr[MAX_BREAKPOINTS] =
{0};
static int
-e7000_insert_breakpoint (addr, shadow)
- CORE_ADDR addr;
- unsigned char *shadow;
+e7000_insert_breakpoint (CORE_ADDR addr, unsigned char *shadow)
{
int i;
char buf[200];
@@ -1736,12 +1712,12 @@ e7000_insert_breakpoint (addr, shadow)
#ifdef HARD_BREAKPOINTS
if (BC_BREAKPOINTS)
{
- sprintf (buf, "BC%d A=%x\r", i + 1, addr);
+ sprintf (buf, "BC%d A=%lx\r", i + 1, addr);
puts_e7000debug (buf);
}
else
{
- sprintf (buf, "B %x\r", addr);
+ sprintf (buf, "B %lx\r", addr);
puts_e7000debug (buf);
}
#else
@@ -1763,9 +1739,7 @@ e7000_insert_breakpoint (addr, shadow)
}
static int
-e7000_remove_breakpoint (addr, shadow)
- CORE_ADDR addr;
- unsigned char *shadow;
+e7000_remove_breakpoint (CORE_ADDR addr, unsigned char *shadow)
{
int i;
char buf[200];
@@ -1782,12 +1756,12 @@ e7000_remove_breakpoint (addr, shadow)
}
else
{
- sprintf (buf, "B - %x\r", addr);
+ sprintf (buf, "B - %lx\r", addr);
puts_e7000debug (buf);
}
expect_prompt ();
#else
- sprintf (buf, "B - %x\r", addr);
+ sprintf (buf, "B - %lx\r", addr);
puts_e7000debug (buf);
expect_prompt ();
@@ -1800,7 +1774,7 @@ e7000_remove_breakpoint (addr, shadow)
return 0;
}
- warning ("Can't find breakpoint associated with 0x%x\n", addr);
+ warning ("Can't find breakpoint associated with 0x%lx\n", addr);
return 1;
}
@@ -1808,9 +1782,7 @@ e7000_remove_breakpoint (addr, shadow)
is placed on the users terminal until the prompt is seen. */
static void
-e7000_command (args, fromtty)
- char *args;
- int fromtty;
+e7000_command (char *args, int fromtty)
{
/* FIXME: arbitrary limit on length of args. */
char buf[200];
@@ -1842,10 +1814,7 @@ e7000_command (args, fromtty)
static void
-e7000_drain_command (args, fromtty)
- char *args;
- int fromtty;
-
+e7000_drain_command (char *args, int fromtty)
{
int c;
@@ -1869,7 +1838,7 @@ e7000_drain_command (args, fromtty)
#define NITEMS 7
static int
-why_stop ()
+why_stop (void)
{
static char *strings[NITEMS] =
{
@@ -1914,8 +1883,7 @@ why_stop ()
otherwise echo them. */
int
-expect_n (strings)
- char **strings;
+expect_n (char **strings)
{
char *(ptr[10]);
int n;
@@ -1999,7 +1967,7 @@ expect_n (strings)
pc, and the simulators never do. */
static void
-sub2_from_pc ()
+sub2_from_pc (void)
{
char buf[4];
char buf2[200];
@@ -2008,7 +1976,7 @@ sub2_from_pc ()
REGISTER_RAW_SIZE (PC_REGNUM),
read_register (PC_REGNUM) - 2);
supply_register (PC_REGNUM, buf);
- sprintf (buf2, ".PC %x\r", read_register (PC_REGNUM));
+ sprintf (buf2, ".PC %lx\r", read_register (PC_REGNUM));
puts_e7000debug (buf2);
}
@@ -2030,9 +1998,7 @@ static char *estrings[] =
STATUS just as `wait' would. */
static int
-e7000_wait (pid, status)
- int pid;
- struct target_waitstatus *status;
+e7000_wait (int pid, struct target_waitstatus *status)
{
int stop_reason;
int regno;
@@ -2078,21 +2044,25 @@ e7000_wait (pid, status)
/* Skip till the PC= */
expect ("=");
-#ifdef GDB_TARGET_IS_SH
- wanted_nopc = want_nopc;
if (TARGET_ARCHITECTURE->arch == bfd_arch_sh)
- switch (TARGET_ARCHITECTURE->mach)
- {
- case bfd_mach_sh3:
- case bfd_mach_sh3e:
- case bfd_mach_sh4:
- wanted_nopc = want_sh3_nopc;
- }
-#else
- if (h8300smode)
- wanted_nopc = want_nopc_h8300s;
- else
- wanted_nopc = want_nopc_h8300h;
+ {
+ wanted_nopc = want_nopc_sh;
+ switch (TARGET_ARCHITECTURE->mach)
+ {
+ case bfd_mach_sh3:
+ case bfd_mach_sh3e:
+ case bfd_mach_sh4:
+ wanted_nopc = want_nopc_sh3;
+ }
+ }
+#ifdef GDB_TARGET_IS_H8300
+ if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
+ {
+ if (h8300smode)
+ wanted_nopc = want_nopc_h8300s;
+ else
+ wanted_nopc = want_nopc_h8300h;
+ }
#endif
fetch_regs_from_dump (gch, wanted_nopc);
@@ -2156,7 +2126,7 @@ e7000_wait (pid, status)
/* Stop the running program. */
static void
-e7000_stop ()
+e7000_stop (void)
{
/* Sending a ^C is supposed to stop the running program. */
putchar_e7000 (CTRLC);
@@ -2241,7 +2211,7 @@ target e7000 foobar";
};
void
-_initialize_remote_e7000 ()
+_initialize_remote_e7000 (void)
{
init_e7000_ops ();
add_target (&e7000_ops);