From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16540 invoked by alias); 6 Jul 2011 16:12:10 -0000 Received: (qmail 16528 invoked by uid 22791); 6 Jul 2011 16:12:08 -0000 X-SWARE-Spam-Status: No, hits=-2.0 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; Wed, 06 Jul 2011 16:11:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 953D32BAC6B; Wed, 6 Jul 2011 12:11:53 -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 2SGyknTaUARa; Wed, 6 Jul 2011 12:11:53 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 64D9E2BABBD; Wed, 6 Jul 2011 12:11:53 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DF610145615; Wed, 6 Jul 2011 09:11:50 -0700 (PDT) Date: Wed, 06 Jul 2011 16:12:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Thiago Jung Bauermann , gdb-patches ml Subject: Re: [RFA] Make ppc-linux-nat insert/remove breakpoint and watchpoint functions return -1. Message-ID: <20110706161150.GD2407@adacore.com> References: <1309897267.3634.6.camel@hactar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-07/txt/msg00197.txt.bz2 > >>>>> "Thiago" == Thiago Jung Bauermann writes: > > Thiago> target_{insert,remove}_{hw_breakpoint,watchpoint,mask_watchpoint} are > Thiago> supposed to return 0, 1 and -1 for success, unsupported and error, > Thiago> respectively. > > I looked around for anything saying this, and couldn't find it. > Well -- I found it for target_insert_mask_watchpoint, but not other > cases. > > And, at least in breakpoint.c:insert_bp_location, it seems to me that > the return value is expected to be an errno in one case -- search for > safe_strerror. > > Maybe this code is in error? I really couldn't say; but it seems > inconsistent at best. Perhaps only parts of your patch could go in > as-is, what do you think? Looking at target.h: | /* Insert a breakpoint at address BP_TGT->placed_address in the target | machine. Result is 0 for success, or an errno value. */ | | extern int target_insert_breakpoint (struct gdbarch *gdbarch, | struct bp_target_info *bp_tgt); It's a little bit confusing because some methods are implemented inside the target_ops vector, while some others are documented via the target_... function. That being said, it's ultra important IMO in that case that we add the documentation wherever missing, because these are used by all ports. And I remember scratching my head quite a bit a while ago when I was working on watchpoint support for VxWorks. In any case, all this rambling to say that breakpoint.c is correct in this case. -- Joel