[commit/gdbserver] Don't lose decr_pc_after_break adjustment

Pedro Alves pedro@codesourcery.com
Thu Jan 21 15:37:00 GMT 2010


This can't be triggered currently.  I found this out while implementing trap tracepoint support.  We were reaching here with the decr_pc_after_break adjustment already done on the register cache, but, since we're refetching
the register set, we were losing that adjustment.  The thread would then
crash when resumed, due to resuming at the unadjusted address.  There's
no reason to refetch registers here, since get_thread_regcache fetches
all registers if they haven't been fetched yet.

-- 
Pedro Alves

2010-01-21  Pedro Alves  <pedro@codesourcery.com>

	gdb/gdbserver/
	* proc-service.c (ps_lgetregs): Don't refetch registers from the
	target.

---
 gdb/gdbserver/proc-service.c |    1 -
 1 file changed, 1 deletion(-)

Index: src/gdb/gdbserver/proc-service.c
===================================================================
--- src.orig/gdb/gdbserver/proc-service.c	2010-01-21 14:44:14.000000000 +0000
+++ src/gdb/gdbserver/proc-service.c	2010-01-21 14:45:30.000000000 +0000
@@ -111,7 +111,6 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwp
   save_inferior = current_inferior;
   current_inferior = reg_inferior;
   regcache = get_thread_regcache (current_inferior, 1);
-  the_target->fetch_registers (regcache, -1);
   gregset_info ()->fill_function (regcache, gregset);
 
   current_inferior = save_inferior;



More information about the Gdb-patches mailing list