Support arch-dependent fill
[binutils-gdb.git] / gdb / ravenscar-thread.c
index 173ab7fb82d0d21238fd165988ec37729345e50e..63ecad5440a39faa1bd4a68706222529ea09608f 100644 (file)
@@ -1,6 +1,6 @@
 /* Ada Ravenscar thread support.
 
-   Copyright 2004, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright 2004, 2009-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -51,8 +51,10 @@ static ptid_t base_ptid;
 static const char running_thread_name[] = "__gnat_running_thread_table";
 
 static const char known_tasks_name[] = "system__tasking__debug__known_tasks";
+static const char first_task_name[] = "system__tasking__debug__first_task";
 
-static const char ravenscar_runtime_initializer[] = "system__bb__threads__initialize";
+static const char ravenscar_runtime_initializer[] =
+  "system__bb__threads__initialize";
 
 static struct observer *update_target_observer = NULL;
 
@@ -134,10 +136,12 @@ has_ravenscar_runtime (void)
     lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL);
   struct minimal_symbol *msym_known_tasks =
     lookup_minimal_symbol (known_tasks_name, NULL, NULL);
+  struct minimal_symbol *msym_first_task =
+    lookup_minimal_symbol (first_task_name, NULL, NULL);
   struct minimal_symbol *msym_running_thread = get_running_thread_msymbol ();
 
   return (msym_ravenscar_runtime_initializer
-         && msym_known_tasks
+         && (msym_known_tasks || msym_first_task)
          && msym_running_thread);
 }
 
@@ -218,7 +222,7 @@ ravenscar_add_thread (struct ada_task_info *task)
 static void
 ravenscar_find_new_threads (struct target_ops *ops)
 {
-  ada_build_task_list (0);
+  ada_build_task_list ();
 
   /* Do not clear the thread list before adding the Ada task, to keep
      the thread that the process stratum has included into it
@@ -329,7 +333,7 @@ ravenscar_register_arch_ops (struct ravenscar_arch_ops *ops)
      architectures, just like in remote-wtx-hw.c.  However, for now the
      only Ravenscar run-time for bare board that is implemented in
      GNAT is for only one architecture: erc32-elf.  So no need to care about
-     that for now...*/
+     that for now...  */
   current_arch_ops = ops;
 }