/* gdb-if.c -- sim interface to GDB.
-Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 2008-2012 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include "config.h"
#include <stdio.h>
#include <assert.h>
#include <signal.h>
if (!abfd)
return SIM_RC_FAIL;
- rx_load (abfd);
+ rx_load (abfd, get_callbacks ());
build_swap_list (abfd);
return SIM_RC_OK;
if (abfd)
{
- rx_load (abfd);
+ rx_load (abfd, NULL);
build_swap_list (abfd);
}
check_desc (sd);
if (!check_regno (regno))
- return 0;
+ return -1;
size = reg_size (regno);
if (length != size)
- return 0;
+ return -1;
if (rx_big_endian)
val = get_be (buf, length);
default:
fprintf (stderr, "rx minisim: unrecognized register number: %d\n",
regno);
- return -1;
+ return 0;
}
return size;
void
sim_resume (SIM_DESC sd, int step, int sig_to_deliver)
{
+ int rc;
+
check_desc (sd);
if (sig_to_deliver != 0)
execution_error_clear_last_error ();
if (step)
- handle_step (decode_opcode ());
+ {
+ rc = setjmp (decode_jmp_buf);
+ if (rc == 0)
+ rc = decode_opcode ();
+ handle_step (rc);
+ }
else
{
/* We don't clear 'stop' here, because then we would miss
break;
}
- int rc = decode_opcode ();
+ rc = setjmp (decode_jmp_buf);
+ if (rc == 0)
+ rc = decode_opcode ();
if (execution_error_get_last_error () != SIM_ERR_NONE)
{
printf ("The 'sim' command expects either 'trace' or 'verbose'"
" as a subcommand.\n");
}
+
+char **
+sim_complete_command (SIM_DESC sd, char *text, char *word)
+{
+ return NULL;
+}