From 2590b6456f77cd232d154e0930510c02a01e5be7 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 24 Oct 2012 19:08:16 +0000 Subject: [PATCH] Add comments in ravenscar_sparc_fetch_registers. gdb/ChangeLog: * ravenscar-sparc-thread.c (ravenscar_sparc_fetch_registers): Add comments. --- gdb/ChangeLog | 5 +++++ gdb/ravenscar-sparc-thread.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index be3bb1c2aa5..cc24b22b011 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-10-24 Tristan Gingold + + * ravenscar-sparc-thread.c (ravenscar_sparc_fetch_registers): + Add comments. + 2012-10-24 Joel Brobecker * ravenscar-thread.c (ravenscar_wait): Only update the list diff --git a/gdb/ravenscar-sparc-thread.c b/gdb/ravenscar-sparc-thread.c index 9132109d62b..2a27a6333f9 100644 --- a/gdb/ravenscar-sparc-thread.c +++ b/gdb/ravenscar-sparc-thread.c @@ -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)) -- 2.30.2