From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29075 invoked by alias); 28 Jul 2012 07:42:34 -0000 Received: (qmail 28963 invoked by uid 22791); 28 Jul 2012 07:42:31 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 28 Jul 2012 07:42:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6S7flO6016311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 28 Jul 2012 03:41:47 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6S7ffDW025106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 28 Jul 2012 03:41:44 -0400 Date: Sat, 28 Jul 2012 07:42:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: philippe.waroquiers@skynet.be, palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org, macro@codesourcery.com Subject: Re: [patchv2] Write bpt at the ON_STACK bpt address Message-ID: <20120728074134.GA6487@host2.jankratochvil.net> References: <20120727184633.GA14182@host2.jankratochvil.net> <83k3xoibul.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83k3xoibul.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-07/txt/msg00718.txt.bz2 On Sat, 28 Jul 2012 09:28:02 +0200, Eli Zaretskii wrote: > > Date: Fri, 27 Jul 2012 20:46:33 +0200 > > From: Jan Kratochvil > > Cc: Joel Brobecker , gdb-patches@sourceware.org, "Maciej W. Rozycki" > > > > -breakpoint should be inserted. May return @code{NULL} to indicate that > > -software breakpoints are not supported. > > +breakpoint should be inserted. The program counter (@code{*@var{pcptr}} > > +is inferior PC register encoded on the input and it is a plain address on the > > +output. Function may return @code{NULL} to indicate that software breakpoints > > +are not supported. > > I suggest a slight rewording: > > On input, the program counter (@code{*@var{pcptr}} is the encoded > inferior's PC register. The function returns the PC's plain address > in this argument, or @code{NULL} if software breakpoints are not > supported. > > Does this catch the intent correctly? I do not think that 'pcptr' and 'NULL' should be combined in one sentence, these are two topics. BTW I did not change any function behavior, I just try to better document behavior of the existing functions. One issue is that: Function may return @code{NULL} to indicate that software breakpoints are not supported. This is returned as C function return value. If NULL is returned other parameters are irrelevant/unspecified. And NULL is definitely unrelated to pcptr. The other issue, I try to better document the meaning of '*pcptr' input vs. output value. This is a value passed by reference. Also it is not really the PC register, it is just arbitrary location used for a breakpoint (therefore pointing at code instructions). I tried to reword it again and I ended up similar to my former proposal: On input, the program counter (@code{*@var{pcptr}} is encoded like the inferior's PC register, on output is is encoded as a plain address. Function may return @code{NULL} to indicate that software breakpoints are not supported. Thanks, Jan