1999-04-16 01:35:26 +00:00
|
|
|
/* Generic remote debugging interface for simulators.
|
2002-01-19 03:32:43 +00:00
|
|
|
|
2007-01-09 17:59:20 +00:00
|
|
|
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
|
|
|
2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
2002-01-19 03:32:43 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
Contributed by Cygnus Support.
|
|
|
|
Steve Chamberlain (sac@cygnus.com).
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This file is part of GDB.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-12-17 22:34:03 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "value.h"
|
|
|
|
#include "gdb_string.h"
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include "terminal.h"
|
|
|
|
#include "target.h"
|
|
|
|
#include "gdbcore.h"
|
2002-06-09 15:45:54 +00:00
|
|
|
#include "gdb/callback.h"
|
|
|
|
#include "gdb/remote-sim.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
#include "command.h"
|
2001-03-01 01:39:22 +00:00
|
|
|
#include "regcache.h"
|
2002-05-29 01:51:17 +00:00
|
|
|
#include "gdb_assert.h"
|
|
|
|
#include "sim-regno.h"
|
2003-11-13 19:06:26 +00:00
|
|
|
#include "arch-utils.h"
|
2006-02-21 18:22:27 +00:00
|
|
|
#include "readline/readline.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* Prototypes */
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void _initialize_remote_sim (void);
|
1999-05-25 18:09:09 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void dump_mem (char *buf, int len);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void init_callbacks (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void end_callbacks (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static int gdb_os_write_stdout (host_callback *, const char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_flush_stdout (host_callback *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static int gdb_os_write_stderr (host_callback *, const char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_flush_stderr (host_callback *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static int gdb_os_poll_quit (host_callback *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* printf_filtered is depreciated */
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_printf_filtered (host_callback *, const char *, ...);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_vprintf_filtered (host_callback *, const char *, va_list);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_evprintf_filtered (host_callback *, const char *, va_list);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdb_os_error (host_callback *, const char *, ...);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_fetch_register (int regno);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_store_register (int regno);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_kill (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_load (char *prog, int fromtty);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_open (char *args, int from_tty);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_close (int quitting);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_detach (char *args, int from_tty);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
static void gdbsim_resume (ptid_t ptid, int step, enum target_signal siggnal);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
static ptid_t gdbsim_wait (ptid_t ptid, struct target_waitstatus *status);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_prepare_to_store (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_files_info (struct target_ops *target);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_mourn_inferior (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
static void gdbsim_stop (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
void simulator_command (char *args, int from_tty);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* Naming convention:
|
|
|
|
|
|
|
|
sim_* are the interface to the simulator (see remote-sim.h).
|
|
|
|
gdbsim_* are stuff which is internal to gdb. */
|
|
|
|
|
|
|
|
/* Forward data declarations */
|
|
|
|
extern struct target_ops gdbsim_ops;
|
|
|
|
|
|
|
|
static int program_loaded = 0;
|
|
|
|
|
|
|
|
/* We must keep track of whether the simulator has been opened or not because
|
|
|
|
GDB can call a target's close routine twice, but sim_close doesn't allow
|
|
|
|
this. We also need to record the result of sim_open so we can pass it
|
|
|
|
back to the other sim_foo routines. */
|
|
|
|
static SIM_DESC gdbsim_desc = 0;
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
dump_mem (char *buf, int len)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
if (len <= 8)
|
|
|
|
{
|
|
|
|
if (len == 8 || len == 4)
|
|
|
|
{
|
|
|
|
long l[2];
|
|
|
|
memcpy (l, buf, len);
|
1999-09-09 00:02:17 +00:00
|
|
|
printf_filtered ("\t0x%lx", l[0]);
|
2001-02-07 18:37:25 +00:00
|
|
|
if (len == 8)
|
|
|
|
printf_filtered (" 0x%lx", l[1]);
|
|
|
|
printf_filtered ("\n");
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
printf_filtered ("\t");
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
printf_filtered ("0x%x ", buf[i]);
|
|
|
|
printf_filtered ("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static host_callback gdb_callback;
|
|
|
|
static int callbacks_initialized = 0;
|
|
|
|
|
|
|
|
/* Initialize gdb_callback. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
init_callbacks (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
if (!callbacks_initialized)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
gdb_callback = default_callback;
|
|
|
|
gdb_callback.init (&gdb_callback);
|
|
|
|
gdb_callback.write_stdout = gdb_os_write_stdout;
|
|
|
|
gdb_callback.flush_stdout = gdb_os_flush_stdout;
|
|
|
|
gdb_callback.write_stderr = gdb_os_write_stderr;
|
|
|
|
gdb_callback.flush_stderr = gdb_os_flush_stderr;
|
|
|
|
gdb_callback.printf_filtered = gdb_os_printf_filtered;
|
|
|
|
gdb_callback.vprintf_filtered = gdb_os_vprintf_filtered;
|
|
|
|
gdb_callback.evprintf_filtered = gdb_os_evprintf_filtered;
|
|
|
|
gdb_callback.error = gdb_os_error;
|
|
|
|
gdb_callback.poll_quit = gdb_os_poll_quit;
|
|
|
|
gdb_callback.magic = HOST_CALLBACK_MAGIC;
|
|
|
|
callbacks_initialized = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Release callbacks (free resources used by them). */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
end_callbacks (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
if (callbacks_initialized)
|
|
|
|
{
|
|
|
|
gdb_callback.shutdown (&gdb_callback);
|
|
|
|
callbacks_initialized = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of os_write_stdout callback. */
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
static int
|
2000-07-30 01:48:28 +00:00
|
|
|
gdb_os_write_stdout (host_callback *p, const char *buf, int len)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char b[2];
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
ui_file_write (gdb_stdtarg, buf, len);
|
1999-04-16 01:35:26 +00:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of os_flush_stdout callback. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdb_os_flush_stdout (host_callback *p)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-11-17 02:31:06 +00:00
|
|
|
gdb_flush (gdb_stdtarg);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of os_write_stderr callback. */
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
static int
|
2000-07-30 01:48:28 +00:00
|
|
|
gdb_os_write_stderr (host_callback *p, const char *buf, int len)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char b[2];
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
for (i = 0; i < len; i++)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
b[0] = buf[i];
|
|
|
|
b[1] = 0;
|
2004-02-02 16:12:49 +00:00
|
|
|
fputs_unfiltered (b, gdb_stdtargerr);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of os_flush_stderr callback. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdb_os_flush_stderr (host_callback *p)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-02-02 16:12:49 +00:00
|
|
|
gdb_flush (gdb_stdtargerr);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of printf_filtered callback. */
|
|
|
|
|
|
|
|
static void
|
1999-07-07 20:19:36 +00:00
|
|
|
gdb_os_printf_filtered (host_callback * p, const char *format,...)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
|
|
|
|
vfprintf_filtered (gdb_stdout, format, args);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of error vprintf_filtered. */
|
|
|
|
|
|
|
|
static void
|
1999-07-07 20:19:36 +00:00
|
|
|
gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
vfprintf_filtered (gdb_stdout, format, ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of error evprintf_filtered. */
|
|
|
|
|
|
|
|
static void
|
1999-07-07 20:19:36 +00:00
|
|
|
gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
vfprintf_filtered (gdb_stderr, format, ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of error callback. */
|
|
|
|
|
|
|
|
static void
|
1999-07-07 20:19:36 +00:00
|
|
|
gdb_os_error (host_callback * p, const char *format,...)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
if (deprecated_error_hook)
|
|
|
|
(*deprecated_error_hook) ();
|
1999-07-07 20:19:36 +00:00
|
|
|
else
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
1999-11-17 02:31:06 +00:00
|
|
|
verror (format, args);
|
1999-04-16 01:35:26 +00:00
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-05-29 01:51:17 +00:00
|
|
|
int
|
|
|
|
one2one_register_sim_regno (int regnum)
|
|
|
|
{
|
|
|
|
/* Only makes sense to supply raw registers. */
|
|
|
|
gdb_assert (regnum >= 0 && regnum < NUM_REGS);
|
|
|
|
return regnum;
|
|
|
|
}
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_fetch_register (int regno)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
if (regno == -1)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
for (regno = 0; regno < NUM_REGS; regno++)
|
|
|
|
gdbsim_fetch_register (regno);
|
2002-05-29 01:51:17 +00:00
|
|
|
return;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2002-05-29 01:51:17 +00:00
|
|
|
|
|
|
|
switch (REGISTER_SIM_REGNO (regno))
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2002-05-29 01:51:17 +00:00
|
|
|
case LEGACY_SIM_REGNO_IGNORE:
|
|
|
|
break;
|
|
|
|
case SIM_REGNO_DOES_NOT_EXIST:
|
|
|
|
{
|
|
|
|
/* For moment treat a `does not exist' register the same way
|
|
|
|
as an ``unavailable'' register. */
|
2003-05-08 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
* gdbarch.h: Re-generate.
* defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
(legacy_max_register_raw_size): Delete declaration.
* regcache.c (legacy_max_register_raw_size): Delete function.
* valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
* target.c, stack.c, sparc-tdep.c, sh-tdep.c: Update.
* rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Update.
* remote-rdp.c, remote-array.c, regcache.c: Update.
* ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Update.
* mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Update.
* infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Update.
* findvar.c, dwarf2cfi.c: Update.
Index: tui/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* tuiRegs.c: Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
Index: mi/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
2003-05-08 20:52:49 +00:00
|
|
|
char buf[MAX_REGISTER_SIZE];
|
2002-05-29 01:51:17 +00:00
|
|
|
int nr_bytes;
|
2003-05-08 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
* gdbarch.h: Re-generate.
* defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
(legacy_max_register_raw_size): Delete declaration.
* regcache.c (legacy_max_register_raw_size): Delete function.
* valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
* target.c, stack.c, sparc-tdep.c, sh-tdep.c: Update.
* rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Update.
* remote-rdp.c, remote-array.c, regcache.c: Update.
* ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Update.
* mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Update.
* infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Update.
* findvar.c, dwarf2cfi.c: Update.
Index: tui/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* tuiRegs.c: Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
Index: mi/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
2003-05-08 20:52:49 +00:00
|
|
|
memset (buf, 0, MAX_REGISTER_SIZE);
|
2004-07-21 Andrew Cagney <cagney@gnu.org>
Use regcache_raw_supply instead of supply_register.
* regcache.h (supply_register): Delete declaration.
* regcache.c (supply_register): Delete function.
* wince.c (do_child_fetch_inferior_registers): Update.
* win32-nat.c (do_child_fetch_inferior_registers)
(fetch_elf_core_registers): Update.
* v850ice.c (v850ice_fetch_registers): Update.
* thread-db.c (thread_db_store_registers): Update.
* sol-thread.c (sol_thread_store_registers): Update.
* shnbsd-tdep.c (shnbsd_supply_reg): Update.
* rs6000-nat.c (fetch_register): Update.
* rom68k-rom.c (rom68k_supply_one_register): Update.
* remote.c (remote_wait, remote_async_wait): Update.
* remote-st.c (get_hex_regs): Update.
* remote-sim.c (gdbsim_fetch_register): Update.
* remote-sds.c (sds_fetch_registers): Update.
* remote-rdp.c (remote_rdp_fetch_register): Update.
* remote-rdi.c (arm_rdi_fetch_registers): Update.
* remote-mips.c (mips_wait, mips_fetch_registers): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-hms.c (init_hms_cmds): Update.
* remote-est.c (init_est_cmds): Update.
* remote-e7000.c (get_hex_regs, fetch_regs_from_dump)
(e7000_fetch_registers, sub2_from_pc, e7000_wait): Update.
* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_supply_fpreg): Update.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, supply_vrregset)
(fetch_spe_registers): Update.
* ppc-bdm.c (bdm_ppc_fetch_registers): Update.
* monitor.c (monitor_supply_register): Update.
* mipsv4-nat.c (supply_gregset, supply_fpregset): Update.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg)
(mipsnbsd_supply_fpreg): Update.
* mips-nat.c (fetch_inferior_registers)
(fetch_core_registers): Update.
* mips-linux-tdep.c (supply_32bit_reg, supply_gregset)
(supply_fpregset, mips64_supply_gregset)
(mips64_supply_fpregset): Update.
* m68klinux-nat.c (fetch_register, supply_gregset)
(supply_fpregset): Update.
* m68k-tdep.c (supply_gregset, supply_fpregset): Update.
* m32r-rom.c (init_m32r_cmds, init_mon2000_cmds): Update.
* lynx-nat.c (fetch_inferior_registers, fetch_core_registers): Update.
* irix5-nat.c (supply_gregset, supply_fpregset): Update.
* infptrace.c (fetch_register): Update.
* ia64-linux-nat.c (supply_gregset, supply_fpregset): Update.
* ia64-aix-nat.c (supply_gregset, supply_fpregset): Update.
* i386gnu-nat.c (fetch_fpregs, supply_gregset)
(gnu_fetch_registers, gnu_store_registers): Update.
* i386-nto-tdep.c (i386nto_supply_gregset): Update.
* i386-linux-nat.c (fetch_register, supply_gregset)
(dummy_sse_values): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* hppah-nat.c (fetch_register): Update.
* hppa-linux-nat.c (fetch_register, supply_gregset)
(supply_fpregset): Update.
* go32-nat.c (fetch_register): Update.
* dve3900-rom.c (fetch_bitmapped_register)
(_initialize_r3900_rom): Update.
* cris-tdep.c (supply_gregset): Update.
* abug-rom.c (init_abug_cmds): Update.
* core-aout.c (fetch_core_registers): Update.
* armnbsd-nat.c (supply_gregset, supply_fparegset)
(fetch_register, fetch_fp_register): Update.
* arm-linux-nat.c (fetch_nwfpe_single, fetch_nwfpe_none)
(fetch_nwfpe_extended, fetch_fpregister, fetch_fpregs)
(fetch_register, fetch_regs, supply_gregset, supply_fpregset): Update.
* alphanbsd-tdep.c (fetch_core_registers): Update.
* alpha-tdep.c (alpha_supply_int_regs, alpha_supply_fp_regs): Update.
* alpha-nat.c (fetch_osf_core_registers)
(fetch_osf_core_registers, fetch_osf_core_registers): Update.
* aix-thread.c (supply_gprs64, supply_reg32, supply_fprs)
(supply_sprs64, supply_sprs32, fetch_regs_kernel_thread): Update.
2004-07-22 01:31:49 +00:00
|
|
|
regcache_raw_supply (current_regcache, regno, buf);
|
2002-05-29 01:51:17 +00:00
|
|
|
set_register_cached (regno, -1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
static int warn_user = 1;
|
2003-05-08 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
* gdbarch.h: Re-generate.
* defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
(legacy_max_register_raw_size): Delete declaration.
* regcache.c (legacy_max_register_raw_size): Delete function.
* valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
* target.c, stack.c, sparc-tdep.c, sh-tdep.c: Update.
* rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Update.
* remote-rdp.c, remote-array.c, regcache.c: Update.
* ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Update.
* mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Update.
* infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Update.
* findvar.c, dwarf2cfi.c: Update.
Index: tui/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* tuiRegs.c: Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
Index: mi/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
2003-05-08 20:52:49 +00:00
|
|
|
char buf[MAX_REGISTER_SIZE];
|
2002-05-29 01:51:17 +00:00
|
|
|
int nr_bytes;
|
|
|
|
gdb_assert (regno >= 0 && regno < NUM_REGS);
|
2003-05-08 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
* gdbarch.h: Re-generate.
* defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
(legacy_max_register_raw_size): Delete declaration.
* regcache.c (legacy_max_register_raw_size): Delete function.
* valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
* target.c, stack.c, sparc-tdep.c, sh-tdep.c: Update.
* rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Update.
* remote-rdp.c, remote-array.c, regcache.c: Update.
* ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Update.
* mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Update.
* infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Update.
* findvar.c, dwarf2cfi.c: Update.
Index: tui/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* tuiRegs.c: Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
Index: mi/ChangeLog
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
MAX_REGISTER_RAW_SIZE.
2003-05-08 20:52:49 +00:00
|
|
|
memset (buf, 0, MAX_REGISTER_SIZE);
|
1999-09-09 00:02:17 +00:00
|
|
|
nr_bytes = sim_fetch_register (gdbsim_desc,
|
|
|
|
REGISTER_SIM_REGNO (regno),
|
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
* rs6000-tdep.c (rs6000_push_dummy_call)
(rs6000_extract_return_value): Use register_size.
* xstormy16-tdep.c (xstormy16_get_saved_register)
(xstormy16_extract_return_value): Ditto.
* valops.c (value_assign): Ditto.
* v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
* v850-tdep.c (v850_extract_return_value): Ditto.
* tracepoint.c (collect_symbol): Ditto.
* target.c (debug_print_register): Ditto.
* stack.c (frame_info): Ditto.
* rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
* rom68k-rom.c (rom68k_supply_one_register): Ditto.
* remote.c (struct packet_reg, remote_wait, remote_async_wait)
(store_register_using_P): Ditto.
* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
* remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
* remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
* regcache.c (deprecated_read_register_bytes)
(deprecated_write_register_bytes, read_register)
(write_register): Ditto.
* ppc-linux-nat.c (fetch_altivec_register, fetch_register)
(supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
* monitor.c (monitor_supply_register, monitor_fetch_register)
(monitor_store_register): Ditto.
* mn10300-tdep.c (mn10300_pop_frame_regular)
(mn10300_print_register): Ditto.
* mipsv4-nat.c (fill_fpregset): Ditto.
* mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
(mips64_fill_fpregset): Ditto.
* mi/mi-main.c (register_changed_p, get_register)
(mi_cmd_data_write_register_values): Ditto.
* lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
* irix5-nat.c (fill_gregset, fetch_core_registers):
* infrun.c (write_inferior_status_register): Ditto.
* infptrace.c (fetch_register, store_register): Ditto.
* infcmd.c (default_print_registers_info): Ditto.
* ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
* ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
* i386gnu-nat.c (gnu_store_registers, fill): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Ditto.
* hppah-nat.c (store_inferior_registers, fetch_register):
* findvar.c (value_from_register): Ditto.
* dve3900-rom.c (fetch_bitmapped_register):
* cris-tdep.c (cris_gdbarch_init): Ditto.
* alpha-tdep.h: Ditto.
* aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
2004-08-03 00:57:27 +00:00
|
|
|
buf, register_size (current_gdbarch, regno));
|
|
|
|
if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno) && warn_user)
|
2002-05-29 01:51:17 +00:00
|
|
|
{
|
|
|
|
fprintf_unfiltered (gdb_stderr,
|
|
|
|
"Size of register %s (%d/%d) incorrect (%d instead of %d))",
|
|
|
|
REGISTER_NAME (regno),
|
|
|
|
regno, REGISTER_SIM_REGNO (regno),
|
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
* rs6000-tdep.c (rs6000_push_dummy_call)
(rs6000_extract_return_value): Use register_size.
* xstormy16-tdep.c (xstormy16_get_saved_register)
(xstormy16_extract_return_value): Ditto.
* valops.c (value_assign): Ditto.
* v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
* v850-tdep.c (v850_extract_return_value): Ditto.
* tracepoint.c (collect_symbol): Ditto.
* target.c (debug_print_register): Ditto.
* stack.c (frame_info): Ditto.
* rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
* rom68k-rom.c (rom68k_supply_one_register): Ditto.
* remote.c (struct packet_reg, remote_wait, remote_async_wait)
(store_register_using_P): Ditto.
* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
* remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
* remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
* regcache.c (deprecated_read_register_bytes)
(deprecated_write_register_bytes, read_register)
(write_register): Ditto.
* ppc-linux-nat.c (fetch_altivec_register, fetch_register)
(supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
* monitor.c (monitor_supply_register, monitor_fetch_register)
(monitor_store_register): Ditto.
* mn10300-tdep.c (mn10300_pop_frame_regular)
(mn10300_print_register): Ditto.
* mipsv4-nat.c (fill_fpregset): Ditto.
* mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
(mips64_fill_fpregset): Ditto.
* mi/mi-main.c (register_changed_p, get_register)
(mi_cmd_data_write_register_values): Ditto.
* lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
* irix5-nat.c (fill_gregset, fetch_core_registers):
* infrun.c (write_inferior_status_register): Ditto.
* infptrace.c (fetch_register, store_register): Ditto.
* infcmd.c (default_print_registers_info): Ditto.
* ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
* ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
* i386gnu-nat.c (gnu_store_registers, fill): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Ditto.
* hppah-nat.c (store_inferior_registers, fetch_register):
* findvar.c (value_from_register): Ditto.
* dve3900-rom.c (fetch_bitmapped_register):
* cris-tdep.c (cris_gdbarch_init): Ditto.
* alpha-tdep.h: Ditto.
* aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
2004-08-03 00:57:27 +00:00
|
|
|
nr_bytes, register_size (current_gdbarch, regno));
|
2002-05-29 01:51:17 +00:00
|
|
|
warn_user = 0;
|
|
|
|
}
|
|
|
|
/* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
|
2003-07-18 00:21:00 +00:00
|
|
|
indicating that GDB and the SIM have different ideas about
|
2002-05-29 01:51:17 +00:00
|
|
|
which registers are fetchable. */
|
|
|
|
/* Else if (nr_bytes < 0): an old simulator, that doesn't
|
|
|
|
think to return the register size. Just assume all is ok. */
|
2004-07-21 Andrew Cagney <cagney@gnu.org>
Use regcache_raw_supply instead of supply_register.
* regcache.h (supply_register): Delete declaration.
* regcache.c (supply_register): Delete function.
* wince.c (do_child_fetch_inferior_registers): Update.
* win32-nat.c (do_child_fetch_inferior_registers)
(fetch_elf_core_registers): Update.
* v850ice.c (v850ice_fetch_registers): Update.
* thread-db.c (thread_db_store_registers): Update.
* sol-thread.c (sol_thread_store_registers): Update.
* shnbsd-tdep.c (shnbsd_supply_reg): Update.
* rs6000-nat.c (fetch_register): Update.
* rom68k-rom.c (rom68k_supply_one_register): Update.
* remote.c (remote_wait, remote_async_wait): Update.
* remote-st.c (get_hex_regs): Update.
* remote-sim.c (gdbsim_fetch_register): Update.
* remote-sds.c (sds_fetch_registers): Update.
* remote-rdp.c (remote_rdp_fetch_register): Update.
* remote-rdi.c (arm_rdi_fetch_registers): Update.
* remote-mips.c (mips_wait, mips_fetch_registers): Update.
* remote-m32r-sdi.c (m32r_fetch_register): Update.
* remote-hms.c (init_hms_cmds): Update.
* remote-est.c (init_est_cmds): Update.
* remote-e7000.c (get_hex_regs, fetch_regs_from_dump)
(e7000_fetch_registers, sub2_from_pc, e7000_wait): Update.
* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_supply_fpreg): Update.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, supply_vrregset)
(fetch_spe_registers): Update.
* ppc-bdm.c (bdm_ppc_fetch_registers): Update.
* monitor.c (monitor_supply_register): Update.
* mipsv4-nat.c (supply_gregset, supply_fpregset): Update.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg)
(mipsnbsd_supply_fpreg): Update.
* mips-nat.c (fetch_inferior_registers)
(fetch_core_registers): Update.
* mips-linux-tdep.c (supply_32bit_reg, supply_gregset)
(supply_fpregset, mips64_supply_gregset)
(mips64_supply_fpregset): Update.
* m68klinux-nat.c (fetch_register, supply_gregset)
(supply_fpregset): Update.
* m68k-tdep.c (supply_gregset, supply_fpregset): Update.
* m32r-rom.c (init_m32r_cmds, init_mon2000_cmds): Update.
* lynx-nat.c (fetch_inferior_registers, fetch_core_registers): Update.
* irix5-nat.c (supply_gregset, supply_fpregset): Update.
* infptrace.c (fetch_register): Update.
* ia64-linux-nat.c (supply_gregset, supply_fpregset): Update.
* ia64-aix-nat.c (supply_gregset, supply_fpregset): Update.
* i386gnu-nat.c (fetch_fpregs, supply_gregset)
(gnu_fetch_registers, gnu_store_registers): Update.
* i386-nto-tdep.c (i386nto_supply_gregset): Update.
* i386-linux-nat.c (fetch_register, supply_gregset)
(dummy_sse_values): Update.
* hpux-thread.c (hpux_thread_fetch_registers): Update.
* hppah-nat.c (fetch_register): Update.
* hppa-linux-nat.c (fetch_register, supply_gregset)
(supply_fpregset): Update.
* go32-nat.c (fetch_register): Update.
* dve3900-rom.c (fetch_bitmapped_register)
(_initialize_r3900_rom): Update.
* cris-tdep.c (supply_gregset): Update.
* abug-rom.c (init_abug_cmds): Update.
* core-aout.c (fetch_core_registers): Update.
* armnbsd-nat.c (supply_gregset, supply_fparegset)
(fetch_register, fetch_fp_register): Update.
* arm-linux-nat.c (fetch_nwfpe_single, fetch_nwfpe_none)
(fetch_nwfpe_extended, fetch_fpregister, fetch_fpregs)
(fetch_register, fetch_regs, supply_gregset, supply_fpregset): Update.
* alphanbsd-tdep.c (fetch_core_registers): Update.
* alpha-tdep.c (alpha_supply_int_regs, alpha_supply_fp_regs): Update.
* alpha-nat.c (fetch_osf_core_registers)
(fetch_osf_core_registers, fetch_osf_core_registers): Update.
* aix-thread.c (supply_gprs64, supply_reg32, supply_fprs)
(supply_sprs64, supply_sprs32, fetch_regs_kernel_thread): Update.
2004-07-22 01:31:49 +00:00
|
|
|
regcache_raw_supply (current_regcache, regno, buf);
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
2002-05-29 01:51:17 +00:00
|
|
|
{
|
|
|
|
printf_filtered ("gdbsim_fetch_register: %d", regno);
|
|
|
|
/* FIXME: We could print something more intelligible. */
|
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
* rs6000-tdep.c (rs6000_push_dummy_call)
(rs6000_extract_return_value): Use register_size.
* xstormy16-tdep.c (xstormy16_get_saved_register)
(xstormy16_extract_return_value): Ditto.
* valops.c (value_assign): Ditto.
* v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
* v850-tdep.c (v850_extract_return_value): Ditto.
* tracepoint.c (collect_symbol): Ditto.
* target.c (debug_print_register): Ditto.
* stack.c (frame_info): Ditto.
* rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
* rom68k-rom.c (rom68k_supply_one_register): Ditto.
* remote.c (struct packet_reg, remote_wait, remote_async_wait)
(store_register_using_P): Ditto.
* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
* remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
* remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
* regcache.c (deprecated_read_register_bytes)
(deprecated_write_register_bytes, read_register)
(write_register): Ditto.
* ppc-linux-nat.c (fetch_altivec_register, fetch_register)
(supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
* monitor.c (monitor_supply_register, monitor_fetch_register)
(monitor_store_register): Ditto.
* mn10300-tdep.c (mn10300_pop_frame_regular)
(mn10300_print_register): Ditto.
* mipsv4-nat.c (fill_fpregset): Ditto.
* mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
(mips64_fill_fpregset): Ditto.
* mi/mi-main.c (register_changed_p, get_register)
(mi_cmd_data_write_register_values): Ditto.
* lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
* irix5-nat.c (fill_gregset, fetch_core_registers):
* infrun.c (write_inferior_status_register): Ditto.
* infptrace.c (fetch_register, store_register): Ditto.
* infcmd.c (default_print_registers_info): Ditto.
* ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
* ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
* i386gnu-nat.c (gnu_store_registers, fill): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Ditto.
* hppah-nat.c (store_inferior_registers, fetch_register):
* findvar.c (value_from_register): Ditto.
* dve3900-rom.c (fetch_bitmapped_register):
* cris-tdep.c (cris_gdbarch_init): Ditto.
* alpha-tdep.h: Ditto.
* aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
2004-08-03 00:57:27 +00:00
|
|
|
dump_mem (buf, register_size (current_gdbarch, regno));
|
2002-05-29 01:51:17 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_store_register (int regno)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
if (regno == -1)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
for (regno = 0; regno < NUM_REGS; regno++)
|
|
|
|
gdbsim_store_register (regno);
|
2002-05-29 01:51:17 +00:00
|
|
|
return;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2002-05-29 01:51:17 +00:00
|
|
|
else if (REGISTER_SIM_REGNO (regno) >= 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2003-05-08 Andrew Cagney <cagney@redhat.com>
* regcache.h (max_register_size): Delete declaration.
* regcache.c (max_register_size): Delete function.
(struct regcache_descr): Delete field "max_register_size".
(init_regcache_descr, init_legacy_regcache_descr): Assert that all
registers fit in MAX_REGISTER_SIZE.
(regcache_save): Replace max_register_size with MAX_REGISTER_SIZE.
(regcache_restore, regcache_xfer_part, regcache_dump): Ditto.
* thread-db.c: Replace max_register_size with MAX_REGISTER_SIZE.
* sh-tdep.c, rom68k-rom.c, remote-sim.c, remote-mips.c: Ditto.
* remote-e7000.c, monitor.c, mipsv4-nat.c, mips-nat.c: Ditto.
* m68klinux-nat.c, lynx-nat.c, irix4-nat.c: Ditto.
* hpux-thread.c, hppah-nat.c, hppab-nat.c, hppa-tdep.c: Ditto.
* dve3900-rom.c, hppa-tdep.c: Ditto.
2003-05-08 22:33:14 +00:00
|
|
|
char tmp[MAX_REGISTER_SIZE];
|
1999-04-16 01:35:26 +00:00
|
|
|
int nr_bytes;
|
2007-04-29 01:51:51 +00:00
|
|
|
regcache_cooked_read (current_regcache, regno, tmp);
|
1999-09-09 00:02:17 +00:00
|
|
|
nr_bytes = sim_store_register (gdbsim_desc,
|
|
|
|
REGISTER_SIM_REGNO (regno),
|
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
* rs6000-tdep.c (rs6000_push_dummy_call)
(rs6000_extract_return_value): Use register_size.
* xstormy16-tdep.c (xstormy16_get_saved_register)
(xstormy16_extract_return_value): Ditto.
* valops.c (value_assign): Ditto.
* v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
* v850-tdep.c (v850_extract_return_value): Ditto.
* tracepoint.c (collect_symbol): Ditto.
* target.c (debug_print_register): Ditto.
* stack.c (frame_info): Ditto.
* rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
* rom68k-rom.c (rom68k_supply_one_register): Ditto.
* remote.c (struct packet_reg, remote_wait, remote_async_wait)
(store_register_using_P): Ditto.
* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
* remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
* remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
* regcache.c (deprecated_read_register_bytes)
(deprecated_write_register_bytes, read_register)
(write_register): Ditto.
* ppc-linux-nat.c (fetch_altivec_register, fetch_register)
(supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
* monitor.c (monitor_supply_register, monitor_fetch_register)
(monitor_store_register): Ditto.
* mn10300-tdep.c (mn10300_pop_frame_regular)
(mn10300_print_register): Ditto.
* mipsv4-nat.c (fill_fpregset): Ditto.
* mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
(mips64_fill_fpregset): Ditto.
* mi/mi-main.c (register_changed_p, get_register)
(mi_cmd_data_write_register_values): Ditto.
* lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
* irix5-nat.c (fill_gregset, fetch_core_registers):
* infrun.c (write_inferior_status_register): Ditto.
* infptrace.c (fetch_register, store_register): Ditto.
* infcmd.c (default_print_registers_info): Ditto.
* ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
* ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
* i386gnu-nat.c (gnu_store_registers, fill): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Ditto.
* hppah-nat.c (store_inferior_registers, fetch_register):
* findvar.c (value_from_register): Ditto.
* dve3900-rom.c (fetch_bitmapped_register):
* cris-tdep.c (cris_gdbarch_init): Ditto.
* alpha-tdep.h: Ditto.
* aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
2004-08-03 00:57:27 +00:00
|
|
|
tmp, register_size (current_gdbarch, regno));
|
|
|
|
if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno))
|
2001-02-08 06:03:54 +00:00
|
|
|
internal_error (__FILE__, __LINE__,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 18:13:55 +00:00
|
|
|
_("Register size different to expected"));
|
2002-05-29 01:51:17 +00:00
|
|
|
/* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
|
2003-07-18 00:21:00 +00:00
|
|
|
indicating that GDB and the SIM have different ideas about
|
2002-05-29 01:51:17 +00:00
|
|
|
which registers are fetchable. */
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
printf_filtered ("gdbsim_store_register: %d", regno);
|
|
|
|
/* FIXME: We could print something more intelligible. */
|
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
* rs6000-tdep.c (rs6000_push_dummy_call)
(rs6000_extract_return_value): Use register_size.
* xstormy16-tdep.c (xstormy16_get_saved_register)
(xstormy16_extract_return_value): Ditto.
* valops.c (value_assign): Ditto.
* v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
* v850-tdep.c (v850_extract_return_value): Ditto.
* tracepoint.c (collect_symbol): Ditto.
* target.c (debug_print_register): Ditto.
* stack.c (frame_info): Ditto.
* rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
* rom68k-rom.c (rom68k_supply_one_register): Ditto.
* remote.c (struct packet_reg, remote_wait, remote_async_wait)
(store_register_using_P): Ditto.
* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
* remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
* remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
* regcache.c (deprecated_read_register_bytes)
(deprecated_write_register_bytes, read_register)
(write_register): Ditto.
* ppc-linux-nat.c (fetch_altivec_register, fetch_register)
(supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
* monitor.c (monitor_supply_register, monitor_fetch_register)
(monitor_store_register): Ditto.
* mn10300-tdep.c (mn10300_pop_frame_regular)
(mn10300_print_register): Ditto.
* mipsv4-nat.c (fill_fpregset): Ditto.
* mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
(mips64_fill_fpregset): Ditto.
* mi/mi-main.c (register_changed_p, get_register)
(mi_cmd_data_write_register_values): Ditto.
* lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
* irix5-nat.c (fill_gregset, fetch_core_registers):
* infrun.c (write_inferior_status_register): Ditto.
* infptrace.c (fetch_register, store_register): Ditto.
* infcmd.c (default_print_registers_info): Ditto.
* ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
* ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
* i386gnu-nat.c (gnu_store_registers, fill): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers)
(hpux_thread_store_registers): Ditto.
* hppah-nat.c (store_inferior_registers, fetch_register):
* findvar.c (value_from_register): Ditto.
* dve3900-rom.c (fetch_bitmapped_register):
* cris-tdep.c (cris_gdbarch_init): Ditto.
* alpha-tdep.h: Ditto.
* aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
2004-08-03 00:57:27 +00:00
|
|
|
dump_mem (tmp, register_size (current_gdbarch, regno));
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Kill the running program. This may involve closing any open files
|
|
|
|
and releasing other resources acquired by the simulated program. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_kill (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_kill\n");
|
|
|
|
|
|
|
|
/* There is no need to `kill' running simulator - the simulator is
|
2006-10-17 21:55:24 +00:00
|
|
|
not running. Mourning it is enough. */
|
|
|
|
target_mourn_inferior ();
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Load an executable file into the target process. This is expected to
|
|
|
|
not only bring new code into the target process, but also to update
|
|
|
|
GDB's symbol tables to match. */
|
|
|
|
|
|
|
|
static void
|
2006-02-21 18:22:27 +00:00
|
|
|
gdbsim_load (char *args, int fromtty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2006-02-21 18:22:27 +00:00
|
|
|
char **argv = buildargv (args);
|
|
|
|
char *prog;
|
|
|
|
|
|
|
|
if (argv == NULL)
|
|
|
|
nomem (0);
|
|
|
|
|
|
|
|
make_cleanup_freeargv (argv);
|
|
|
|
|
|
|
|
prog = tilde_expand (argv[0]);
|
|
|
|
|
|
|
|
if (argv[1] != NULL)
|
|
|
|
error (_("GDB sim does not yet support a load offset."));
|
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_load: prog \"%s\"\n", prog);
|
|
|
|
|
|
|
|
/* FIXME: We will print two messages on error.
|
|
|
|
Need error to either not print anything if passed NULL or need
|
|
|
|
another routine that doesn't take any arguments. */
|
|
|
|
if (sim_load (gdbsim_desc, prog, NULL, fromtty) == SIM_RC_FAIL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("unable to load program"));
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* FIXME: If a load command should reset the targets registers then
|
|
|
|
a call to sim_create_inferior() should go here. */
|
|
|
|
|
|
|
|
program_loaded = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
/* Start an inferior process and set inferior_ptid to its pid.
|
1999-04-16 01:35:26 +00:00
|
|
|
EXEC_FILE is the file to run.
|
|
|
|
ARGS is a string containing the arguments to the program.
|
|
|
|
ENV is the environment vector to pass. Errors reported with error().
|
|
|
|
On VxWorks and various standalone systems, we ignore exec_file. */
|
|
|
|
/* This is called not only when we first attach, but also when the
|
|
|
|
user types "run" after having attached. */
|
|
|
|
|
|
|
|
static void
|
2004-05-25 14:58:31 +00:00
|
|
|
gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
int len;
|
1999-07-07 20:19:36 +00:00
|
|
|
char *arg_buf, **argv;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
if (exec_file == 0 || exec_bfd == 0)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
warning (_("No executable file specified."));
|
1999-07-07 20:19:36 +00:00
|
|
|
if (!program_loaded)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
warning (_("No program loaded."));
|
1999-04-16 01:35:26 +00:00
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_create_inferior: exec_file \"%s\", args \"%s\"\n",
|
1999-07-07 20:19:36 +00:00
|
|
|
(exec_file ? exec_file : "(NULL)"),
|
1999-04-16 01:35:26 +00:00
|
|
|
args);
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
gdbsim_kill ();
|
1999-04-16 01:35:26 +00:00
|
|
|
remove_breakpoints ();
|
|
|
|
init_wait_for_inferior ();
|
|
|
|
|
|
|
|
if (exec_file != NULL)
|
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10;
|
1999-04-16 01:35:26 +00:00
|
|
|
arg_buf = (char *) alloca (len);
|
|
|
|
arg_buf[0] = '\0';
|
|
|
|
strcat (arg_buf, exec_file);
|
|
|
|
strcat (arg_buf, " ");
|
|
|
|
strcat (arg_buf, args);
|
|
|
|
argv = buildargv (arg_buf);
|
1999-04-26 18:34:20 +00:00
|
|
|
make_cleanup_freeargv (argv);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
argv = NULL;
|
|
|
|
sim_create_inferior (gdbsim_desc, exec_bfd, argv, env);
|
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
inferior_ptid = pid_to_ptid (42);
|
2006-10-17 21:55:24 +00:00
|
|
|
target_mark_running (&gdbsim_ops);
|
1999-07-07 20:19:36 +00:00
|
|
|
insert_breakpoints (); /* Needed to get correct instruction in cache */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
clear_proceed_status ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The open routine takes the rest of the parameters from the command,
|
|
|
|
and (if successful) pushes a new target onto the stack.
|
|
|
|
Targets should supply this routine, if only to provide an error message. */
|
|
|
|
/* Called when selecting the simulator. EG: (gdb) target sim name. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_open (char *args, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
int len;
|
|
|
|
char *arg_buf;
|
|
|
|
char **argv;
|
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_open: args \"%s\"\n", args ? args : "(null)");
|
|
|
|
|
|
|
|
/* Remove current simulator if one exists. Only do this if the simulator
|
|
|
|
has been opened because sim_close requires it.
|
|
|
|
This is important because the call to push_target below will cause
|
|
|
|
sim_close to be called if the simulator is already open, but push_target
|
|
|
|
is called after sim_open! We can't move the call to push_target before
|
|
|
|
the call to sim_open because sim_open may invoke `error'. */
|
|
|
|
if (gdbsim_desc != NULL)
|
|
|
|
unpush_target (&gdbsim_ops);
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
len = (7 + 1 /* gdbsim */
|
1999-04-16 01:35:26 +00:00
|
|
|
+ strlen (" -E little")
|
|
|
|
+ strlen (" --architecture=xxxxxxxxxx")
|
|
|
|
+ (args ? strlen (args) : 0)
|
1999-07-07 20:19:36 +00:00
|
|
|
+ 50) /* slack */ ;
|
1999-04-16 01:35:26 +00:00
|
|
|
arg_buf = (char *) alloca (len);
|
1999-07-07 20:19:36 +00:00
|
|
|
strcpy (arg_buf, "gdbsim"); /* 7 */
|
2007-02-26 20:13:18 +00:00
|
|
|
/* Specify the byte order for the target when it is explicitly
|
|
|
|
specified by the user (not auto detected). */
|
|
|
|
switch (selected_byte_order ())
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2003-11-13 19:06:26 +00:00
|
|
|
case BFD_ENDIAN_BIG:
|
|
|
|
strcat (arg_buf, " -E big");
|
|
|
|
break;
|
|
|
|
case BFD_ENDIAN_LITTLE:
|
|
|
|
strcat (arg_buf, " -E little");
|
|
|
|
break;
|
|
|
|
case BFD_ENDIAN_UNKNOWN:
|
|
|
|
break;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
/* Specify the architecture of the target when it has been
|
|
|
|
explicitly specified */
|
2003-11-13 19:06:26 +00:00
|
|
|
if (selected_architecture_name () != NULL)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
strcat (arg_buf, " --architecture=");
|
2003-11-13 19:06:26 +00:00
|
|
|
strcat (arg_buf, selected_architecture_name ());
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
/* finally, any explicit args */
|
|
|
|
if (args)
|
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
strcat (arg_buf, " "); /* 1 */
|
1999-04-16 01:35:26 +00:00
|
|
|
strcat (arg_buf, args);
|
|
|
|
}
|
|
|
|
argv = buildargv (arg_buf);
|
|
|
|
if (argv == NULL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("Insufficient memory available to allocate simulator arg list."));
|
1999-04-26 18:34:20 +00:00
|
|
|
make_cleanup_freeargv (argv);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
init_callbacks ();
|
|
|
|
gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, argv);
|
|
|
|
|
|
|
|
if (gdbsim_desc == 0)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("unable to create simulator instance"));
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
push_target (&gdbsim_ops);
|
|
|
|
printf_filtered ("Connected to the simulator.\n");
|
2006-10-17 21:55:24 +00:00
|
|
|
|
|
|
|
/* There's nothing running after "target sim" or "load"; not until
|
|
|
|
"run". */
|
|
|
|
inferior_ptid = null_ptid;
|
|
|
|
target_mark_exited (&gdbsim_ops);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Does whatever cleanup is required for a target that we are no longer
|
|
|
|
going to be calling. Argument says whether we are quitting gdb and
|
|
|
|
should not get hung in case of errors, or whether we want a clean
|
|
|
|
termination even if it takes a while. This routine is automatically
|
|
|
|
always called just before a routine is popped off the target stack.
|
|
|
|
Closing file descriptors and freeing memory are typical things it should
|
|
|
|
do. */
|
|
|
|
/* Close out all files and local state before this target loses control. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_close (int quitting)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_close: quitting %d\n", quitting);
|
|
|
|
|
|
|
|
program_loaded = 0;
|
|
|
|
|
|
|
|
if (gdbsim_desc != NULL)
|
|
|
|
{
|
|
|
|
sim_close (gdbsim_desc, quitting);
|
|
|
|
gdbsim_desc = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
end_callbacks ();
|
2000-03-01 11:25:51 +00:00
|
|
|
generic_mourn_inferior ();
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Takes a program previously attached to and detaches it.
|
|
|
|
The program may resume execution (some targets do, some don't) and will
|
|
|
|
no longer stop on signals, etc. We better not have left any breakpoints
|
|
|
|
in the program or it'll die when it hits one. ARGS is arguments
|
|
|
|
typed by the user (e.g. a signal to send the process). FROM_TTY
|
|
|
|
says whether to be verbose or not. */
|
|
|
|
/* Terminate the open connection to the remote debugger.
|
|
|
|
Use this when you want to detach and do something else with your gdb. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_detach (char *args, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_detach: args \"%s\"\n", args);
|
|
|
|
|
|
|
|
pop_target (); /* calls gdbsim_close to do the real work */
|
|
|
|
if (from_tty)
|
|
|
|
printf_filtered ("Ending simulator %s debugging\n", target_shortname);
|
|
|
|
}
|
1999-07-07 20:19:36 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/* Resume execution of the target process. STEP says whether to single-step
|
|
|
|
or to run free; SIGGNAL is the signal value (e.g. SIGINT) to be given
|
|
|
|
to the target, or zero for no signal. */
|
|
|
|
|
|
|
|
static enum target_signal resume_siggnal;
|
|
|
|
static int resume_step;
|
|
|
|
|
|
|
|
static void
|
2001-05-04 04:15:33 +00:00
|
|
|
gdbsim_resume (ptid_t ptid, int step, enum target_signal siggnal)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2001-05-04 04:15:33 +00:00
|
|
|
if (PIDGET (inferior_ptid) != 42)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("The program is not being run."));
|
1999-04-16 01:35:26 +00:00
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_resume: step %d, signal %d\n", step, siggnal);
|
|
|
|
|
|
|
|
resume_siggnal = siggnal;
|
|
|
|
resume_step = step;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Notify the simulator of an asynchronous request to stop.
|
1999-07-07 20:19:36 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
The simulator shall ensure that the stop request is eventually
|
|
|
|
delivered to the simulator. If the call is made while the
|
|
|
|
simulator is not running then the stop request is processed when
|
|
|
|
the simulator is next resumed.
|
|
|
|
|
|
|
|
For simulators that do not support this operation, just abort */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_stop (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
if (!sim_stop (gdbsim_desc))
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
quit ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GDB version of os_poll_quit callback.
|
2005-01-14 01:05:37 +00:00
|
|
|
Taken from gdb/util.c - should be in a library. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
static int
|
2000-07-30 01:48:28 +00:00
|
|
|
gdb_os_poll_quit (host_callback *p)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2004-06-25 19:46:08 +00:00
|
|
|
if (deprecated_ui_loop_hook != NULL)
|
|
|
|
deprecated_ui_loop_hook (0);
|
1999-04-26 18:34:20 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
if (quit_flag) /* gdb's idea of quit */
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
quit_flag = 0; /* we've stolen it */
|
1999-04-16 01:35:26 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else if (immediate_quit)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait for inferior process to do something. Return pid of child,
|
|
|
|
or -1 in case of error; store status through argument pointer STATUS,
|
|
|
|
just as `wait' would. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_cntrl_c (int signo)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
gdbsim_stop ();
|
|
|
|
}
|
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
static ptid_t
|
|
|
|
gdbsim_wait (ptid_t ptid, struct target_waitstatus *status)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
static RETSIGTYPE (*prev_sigint) ();
|
|
|
|
int sigrc = 0;
|
|
|
|
enum sim_stop reason = sim_running;
|
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_wait\n");
|
|
|
|
|
|
|
|
#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
|
|
|
|
{
|
|
|
|
struct sigaction sa, osa;
|
|
|
|
sa.sa_handler = gdbsim_cntrl_c;
|
|
|
|
sigemptyset (&sa.sa_mask);
|
|
|
|
sa.sa_flags = 0;
|
|
|
|
sigaction (SIGINT, &sa, &osa);
|
|
|
|
prev_sigint = osa.sa_handler;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
|
|
|
|
#endif
|
2005-11-28 18:33:03 +00:00
|
|
|
sim_resume (gdbsim_desc, resume_step, resume_siggnal);
|
1999-04-16 01:35:26 +00:00
|
|
|
signal (SIGINT, prev_sigint);
|
|
|
|
resume_step = 0;
|
|
|
|
|
|
|
|
sim_stop_reason (gdbsim_desc, &reason, &sigrc);
|
|
|
|
|
|
|
|
switch (reason)
|
|
|
|
{
|
|
|
|
case sim_exited:
|
|
|
|
status->kind = TARGET_WAITKIND_EXITED;
|
|
|
|
status->value.integer = sigrc;
|
|
|
|
break;
|
|
|
|
case sim_stopped:
|
|
|
|
switch (sigrc)
|
|
|
|
{
|
2005-11-28 18:33:03 +00:00
|
|
|
case TARGET_SIGNAL_ABRT:
|
1999-04-16 01:35:26 +00:00
|
|
|
quit ();
|
|
|
|
break;
|
2005-11-28 18:33:03 +00:00
|
|
|
case TARGET_SIGNAL_INT:
|
|
|
|
case TARGET_SIGNAL_TRAP:
|
1999-04-16 01:35:26 +00:00
|
|
|
default:
|
|
|
|
status->kind = TARGET_WAITKIND_STOPPED;
|
2005-11-28 18:33:03 +00:00
|
|
|
status->value.sig = sigrc;
|
1999-04-16 01:35:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case sim_signalled:
|
|
|
|
status->kind = TARGET_WAITKIND_SIGNALLED;
|
2005-11-28 18:33:03 +00:00
|
|
|
status->value.sig = sigrc;
|
1999-04-16 01:35:26 +00:00
|
|
|
break;
|
|
|
|
case sim_running:
|
|
|
|
case sim_polling:
|
|
|
|
/* FIXME: Is this correct? */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
return inferior_ptid;
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get ready to modify the registers array. On machines which store
|
|
|
|
individual registers, this doesn't need to do anything. On machines
|
|
|
|
which store all the registers in one fell swoop, this makes sure
|
|
|
|
that registers contains all the registers from the program being
|
|
|
|
debugged. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_prepare_to_store (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
/* Do nothing, since we can store individual regs */
|
|
|
|
}
|
|
|
|
|
2000-10-12 21:39:21 +00:00
|
|
|
/* 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. */
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
static int
|
2005-06-19 20:08:37 +00:00
|
|
|
gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
|
2002-01-19 03:32:43 +00:00
|
|
|
int write, struct mem_attrib *attrib,
|
|
|
|
struct target_ops *target)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
2006-10-17 21:55:24 +00:00
|
|
|
/* If no program is running yet, then ignore the simulator for
|
|
|
|
memory. Pass the request down to the next target, hopefully
|
|
|
|
an exec file. */
|
|
|
|
if (!target_has_execution)
|
|
|
|
return 0;
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
if (!program_loaded)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("No program loaded."));
|
1999-04-16 01:35:26 +00:00
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-09-09 00:02:17 +00:00
|
|
|
/* FIXME: Send to something other than STDOUT? */
|
|
|
|
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
|
|
|
|
gdb_print_host_address (myaddr, gdb_stdout);
|
|
|
|
printf_filtered (", memaddr 0x%s, len %d, write %d\n",
|
|
|
|
paddr_nz (memaddr), len, write);
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug && write)
|
1999-07-07 20:19:36 +00:00
|
|
|
dump_mem (myaddr, len);
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (write)
|
|
|
|
{
|
|
|
|
len = sim_write (gdbsim_desc, memaddr, myaddr, len);
|
|
|
|
}
|
1999-07-07 20:19:36 +00:00
|
|
|
else
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
len = sim_read (gdbsim_desc, memaddr, myaddr, len);
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug && len > 0)
|
1999-07-07 20:19:36 +00:00
|
|
|
dump_mem (myaddr, len);
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_files_info (struct target_ops *target)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
char *file = "nothing";
|
|
|
|
|
|
|
|
if (exec_bfd)
|
|
|
|
file = bfd_get_filename (exec_bfd);
|
|
|
|
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_files_info: file \"%s\"\n", file);
|
|
|
|
|
|
|
|
if (exec_bfd)
|
|
|
|
{
|
|
|
|
printf_filtered ("\tAttached to %s running program %s\n",
|
|
|
|
target_shortname, file);
|
|
|
|
sim_info (gdbsim_desc, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear the simulator's notion of what the break points are. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 01:48:28 +00:00
|
|
|
gdbsim_mourn_inferior (void)
|
1999-07-07 20:19:36 +00:00
|
|
|
{
|
* mips-mdebug-tdep.c, mips-mdebug-tdep.h, ocd.c, ocd.h, ppc-bdm.c,
remote-e7000.c, remote-hms.c, remote-utils.c, remote-utils.h,
scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h, scm-valprint.c,
ser-e7kpc.c, sh3-rom.c, stop-gdb.c: Delete.
* Makefile.in: Remove references to deleted files.
* README: Do not mention deleted ROM monitor interfaces.
* defs.h (enum language): Delete language_scm.
* expprint.c (print_subexp_standard): Do not handle OP_EXPRSTRING.
(dump_subexp_body_standard): Likewise.
* parse.c (operator_length_standard): Likewise.
* expression.h (enum exp_opcode): Delete OP_EXPRSTRING.
* remote-mips.c: Do not include remote-utils.h.
* remote-sim.c: Likewise. Use remote_debug instead of sr_get_debug
throughout.
* value.c: Do not include scm-lang.h.
(unpack_long): Delete scm_unpack call.
* config/h8300/h8300.mt, config/mips/embed.mt,
config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt,
config/sh/embed.mt, config/sh/linux.mt: Remove references to
deleted files.
* NEWS: Mention removed files.
* gdb.texinfo (Memory): Reference Remote Debugging chapter.
(Character Sets, Caching Data of Remote Targets): Likewise.
(Targets): Delete Remote node. Move its text...
(Debugging Remote Programs): ...to here. Delete description
of the "remote" command.
(Remote configuration): Delete description of "set remotedevice"
and "show remotedevice".
(Embedded Processors): Delete H8/300, H8/500, and SH nodes.
2007-04-13 14:17:47 +00:00
|
|
|
if (remote_debug)
|
1999-04-16 01:35:26 +00:00
|
|
|
printf_filtered ("gdbsim_mourn_inferior:\n");
|
|
|
|
|
|
|
|
remove_breakpoints ();
|
2006-10-17 21:55:24 +00:00
|
|
|
target_mark_exited (&gdbsim_ops);
|
1999-04-16 01:35:26 +00:00
|
|
|
generic_mourn_inferior ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Pass the command argument through to the simulator verbatim. The
|
|
|
|
simulator must do any command interpretation work. */
|
|
|
|
|
|
|
|
void
|
2000-07-30 01:48:28 +00:00
|
|
|
simulator_command (char *args, int from_tty)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
if (gdbsim_desc == NULL)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* PREVIOUSLY: The user may give a command before the simulator
|
|
|
|
is opened. [...] (??? assuming of course one wishes to
|
|
|
|
continue to allow commands to be sent to unopened simulators,
|
|
|
|
which isn't entirely unreasonable). */
|
|
|
|
|
|
|
|
/* The simulator is a builtin abstraction of a remote target.
|
|
|
|
Consistent with that model, access to the simulator, via sim
|
|
|
|
commands, is restricted to the period when the channel to the
|
|
|
|
simulator is open. */
|
|
|
|
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("Not connected to the simulator target"));
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sim_do_command (gdbsim_desc, args);
|
|
|
|
|
|
|
|
/* Invalidate the register cache, in case the simulator command does
|
|
|
|
something funny. */
|
1999-07-07 20:19:36 +00:00
|
|
|
registers_changed ();
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Define the target subroutine names */
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
struct target_ops gdbsim_ops;
|
|
|
|
|
|
|
|
static void
|
|
|
|
init_gdbsim_ops (void)
|
|
|
|
{
|
|
|
|
gdbsim_ops.to_shortname = "sim";
|
|
|
|
gdbsim_ops.to_longname = "simulator";
|
|
|
|
gdbsim_ops.to_doc = "Use the compiled-in simulator.";
|
|
|
|
gdbsim_ops.to_open = gdbsim_open;
|
|
|
|
gdbsim_ops.to_close = gdbsim_close;
|
|
|
|
gdbsim_ops.to_detach = gdbsim_detach;
|
|
|
|
gdbsim_ops.to_resume = gdbsim_resume;
|
|
|
|
gdbsim_ops.to_wait = gdbsim_wait;
|
|
|
|
gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
|
|
|
|
gdbsim_ops.to_store_registers = gdbsim_store_register;
|
|
|
|
gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
|
2004-10-08 20:30:00 +00:00
|
|
|
gdbsim_ops.deprecated_xfer_memory = gdbsim_xfer_inferior_memory;
|
1999-07-07 20:19:36 +00:00
|
|
|
gdbsim_ops.to_files_info = gdbsim_files_info;
|
gdb/
* breakpoint.c (deprecated_read_memory_nobpt): Update to use
shadow_len.
(insert_bp_location, reattach_breakpoints, remove_breakpoint)
(delete_breakpoint): Update calls to changed methods.
(deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
(single_step_breakpoints, insert_single_step_breakpoint)
(remove_single_step_breakpoints): New.
* breakpoint.h (struct bp_target_info): New.
(struct bp_location): Replace shadow_contents with
target_info and overlay_target_info.
(deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
(insert_single_step_breakpoint, remove_single_step_breakpoints): New
prototypes.
* gdbarch.sh: Forward declare struct bp_target_info in gdbarch.h.
(memory_insert_breakpoint, memory_remove_breakpoint): Update second
argument.
* mem-break.c (default_memory_insert_breakpoint): Update. Set
placed_address, placed_size, and shadow_len.
(default_memory_remove_breakpoint): Update. Don't use
BREAKPOINT_FROM_PC.
(memory_insert_breakpoint, memory_remove_breakpoint): Update.
* target.c (update_current_target): Update prototypes for changed
functions.
(debug_to_insert_breakpoint, debug_to_remove_breakpoint)
(debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint):
Update.
* target.h: Forward declare struct bp_target_info.
(struct target_ops): Use a bp_target_info argument for
to_insert_breakpoint, to_remove_breakpoint,
to_insert_hw_breakpoint, and to_remove_hw_breakpoint.
(target_insert_breakpoint, target_remove_breakpoint)
(target_insert_hw_breakpoint, target_remove_hw_breakpoint)
(memory_insert_breakpoint, memory_remove_breakpoint)
(default_memory_insert_breakpoint, default_memory_remove_breakpoint):
Update.
* config/i386/nm-i386.h: Forward declare struct bp_target_info.
(i386_insert_hw_breakpoint, i386_remove_hw_breakpoint): Update.
(target_insert_hw_breakpoint, target_remove_hw_breakpoint): Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
* alpha-tdep.c (alpha_software_single_step): Use
insert_single_step_breakpoint and remove_single_step_breakpoints.
Remove unused statics.
* arm-tdep.c (arm_software_single_step): Likewise. Add a note.
* cris-tdep.c (cris_software_single_step): Likewise.
* mips-tdep.c (mips_software_single_step): Likewise.
* rs6000-tdep.c (rs6000_software_single_step): Likewise.
* sparc-tdep.c (sparc_software_single_step): Likewise.
* wince.c (struct thread_info_struct): Remove step_prev.
(undoSStep): Use remove_single_step_breakpoints.
(wince_software_single_step): Use insert_single_step_breakpoint.
* corelow.c (ignore): Remove unneeded prototype. Update arguments.
* exec.c (ignore): Likewise.
* sol-thread.c (ignore): Likewise.
* procfs.c (dbx_link_shadow_contents): Delete.
(dbx_link_bpt): New.
(procfs_mourn_inferior): Remove it if necessary.
(remove_dbx_link_breakpoint): Use it.
(insert_dbx_link_bpt_in_file): Set it.
(procfs_init_inferior): Don't update dbx_link_bpt_addr.
* rs6000-nat.c (exec_one_dummy_insn): Use
deprecated_insert_raw_breakpoint and
deprecated_remove_raw_breakpoint.
* solib-irix.c (shadow_contents, breakpoint_addr): Delete.
(base_breakpoint): New.
(disable_break): Use it.
(enable_break): Set it.
* i386-nat.c (i386_insert_hw_breakpoint, i386_remove_hw_breakpoint):
Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint)
(ia64_memory_remove_breakpoint): Likewise.
* m32r-tdep.c (m32r_memory_insert_breakpoint)
(m32r_memory_remove_breakpoint): Likewise.
* monitor.c (monitor_insert_breakpoint, monitor_remove_breakpoint):
Likewise. Remove unnecessary prototypes. Use placed_address
and placed_size. Removed useless read from memory.
* nto-procfs.c (procfs_insert_breakpoint)
(procfs_remove_breakpoint, procfs_insert_hw_breakpoint)
(procfs_remove_hw_breakpoint): Update.
* ocd.c (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
* ocd.h (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.
* ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Likewise.
* remote-e7000.c (e7000_insert_breakpoint)
(e7000_remove_breakpoint): Likewise.
* remote-m32r-sdi.c (m32r_insert_breakpoint)
(m32r_remove_breakpoint): Likewise.
* remote-mips.c (mips_insert_breakpoint)
(mips_remove_breakpoint): Likewise.
* remote-rdp.c (remote_rdp_insert_breakpoint)
(remote_rdp_remove_breakpoint): Likewise.
(rdp_step): Use deprecated_insert_raw_breakpoint and
deprecated_remove_raw_breakpoint.
* remote-sds.c (sds_insert_breakpoint, sds_remove_breakpoint):
Update.
* remote-sim.c (gdbsim_insert_breakpoint, gdbsim_remove_breakpoint):
Delete.
(init_gdbsim_ops): Use memory_insert_breakpoint and
memory_remove_breakpoint.
* remote-st.c (st2000_insert_breakpoint)
(st2000_remove_breakpoint): Update. Remove unused
BREAKPOINT_FROM_PC.
* remote.c (remote_insert_breakpoint, remote_remove_breakpoint):
Update. Use placed_address and placed_size.
(remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Likewise.
gdb/doc/
* gdbint.texinfo (x86 Watchpoints, Target Conditionals): Update insert
and remove breakpoint prototypes.
(Watchpoints): Move description of target_insert_hw_breakpoint and
target_remove_hw_breakpoint ...
(Breakpoints): ... to here. Document target_insert_breakpoint and
target_remove_breakpoint.
2006-04-18 19:20:08 +00:00
|
|
|
gdbsim_ops.to_insert_breakpoint = memory_insert_breakpoint;
|
|
|
|
gdbsim_ops.to_remove_breakpoint = memory_remove_breakpoint;
|
1999-07-07 20:19:36 +00:00
|
|
|
gdbsim_ops.to_kill = gdbsim_kill;
|
|
|
|
gdbsim_ops.to_load = gdbsim_load;
|
|
|
|
gdbsim_ops.to_create_inferior = gdbsim_create_inferior;
|
|
|
|
gdbsim_ops.to_mourn_inferior = gdbsim_mourn_inferior;
|
|
|
|
gdbsim_ops.to_stop = gdbsim_stop;
|
|
|
|
gdbsim_ops.to_stratum = process_stratum;
|
|
|
|
gdbsim_ops.to_has_all_memory = 1;
|
|
|
|
gdbsim_ops.to_has_memory = 1;
|
|
|
|
gdbsim_ops.to_has_stack = 1;
|
|
|
|
gdbsim_ops.to_has_registers = 1;
|
|
|
|
gdbsim_ops.to_has_execution = 1;
|
|
|
|
gdbsim_ops.to_magic = OPS_MAGIC;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#ifdef TARGET_REDEFINE_DEFAULT_OPS
|
|
|
|
TARGET_REDEFINE_DEFAULT_OPS (&gdbsim_ops);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-07-30 01:48:28 +00:00
|
|
|
_initialize_remote_sim (void)
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
1999-07-07 20:19:36 +00:00
|
|
|
init_gdbsim_ops ();
|
1999-04-16 01:35:26 +00:00
|
|
|
add_target (&gdbsim_ops);
|
|
|
|
|
2005-04-22 12:49:27 +00:00
|
|
|
add_com ("sim", class_obscure, simulator_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
_("Send a command to the simulator."));
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|