Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: gdb/remote-sim.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/remote-mips.c ('k') | gdb/reverse.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/remote-sim.c
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 2a586e5e80ee4e44d1291f7bd3e7957358351e8e..f5927f2d9668a48c53b7251a2f62371b36a03e3f 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -118,7 +118,7 @@ struct sim_inferior_data {
ptid_t remote_sim_ptid;
/* Signal with which to resume. */
- enum target_signal resume_siggnal;
+ enum gdb_signal resume_siggnal;
/* Flag which indicates whether resume should step or not. */
int resume_step;
@@ -217,7 +217,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
/* Initialize the other instance variables. */
sim_data->program_loaded = 0;
sim_data->gdbsim_desc = sim_desc;
- sim_data->resume_siggnal = TARGET_SIGNAL_0;
+ sim_data->resume_siggnal = GDB_SIGNAL_0;
sim_data->resume_step = 0;
}
else if (sim_desc)
@@ -641,7 +641,10 @@ gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
}
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));
@@ -835,7 +838,7 @@ gdbsim_detach (struct target_ops *ops, char *args, int from_tty)
struct resume_data
{
- enum target_signal siggnal;
+ enum gdb_signal siggnal;
int step;
};
@@ -864,7 +867,7 @@ gdbsim_resume_inferior (struct inferior *inf, void *arg)
static void
gdbsim_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, enum gdb_signal siggnal)
{
struct resume_data rd;
struct sim_inferior_data *sim_data
@@ -1025,11 +1028,11 @@ gdbsim_wait (struct target_ops *ops,
case sim_stopped:
switch (sigrc)
{
- case TARGET_SIGNAL_ABRT:
+ case GDB_SIGNAL_ABRT:
quit ();
break;
- case TARGET_SIGNAL_INT:
- case TARGET_SIGNAL_TRAP:
+ case GDB_SIGNAL_INT:
+ case GDB_SIGNAL_TRAP:
default:
status->kind = TARGET_WAITKIND_STOPPED;
status->value.sig = sigrc;
@@ -1195,16 +1198,28 @@ simulator_command (char *args, int from_tty)
registers_changed ();
}
-static char **
+static VEC (char_ptr) *
sim_command_completer (struct cmd_list_element *ignore, char *text, char *word)
{
struct sim_inferior_data *sim_data;
+ char **tmp;
+ int i;
+ VEC (char_ptr) *result = NULL;
sim_data = inferior_data (current_inferior (), sim_inferior_data_key);
if (sim_data == NULL || sim_data->gdbsim_desc == NULL)
return NULL;
- return sim_complete_command (sim_data->gdbsim_desc, text, word);
+ tmp = sim_complete_command (sim_data->gdbsim_desc, text, word);
+ if (tmp == NULL)
+ return NULL;
+
+ /* Transform the array into a VEC, and then free the array. */
+ for (i = 0; tmp[i] != NULL; i++)
+ VEC_safe_push (char_ptr, result, tmp[i]);
+ xfree (tmp);
+
+ return result;
}
/* Check to see if a thread is still alive. */
@@ -1236,7 +1251,7 @@ gdbsim_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* 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
@@ -1248,7 +1263,7 @@ gdbsim_has_all_memory (struct target_ops *ops)
return 1;
}
-int
+static int
gdbsim_has_memory (struct target_ops *ops)
{
struct sim_inferior_data *sim_data
« no previous file with comments | « gdb/remote-mips.c ('k') | gdb/reverse.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698