This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH PR gdb/21870] aarch64: Leftover uncleared debug registers
- From: Wei-min Pan <weimin dot pan at oracle dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 23 Oct 2017 09:38:01 -0700
- Subject: Re: [PING][PATCH PR gdb/21870] aarch64: Leftover uncleared debug registers
- Authentication-results: sourceware.org; auth=none
- References: <1507328314-114545-1-git-send-email-weimin.pan@oracle.com> <300a7ff5-11c4-ef89-907a-c82c08973f29@oracle.com> <CAH=s-PNhL1AqkmARDW7-T-jtgzF1iAh6F1fq1Qm=c_Tg2=T6jA@mail.gmail.com>
Hi Yao,
The most likely explanation is that ptrace() (1) does not validate contents
in either address or control register, and (2) uses some default control
values
when setting hardware breakpoints. (2) is the main reason that contents in
control register becomes non-zero after the aarch64_linux_set_debug_regs()
call. BTW the value of 0x1fc in control register is not random but can be
decoded as:
"a watchpoint which is disabled, priv 2, 8-bytes, and of type hw_access"
Wei-min
On 10/22/2017 2:15 PM, Yao Qi wrote:
On Sat, Oct 21, 2017 at 1:58 AM, Wei-min Pan <weimin.pan@oracle.com> wrote:
Hi Wei-min,
As I asked in comment 3 in PR 21870, could you
help me to understand the bug? I don't see how
does GDB touches hw debug registers, in this case. I have no idea that
why DR_CONTROL_LENGTH (dreg_state.dbg_regs[0].ctrl) is changed to
non-zero.