diff options
author | Hui Li <lihui@loongson.cn> | 2024-11-25 15:40:03 +0800 |
---|---|---|
committer | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-11-25 19:15:02 +0800 |
commit | 886ebc2b1f226d1ca06a3f0192cd1663c46428b0 (patch) | |
tree | 0585acc88adca47e983c52a81c4f9e980d53e384 /gdb/testsuite | |
parent | 19b5accc3f85734e381d381d38f028c3379fa3a3 (diff) | |
download | gdb-886ebc2b1f226d1ca06a3f0192cd1663c46428b0.zip gdb-886ebc2b1f226d1ca06a3f0192cd1663c46428b0.tar.gz gdb-886ebc2b1f226d1ca06a3f0192cd1663c46428b0.tar.bz2 |
gdb: LoongArch: Add basic process record/replay support
GDB provides a special process record and replay target that can
record a log of the process execution, and replay it later with
both forward and reverse execution commands. This patch adds the
basic support of process record and replay on LoongArch, it allows
users to debug basic LoongArch instructions and provides reverse
debugging support.
Here is a simple example on LoongArch:
$ cat test.c
int a = 0;
int main()
{
a = 1;
a = 2;
return 0;
}
$ gdb test
...
(gdb) start
...
Temporary breakpoint 1, main () at test.c:4
4 a = 1;
(gdb) record
(gdb) p a
$1 = 0
(gdb) n
5 a = 2;
(gdb) n
6 return 0;
(gdb) p a
$2 = 2
(gdb) rn
5 a = 2;
(gdb) rn
Reached end of recorded history; stopping.
Backward execution from here not possible.
main () at test.c:4
4 a = 1;
(gdb) p a
$3 = 0
(gdb) record stop
Process record is stopped and all execution logs are deleted.
(gdb) c
Continuing.
[Inferior 1 (process 129178) exited normally]
Signed-off-by: Hui Li <lihui@loongson.cn>
Approved-By: Guinevere Larsen <guinevere@redhat.com> (record-full)
Approved-By: Tom Tromey <tom@tromey.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2b27d7f..127ab27 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3700,6 +3700,7 @@ proc supports_process_record {} { if { [istarget "arm*-*-linux*"] || [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] || [istarget "aarch64*-*-linux*"] + || [istarget "loongarch*-*-linux*"] || [istarget "powerpc*-*-linux*"] || [istarget "s390*-*-linux*"] } { return 1 @@ -3719,6 +3720,7 @@ proc supports_reverse {} { if { [istarget "arm*-*-linux*"] || [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] || [istarget "aarch64*-*-linux*"] + || [istarget "loongarch*-*-linux*"] || [istarget "powerpc*-*-linux*"] || [istarget "s390*-*-linux*"] } { return 1 |