From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27600 invoked by alias); 16 Sep 2014 13:09:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27576 invoked by uid 89); 16 Sep 2014 13:09:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Sep 2014 13:09:28 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1XTsVZ-0004qh-0W from Luis_Gustavo@mentor.com ; Tue, 16 Sep 2014 06:09:25 -0700 Received: from [172.30.12.157] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.181.6; Tue, 16 Sep 2014 06:09:24 -0700 Message-ID: <54183681.3010504@codesourcery.com> Date: Tue, 16 Sep 2014 13:09:00 -0000 From: Luis Machado Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Joel Brobecker CC: Yao Qi , Subject: Re: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint. References: <1410786062-19274-1-git-send-email-brobecker@adacore.com> <87bnqf2578.fsf@codesourcery.com> <20140916115936.GM4871@adacore.com> <5418279A.1040604@codesourcery.com> <20140916124814.GO4871@adacore.com> In-Reply-To: <20140916124814.GO4871@adacore.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00534.txt.bz2 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. Luis