gdbserver: no point in hiding the regcache type nowadays
[deliverable/binutils-gdb.git] / gdb / gdbserver / inferiors.c
index 608a99736db3b890f79981753300b5fa39e1f734..d7ad347eeed4e457c13e952ebbcf3e18086d5e17 100644 (file)
@@ -1,5 +1,5 @@
 /* Inferior process information for the remote server for GDB.
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    Contributed by MontaVista Software.
 
@@ -25,7 +25,7 @@
 struct inferior_list all_processes;
 struct inferior_list all_threads;
 
-struct thread_info *current_inferior;
+struct thread_info *current_thread;
 
 #define get_thread(inf) ((struct thread_info *)(inf))
 
@@ -115,8 +115,8 @@ add_thread (ptid_t thread_id, void *target_data)
 
   add_inferior_to_list (&all_threads, &new_thread->entry);
 
-  if (current_inferior == NULL)
-    current_inferior = new_thread;
+  if (current_thread == NULL)
+    current_thread = new_thread;
 
   new_thread->target_data = target_data;
 
@@ -230,14 +230,14 @@ set_inferior_target_data (struct thread_info *inferior, void *data)
   inferior->target_data = data;
 }
 
-void *
+struct regcache *
 inferior_regcache_data (struct thread_info *inferior)
 {
   return inferior->regcache_data;
 }
 
 void
-set_inferior_regcache_data (struct thread_info *inferior, void *data)
+set_inferior_regcache_data (struct thread_info *inferior, struct regcache *data)
 {
   inferior->regcache_data = data;
 }
@@ -267,7 +267,7 @@ clear_inferiors (void)
 
   clear_dlls ();
 
-  current_inferior = NULL;
+  current_thread = NULL;
 }
 
 struct process_info *
@@ -355,8 +355,6 @@ get_thread_process (struct thread_info *thread)
 struct process_info *
 current_process (void)
 {
-  if (current_inferior == NULL)
-    fatal ("Current inferior requested, but current_inferior is NULL\n");
-
-  return get_thread_process (current_inferior);
+  gdb_assert (current_thread != NULL);
+  return get_thread_process (current_thread);
 }
This page took 0.025843 seconds and 4 git commands to generate.