diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2024-07-15 16:29:36 +0200 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2024-07-15 18:24:57 +0200 |
commit | e7c91a1ff9e0f87f79f630296219765a6ab1f3e3 (patch) | |
tree | 71599d1d1dd51db501e232919b2e00a45acd24c1 /gdb | |
parent | 4a8ff366559a7ff9f9de80007d4b74770a54edee (diff) | |
download | gdb-e7c91a1ff9e0f87f79f630296219765a6ab1f3e3.zip gdb-e7c91a1ff9e0f87f79f630296219765a6ab1f3e3.tar.gz gdb-e7c91a1ff9e0f87f79f630296219765a6ab1f3e3.tar.bz2 |
Fix loading a saved recording
Currently you get this assertion failure if you try to execute the
inferior after loading a saved recording, when no recording was done
earlier in the same gdb session:
```
$ gdb -q c -ex "record restore test.rec"
Reading symbols from c...
[New LWP 26428]
Core was generated by `/tmp/c'.
Restored records from core file /tmp/test.rec.
(gdb) c
Continuing.
../../gdb/inferior.c:293: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
```
The change in step-precsave.exp triggers this bug, since now the
recording is loaded in a new gdb session, where
record_full_resume_ptid was never set.
The fix is to simply set record_full_resume_ptid when resuming a loaded
recording.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31971
Approved-By: Guinevere Larsen <blarsen@redhat.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/record-full.c | 1 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/step-precsave.exp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/gdb/record-full.c b/gdb/record-full.c index c51aadf..3e42889 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -2072,6 +2072,7 @@ record_full_core_target::resume (ptid_t ptid, int step, enum gdb_signal signal) { record_full_resume_step = step; + record_full_resume_ptid = ptid; record_full_resumed = 1; record_full_execution_dir = ::execution_direction; } diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp index d937763..9ae67b3 100644 --- a/gdb/testsuite/gdb.reverse/step-precsave.exp +++ b/gdb/testsuite/gdb.reverse/step-precsave.exp @@ -69,6 +69,8 @@ with_timeout_factor 10 { gdb_test "kill" "" "kill process, prepare to debug log file" \ "Kill the program being debugged\\? \\(y or n\\) " "y" +clean_restart ${binfile} + gdb_test "record restore $precsave" \ "Restored records from core file .*" \ "reload core file" |