diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index c50e11b..9fbff15 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -1300,16 +1300,6 @@ record_btrace_start_replaying (struct thread_info *tp) gdb_assert (btinfo->replay == NULL); btinfo->replay = replay; - /* Make sure we're not using any stale registers. */ - registers_changed_ptid (tp->ptid); - - /* We just started replaying. The frame id cached for stepping is based - on unwinding, not on branch tracing. Recompute it. */ - frame = get_current_frame_nocheck (); - insn = btrace_insn_get (replay); - sal = find_pc_line (insn->pc, 0); - set_step_info (frame, sal); - return replay; } @@ -1324,9 +1314,6 @@ record_btrace_stop_replaying (struct thread_info *tp) xfree (btinfo->replay); btinfo->replay = NULL; - - /* Make sure we're not leaving any stale registers. */ - registers_changed_ptid (tp->ptid); } /* The to_resume method of target record-btrace. */ @@ -1619,10 +1606,6 @@ record_btrace_wait (struct target_ops *ops, ptid_t ptid, /* Start record histories anew from the current position. */ record_btrace_clear_histories (&tp->btrace); - /* GDB seems to need this. Without, a stale PC seems to be used resulting in - the current location to be displayed incorrectly. */ - registers_changed_ptid (tp->ptid); - return tp->ptid; } @@ -1662,6 +1645,8 @@ record_btrace_goto_target (struct thread_info *tp, struct btrace_insn_iterator *goto_target; struct btrace_thread_info *btinfo; struct target_waitstatus ws; + struct btrace_insn_iterator target_it; + volatile struct gdb_exception exception; btinfo = &tp->btrace; @@ -1686,11 +1671,17 @@ record_btrace_goto_target (struct thread_info *tp, btinfo->flags |= BTHR_GOTO; btinfo->goto_target = goto_target; -#if 0 + TRY_CATCH (exception, RETURN_MASK_ALL) + { + +#if 1 if (goto_target != NULL) + target_it = *goto_target; + else + btrace_insn_end (&target_it, btinfo); tp->control.exception_resume_breakpoint = set_momentary_breakpoint_at_pc (target_gdbarch (), - btrace_insn_get (goto_target)->pc, + btrace_insn_get (&target_it)->pc, bp_until); #endif #if 0 @@ -1701,8 +1692,18 @@ record_btrace_goto_target (struct thread_info *tp, proceed ((CORE_ADDR) -1, GDB_SIGNAL_0, 0); #endif - if (btinfo->goto_target != NULL || (btinfo->flags & BTHR_GOTO) != 0) + // It will need a fix if reverse mode supports target-async mode. + if ((btinfo->flags & BTHR_GOTO) != 0) error (_("Record goto failed.")); + gdb_assert (btinfo->goto_target == NULL); + + } + if (exception.reason < 0) + { + xfree (btinfo->goto_target); + btinfo->goto_target = NULL; + btinfo->flags &= ~BTHR_GOTO; + } } /* The to_goto_record_begin method of target record-btrace. */