From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10845 invoked by alias); 20 Aug 2008 16:58:51 -0000 Received: (qmail 10836 invoked by uid 22791); 20 Aug 2008 16:58:50 -0000 X-Spam-Check-By: sourceware.org Received: from yx-out-1718.google.com (HELO yx-out-1718.google.com) (74.125.44.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Aug 2008 16:58:02 +0000 Received: by yx-out-1718.google.com with SMTP id 3so240347yxi.48 for ; Wed, 20 Aug 2008 09:58:00 -0700 (PDT) Received: by 10.187.213.16 with SMTP id p16mr22966faq.73.1219251479471; Wed, 20 Aug 2008 09:57:59 -0700 (PDT) Received: by 10.187.224.15 with HTTP; Wed, 20 Aug 2008 09:57:59 -0700 (PDT) Message-ID: <8a15eb2b0808200957g5fd46a96xb2e69ac60074103a@mail.gmail.com> Date: Thu, 21 Aug 2008 03:08:00 -0000 From: "Gabe Black" Reply-To: gabe@blackfam.net To: gdb@sourceware.org Subject: How to get remote target to break on memory access (use z-packet) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00232.txt.bz2 Hi, I have a remote target in which I do not have any sort of symbols loaded. I simply launch gdb and open a remote serial debugging session (target remote /dev/ttyS0). However, I am unable to set any sort of break-on-memory-access breakpoints that take advantage of the processors debug registers (the target is i386 architecture). I have even tried setting all the attributes that I can find related to watchpoints or hardware breakpoints (i.e. set can-use-hw-watchpoints 1, remote hardware-breakpoint-packet, etc.). I have a serial port monitor and I see that it never attempts to send the Z packet which is what is documented as the way to set hw breakpoints. I have tried the mingw version of gdb (v. 6.8), and the gdbs that come with the distributions of ubuntu, and fedora. Some of the examples that I have done for setting a breakpoint are awatch *0x2f3000, hbreak *0x2f3000, watch *(int*)0x2f3000. Ubuntu's version of gdb segfaults after hitting continue, while the mingw versions and fedora behave the same. They simply read the memory location when setting the breakpoint and no z-packets, even after continuing execution. Is there something I am doing wrong? I really would like to be able to set break-on-access hardware assisted breakpoints on a memory location, but I am unable to see any sort of z-packet sent. Again this is without using any symbols for the target. The target is not using any executables that have a symbol format that gdb understands currently (the binaries were not compiled with gcc or any variant) so symbol information is not available right now (although work is being done to add that support). However, in the mean time, I would like to be able to debug the target with the assistance of those hardware supported breakpoints, even if the only view I have right now is a simple disassembly view. Thank you, Gabe