[1/4] gdb: Fix an infrun debug log message

Message ID cf0aaa0a8b33e33b0613b327a78dac05f84b079d.1527157948.git.andrew.burgess@embecosm.com
State New, archived
Headers

Commit Message

Andrew Burgess May 24, 2018, 10:50 a.m. UTC
  Run the test gdb.threads/multiple-successive-infcall.exp by hand, if
you turn on 'debug infrun 1', you'll see that the debug line fixed in
this commit is printed and contains the wrong $pc value.  Fixed in
this commit.

gdb/ChangeLog:

	* infrun.c (do_target_wait): Change old version of $pc printed.
---
 gdb/ChangeLog | 4 ++++
 gdb/infrun.c  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

Pedro Alves June 11, 2018, 5:53 p.m. UTC | #1
On 05/24/2018 11:50 AM, Andrew Burgess wrote:
> Run the test gdb.threads/multiple-successive-infcall.exp by hand, if
> you turn on 'debug infrun 1', you'll see that the debug line fixed in
> this commit is printed and contains the wrong $pc value.  Fixed in
> this commit.
> 
> gdb/ChangeLog:
> 
> 	* infrun.c (do_target_wait): Change old version of $pc printed.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/infrun.c b/gdb/infrun.c
index df19478ef3c..f86b2aa1c1a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3533,7 +3533,7 @@  do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 	    fprintf_unfiltered (gdb_stdlog,
 				"infrun: PC of %s changed.  was=%s, now=%s\n",
 				target_pid_to_str (tp->ptid),
-				paddress (gdbarch, tp->prev_pc),
+				paddress (gdbarch, tp->suspend.stop_pc),
 				paddress (gdbarch, pc));
 	  discard = 1;
 	}