Bugzilla – Bug 1181478
ptrace_singlestep breaks hardware watchpoints
Last modified: 2022-02-11 12:13:31 UTC
[ Filed here upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=27188 ] Compile this ( https://sourceware.org/git?p=binutils-gdb.git;a=blob_plain;f=gdb/testsuite/gdb.base/gdb11531.c;hb=HEAD ) ... $ gcc src/gdb/testsuite/gdb.base/gdb11531.c -g ... And run this debug session: ... $ gdb -batch a.out \ -ex start \ -ex "watch myrec.x" \ -ex step Temporary breakpoint 1 at 0x4010fa: file gdb11531.c, line 34. Temporary breakpoint 1, main () at gdb11531.c:34 34 myrec.x = 5; Hardware watchpoint 2: myrec.x 35 myrec.y = 3.4; ... The hardware watchpoint doesn't trigger. This problem occurs on factory, not on leap 15.2. This is not related to debug info. When replacing next with continue (such that we use ptrace_cont instead of ptrace_singlestep), the hardware watchpoint triggers. Also, when we disable hardware watchpoints using "set can-use-hw-watchpoints 0" the watchpoint triggers. So, the problem seems to be related to hardware watchpoints and ptrace_singlestep.
Boris, I suspect this is a kernel PR. Reproduces on HW. I got both tw and leap 15.2 installed on the same laptop, and problem only reproduces on tw. Could you take a look?
https://lkml.kernel.org/r/YBMAbQGACujjfz%2Bi@hirez.programming.kicks-ass.net
Closing, because TW is far by v5.11.