gdb/
[binutils-gdb.git] / gdb / ravenscar-sparc-thread.c
index c799e79676a78e5f638d844e928322507e613206..2a27a6333f90d22ba9302e90c597a95123cc4040 100644 (file)
@@ -1,6 +1,6 @@
 /* Ravenscar SPARC target support.
 
-   Copyright 2004, 2010 Free Software Foundation, Inc.
+   Copyright 2004, 2010-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,8 +33,8 @@ static void ravenscar_sparc_store_registers (struct regcache *regcache,
 static void ravenscar_sparc_prepare_to_store (struct regcache *regcache);
 
 /* Register offsets from a referenced address (exempli gratia the
-   Thread_Descriptor). The referenced address depends on the register
-   number. The Thread_Descriptor layout and the stack layout are documented
+   Thread_Descriptor).  The referenced address depends on the register
+   number.  The Thread_Descriptor layout and the stack layout are documented
    in the GNAT sources, in sparc-bb.h.  */
 
 static const int sparc_register_offsets[] =
@@ -112,12 +112,16 @@ ravenscar_sparc_fetch_registers (struct regcache *regcache, int regnum)
   CORE_ADDR thread_descriptor_address;
   ULONGEST stack_address;
 
+  /* The tid is the thread_id field, which is a pointer to the thread.  */
   thread_descriptor_address = (CORE_ADDR) ptid_get_tid (inferior_ptid);
+
+  /* Read the saved SP in the context buffer.  */
   current_address = thread_descriptor_address
     + sparc_register_offsets [sp_regnum];
   supply_register_at_address (regcache, sp_regnum, current_address);
   regcache_cooked_read_unsigned (regcache, sp_regnum, &stack_address);
 
+  /* Read registers.  */
   for (current_regnum = 0; current_regnum < num_regs; current_regnum ++)
     {
       if (register_in_thread_descriptor_p (current_regnum))
@@ -175,6 +179,9 @@ ravenscar_sparc_store_registers (struct regcache *regcache, int regnum)
                 buf_size);
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern void _initialize_ravenscar_sparc (void);
+
 void
 _initialize_ravenscar_sparc (void)
 {