Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

GDB on NetBSD/aarch64 - EBUSY issue analysis

GNU GDB expects PT_STEP to be defined for the aarch64 target and
supported by the kernel.

In case of undefined, it redefines it to 9 in dist/gdb/nat/gdb_ptrace.h:

#ifndef PT_STEP
# ifdef PT_SINGLE1
#  define PT_STEP       PT_SINGLE1
# else
#  define PT_STEP       9       /* Single step the child.   */
# endif

On NetBSD 9 is PT_ATTACH. This causes EBUSY error from GDB as it
attempts to set an early trap followed by a single-step and this results
with an error.

aarch64 implements software instruction to perform a hardware assisted

GDB expects this behavior to be implemented by OS.

FreeBSD already supports this feature:


A partial support for PT_STEP for arm64 exists in OpenBSD:


I recommend to add support for PT_STEP in aarch64, following FreeBSD and
other featured OSes.

Existing ATF-tests for single-step probably shall be modified and
adapted for the aarch64 specifics. As far as I understand, we must
insert trap instruction into tracee's .text section.

Attachment: signature.asc
Description: OpenPGP digital signature

Home | Main Index | Thread Index | Old Index