diff options
| author | Tom de Vries <tdevries@suse.de> | 2026-03-25 14:08:17 +0100 |
|---|---|---|
| committer | Tom de Vries <tdevries@suse.de> | 2026-03-25 14:08:17 +0100 |
| commit | b77de06b8b4d4c8365b6885d6baa5589460d949b (patch) | |
| tree | 27d216f89acd8b84af2523244fb01a03ed8a2183 /gdb/python/python-config.py | |
| parent | 9182483255cc14ae5478ecb10896ef5f274e53c9 (diff) | |
| download | binutils-b77de06b8b4d4c8365b6885d6baa5589460d949b.tar.gz binutils-b77de06b8b4d4c8365b6885d6baa5589460d949b.tar.bz2 binutils-b77de06b8b4d4c8365b6885d6baa5589460d949b.zip | |
[gdb/record] Fix syscall exit recording for arm
[ Submitted earlier [1] with $subject: "[PATCH] [gdb/record] Fix syscall
recording for arm". ]
On arm-linux, I run into:
...
(gdb) continue^M
Continuing.^M
The next instruction is syscall exit_group. It will make the program exit. \
Do you want to stop the program?([y] or n) yes^M
Process record does not support instruction 0xdf00 at address 0xf7e8f984.^M
Process record: failed to record execution log.^M
^M
Program stopped.^M
__libc_do_syscall () at libc-do-syscall.S:46^M
warning: 46 libc-do-syscall.S: No such file or directory^M
(gdb) FAIL: gdb.reverse/sigall-reverse.exp: continue to signal exit
...
The problem is this bit of code here in decode_insn:
...
ret = thumb2_record_decode_insn_handler (arm_record);
if (ret != ARM_RECORD_SUCCESS)
{
arm_record_unsupported_insn (arm_record);
ret = -1;
}
...
where ret == 1 is mapped to -1.
The 1 is returned by arm_linux_syscall_record and is meant to be interpreted
using this categorization:
- res < 0: Process record: failed to record execution log.
- res == 0: No failure.
- res > 0: Process record: inferior program stopped.
But the port interprets 1 as ARM_RECORD_FAILURE:
...
enum arm_record_result
{
ARM_RECORD_SUCCESS = 0,
ARM_RECORD_FAILURE = 1
};
...
We could fix this confusion this by:
- adding an ARM_RECORD_UNKNOWN = 2, and
- applying translations at the appropriate points, translating:
- ARM_RECORD_UNKNOWN into 1 and vice versa,
- ARM_RECORD_FAILURE into -1 and vice versa,
similar to what we did for aarch64 and loongarch.
But it seems easier to adopt a go-with-the-flow approach, defining
ARM_RECORD_FAILURE as -1, freeing up the 1 for ARM_RECORD_UNKNOWN = 1.
Then the aforementioned FAIL is fixed by simply doing:
...
if (ret == ARM_RECORD_FAILURE)
arm_record_unsupported_insn (arm_record);
...
Tested on arm-linux.
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
[1] https://sourceware.org/pipermail/gdb-patches/2026-February/225372.html
Diffstat (limited to 'gdb/python/python-config.py')
0 files changed, 0 insertions, 0 deletions
