This is the mail archive of the
mailing list for the GDB project.
Re: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint.
- From: Pedro Alves <palves at redhat dot com>
- To: Terry Guo <terry dot guo at arm dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- Cc: lgustavo at codesourcery dot com, Joel Brobecker <brobecker at adacore dot com>, Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 16 Sep 2014 16:21:18 +0100
- Subject: Re: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint.
- Authentication-results: sourceware.org; auth=none
- References: <1410786062-19274-1-git-send-email-brobecker at adacore dot com> <87bnqf2578 dot fsf at codesourcery dot com> <20140916115936 dot GM4871 at adacore dot com> <5418279A dot 1040604 at codesourcery dot com> <20140916124814 dot GO4871 at adacore dot com> <54183681 dot 3010504 at codesourcery dot com>
Hi Terry, Marcus,
Can someone at ARM shed some light on this, please?
This thread is here:
And the discussion started in another thread here:
I've just added a test that hopefully helps with this, btw:
I'm also wondering whether Aarch64 needs adjustment as well.
On 09/16/2014 02:09 PM, Luis Machado wrote:
> On 09/16/2014 09:48 AM, Joel Brobecker wrote:
>>>> I think the experiments that were run showed that QEMU is in fact
>>>> correct and should NOT be changed.
>>> Do we know what the Linux kernel's behavior on this one is? I wonder
>>> what the stopped data address shows.
>>> Someone with access to a board with a relatively new kernel could
>>> try that and rule it out, otherwise we risk fixing something for
>>> QEMU/bare metal and breaking things for Linux.
>> When I tested on GNU/Linux, watchpoints simply did not work
>> (silently ignored, no signal). I was using an old kernel (2012),
>> though; but that's all I had access to. But, all in all, baremetal
>> should be our most reliable source of info, though,no? - no software
>> layer to murky the waters.
> It is hard to tell. ARM's documentation is not clear. For example, this
> is probably where the stopped data address should be coming from:
> WFAR - Watchpoint Fault Address Register
> The WFAR is updated to indicate the address of the instruction that
> accessed the watchpointed address:
> - the address of the instruction + 8 in ARM state
> - the address of the instruction + 4 in Thumb® state
> So it seems in line with what we are seeing? The program being trapped
> two instructions after the data fault?
> If it stops just a single instruction after the data fault, then someone
> (probe, emulator or kernel) may be trying to help GDB by decrementing
> the data fault address.