From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21743 invoked by alias); 15 May 2009 15:51:22 -0000 Received: (qmail 21727 invoked by uid 22791); 15 May 2009 15:51:17 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 May 2009 15:51:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2B5562BAB75; Fri, 15 May 2009 11:51:09 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id w4vxNJsiiRxG; Fri, 15 May 2009 11:51:09 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F256F2BAB49; Fri, 15 May 2009 11:51:08 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E2776F5962; Fri, 15 May 2009 17:51:06 +0200 (CEST) Date: Fri, 15 May 2009 15:51:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Add hardware breapoints in procfs.c Message-ID: <20090515155106.GP7292@adacore.com> References: <003701c9d4da$6c4f5fb0$44ee1f10$@u-strasbg.fr> <003801c9d4db$380e2ff0$a82a8fd0$@u-strasbg.fr> <20090515154125.GO7292@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090515154125.GO7292@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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 X-SW-Source: 2009-05/txt/msg00328.txt.bz2 > > * procfs.c (procfs_insert_hw_breakpoint, procfs_remove_hw_breakpoint): > > New functions. > > (procfs_use_watchpoints): Register new hardware breakpoint related > > target functions. > > I don't know procfs enough to review the patch accurately. I think > that the part for removing the watchpoint is correct Actually, target_insert/remove_hw_breakpoint are supposed to return non-zero if the operation failed. However, if you look at the implementation of procfs_set_watchpoint: procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, int after) { #ifndef UNIXWARE #ifndef AIX5 [...] #endif /* AIX5 */ #endif /* UNIXWARE */ return 0; } In other words, if h/w watchpoints are not supported, this function returns zero. Use that directly to insert h/w breakpoints on a system where this feature is not implemented would lead the debugger to think that the breakpoint was inserted when in fact it wasn't. -- Joel