This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, AArch64] Fix bug in hardware watchpoint/breakpoint handling


Hi,

This patch fixes an AArch64 GDB bug in handling the hardware debug registers. GDB calls ptrace to set hardware debug registers and it passes a full-length "struct user_hwdebug_state" variable regardless of the number of hardware debug registers available on a target. When there are fewer than 16 (the maximum number) hardware breakpoint/watchpoint registers on a target, the kernel will complain about the gdb's request to set non-existing hardware debug registers. There will be an warning of "Unexpected error setting hardware debug registers" when the inferior starts to run.

This patch fixes the issue by setting iov.iov_len with a value reflecting the exact size in use.

OK for the mainline?

Thanks.
Yufeng


gdb/

        * aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Set
	iov.iov_len with the real length in use.

gdb/gdbserver/

        * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
	iov.iov_len with the real length in use.

Attachment: patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]