GNU Binutils with patches for OS216
Revisión | e0139aa5f27ebef0bd92a182beca659e169560ef (tree) |
---|---|
Tiempo | 2016-07-06 15:31:20 |
Autor | Markus Metzger <markus.t.metzger@inte...> |
Commiter | Markus Metzger |
btrace: check if we're replaying when setting the replay position to the end
When setting the replay position to the end there is nothing to do if we are
not replaying. Check that and return immediately.
This avoids printing the current location if we're already at the end.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
gdb/
* record-btrace.c (record_btrace_set_replay): Check if replaying.
testsuite/
* gdb.btrace/record_goto.exp: Test "record goto end" twice.
Change-Id: I4878892408bab293261bbea40d6af28440ff3ec5
@@ -2704,7 +2704,12 @@ record_btrace_set_replay (struct thread_info *tp, | ||
2704 | 2704 | btinfo = &tp->btrace; |
2705 | 2705 | |
2706 | 2706 | if (it == NULL || it->function == NULL) |
2707 | - record_btrace_stop_replaying (tp); | |
2707 | + { | |
2708 | + if (!btrace_is_replaying (tp)) | |
2709 | + return; | |
2710 | + | |
2711 | + record_btrace_stop_replaying (tp); | |
2712 | + } | |
2708 | 2713 | else |
2709 | 2714 | { |
2710 | 2715 | if (btinfo->replay == NULL) |
@@ -160,6 +160,9 @@ gdb_test "record instruction-history -" [multi_line \ | ||
160 | 160 | # check that we can go to the end of the trace |
161 | 161 | gdb_test "record goto end" ".*main \\(\\) at record_goto.c:50.*" |
162 | 162 | |
163 | +# check that we don't repeat the current location if we go to the end again | |
164 | +gdb_test_no_output "record goto end" "goto end again" | |
165 | + | |
163 | 166 | # check that we're filling up the context correctly |
164 | 167 | gdb_test "record function-call-history /ci" [multi_line \ |
165 | 168 | "14\t fun2\tinst 35,36" \ |