/* gdb-if.c -- sim interface to GDB.
-Copyright (C) 2011-2013 Free Software Foundation, Inc.
+Copyright (C) 2011-2014 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
static int open;
-static unsigned char hw_breakpoints[MEM_SIZE/8];
-
static struct host_callback_struct *host_callbacks;
/* Open an instance of the sim. For this sim, only one instance
/* Load a program. */
SIM_RC
-sim_load (SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty)
{
check_desc (sd);
val = get_le (buf, length);
if (regno == sim_rl78_pc_regnum)
- pc = val;
+ {
+ pc = val;
+
+ /* The rl78 program counter is 20 bits wide. Ensure that GDB
+ hasn't picked up any stray bits. This has occurred when performing
+ a GDB "return" command in which the return address is obtained
+ from a 32-bit container on the stack. */
+ assert ((pc & ~0x0fffff) == 0);
+ }
else
memory[reg_addr (regno)] = val;
return size;
break;
}
- if (hw_breakpoints[pc >> 3]
- && (hw_breakpoints[pc >> 3] & (1 << (pc & 0x7))))
- {
- reason = sim_stopped;
- siggnal = GDB_SIGNAL_TRAP;
- break;
- }
rc = setjmp (decode_jmp_buf);
if (rc == 0)
rc = decode_opcode ();
/* Stub for command completion. */
char **
-sim_complete_command (SIM_DESC sd, char *text, char *word)
+sim_complete_command (SIM_DESC sd, const char *text, const char *word)
{
return NULL;
}