This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Displaced stepping debug: fetch the right regcache


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d9b67d9f4127191679c743d1f47d2421d6dcede7

commit d9b67d9f4127191679c743d1f47d2421d6dcede7
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Apr 7 11:42:09 2015 +0100

    Displaced stepping debug: fetch the right regcache
    
    Although not currently possible in practice when we get here,
    'resume_ptid' can also be a wildcard throughout this function.  It's
    clearer to fetch the regcache using the thread's ptid.
    
    gdb/ChangeLog:
    2015-04-07  Pedro Alves  <pedro@codesourcery.com>
    
    	* infrun.c (resume) <displaced stepping debug output>: Get the
    	leader thread's regcache, not resume_ptid's.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/infrun.c  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cfe7961..ef9dd65 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-07  Pedro Alves  <pedro@codesourcery.com>
+
+	* infrun.c (resume) <displaced stepping debug output>: Get the
+	leader thread's regcache, not resume_ptid's.
+
 2015-04-06  Doug Evans  <xdje42@gmail.com>
 
 	* symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as
diff --git a/gdb/infrun.c b/gdb/infrun.c
index f5faa0a..607a6e4 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2364,7 +2364,7 @@ resume (enum gdb_signal sig)
       && use_displaced_stepping (gdbarch)
       && tp->control.trap_expected)
     {
-      struct regcache *resume_regcache = get_thread_regcache (resume_ptid);
+      struct regcache *resume_regcache = get_thread_regcache (tp->ptid);
       struct gdbarch *resume_gdbarch = get_regcache_arch (resume_regcache);
       CORE_ADDR actual_pc = regcache_read_pc (resume_regcache);
       gdb_byte buf[4];


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]