/* Generic remote debugging interface for simulators.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2002, 2004-2012 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Steve Chamberlain (sac@cygnus.com).
}
else
argv = NULL;
- sim_create_inferior (sim_data->gdbsim_desc, exec_bfd, argv, env);
+
+ if (sim_create_inferior (sim_data->gdbsim_desc, exec_bfd, argv, env)
+ != SIM_RC_OK)
+ error (_("Unable to create sim inferior."));
inferior_ptid = sim_data->remote_sim_ptid;
inferior_appeared (current_inferior (), ptid_get_pid (inferior_ptid));
len = (7 + 1 /* gdbsim */
+ strlen (" -E little")
+ strlen (" --architecture=xxxxxxxxxx")
+ + strlen (" --sysroot=") + strlen (gdb_sysroot) +
+ (args ? strlen (args) : 0)
+ 50) /* slack */ ;
arg_buf = (char *) alloca (len);
strcat (arg_buf, " --architecture=");
strcat (arg_buf, selected_architecture_name ());
}
+ /* Pass along gdb's concept of the sysroot. */
+ strcat (arg_buf, " --sysroot=");
+ strcat (arg_buf, gdb_sysroot);
/* finally, any explicit args */
if (args)
{
/* Simulator memory may be accessed after the program has been loaded. */
-int
+static int
gdbsim_has_all_memory (struct target_ops *ops)
{
struct sim_inferior_data *sim_data
return 1;
}
-int
+static int
gdbsim_has_memory (struct target_ops *ops)
{
struct sim_inferior_data *sim_data