From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31478 invoked by alias); 22 Oct 2014 17:33:22 -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 31469 invoked by uid 89); 22 Oct 2014 17:33:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-lb0-f180.google.com Received: from mail-lb0-f180.google.com (HELO mail-lb0-f180.google.com) (209.85.217.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 22 Oct 2014 17:33:20 +0000 Received: by mail-lb0-f180.google.com with SMTP id n15so3261360lbi.11 for ; Wed, 22 Oct 2014 10:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5VKVeBdPShHFDOQ3CnJj4JwjFy5QvQTmW0zlPKFPUpU=; b=J7gqpSFCN5o9i0y53N6eb2yqPpDYlf2KnVz8Q+IdovG06cozV/MRPH5Cgxo+qmfrQ8 LCNiCSl3eteAoZ2SIBLNoefMpl0gNNnWB3mW7C4QaD7reb8xcBDsp2pJPaTJfPgAKN3v IXkqFmUgu4cEhZghizDIfk36Ozh/I4chWvE1vIArb84SeGD1a6r16ZVhUa5MhBkSON/x QtPHAp6wK4JIXCfXvmK38OMWKhjE1VWhpAOWOu2Krpwdhbps1laL5M1wF7Z5vlQYhkol 9fzyGw5kdMwDoH4ADKHoJGzYY0Ig7qR8AGOQyP0j/gYin3KRLyrdLpTmx2B9lCAwZuOJ lGhw== X-Gm-Message-State: ALoCoQkZFMWTdnFIGauE2dPZf/pg6nTtoOYqhywFwwWWMOZWgvgdY/O30Xuomtw1U0J0ljjmdK5/ MIME-Version: 1.0 X-Received: by 10.112.85.106 with SMTP id g10mr42633391lbz.38.1413999195885; Wed, 22 Oct 2014 10:33:15 -0700 (PDT) Received: by 10.112.59.129 with HTTP; Wed, 22 Oct 2014 10:33:15 -0700 (PDT) In-Reply-To: <83tx2w87j0.fsf@gnu.org> References: <1413986485-4673-1-git-send-email-martin.galvan@tallertechnologies.com> <83tx2w87j0.fsf@gnu.org> Date: Wed, 22 Oct 2014 17:33:00 -0000 Message-ID: Subject: Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue. From: Martin Galvan To: Eli Zaretskii Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-10/txt/msg00583.txt.bz2 On Wed, Oct 22, 2014 at 12:10 PM, Eli Zaretskii wrote: >> From: Martin Galvan >> Cc: Martin Galvan >> +In general you shouldn't worry about passing a @var{functionStart} >> +argument unless your binary doesn't have debugging info, in which case >> +ommiting @var{functionStart} may result in @code{True} being returned >> +when the @var{pc} is not actually inside a prologue. > > Isn't it better to require this argument in that case? Zero is not > very useful starting address, in most cases. I looked at this again and I think it should stay as an optional argument. GDB's in_prologue will only check for the functionStart argument when it has no other way to determine whether the given PC belongs to a prologue; otherwise it'll just ignore it. Because of this, is_in_prologue will return True if we pass it a pc that belongs to a prologue together with any valid address regardless of it being a function start, let alone the function PC belongs to. Making it a required argument to me sounds like we're asking is_in_prologue whether PC is in the prologue of the function starting at functionStart, instead of simply telling whether PC belongs to any prologue (which was my original intent). I thought of removing the functionStart argument altogether, however if we're working without debugging info but we're certain of where the function starts we can still get an accurate result instead of a false positive. Let me know what you think of this so I can send v2 (I'll also include a few minor corrections such as correctly casting gdbpy_is_in_prologue to PyCFunction in the method table). --=20 Mart=C3=ADn Galv=C3=A1n Software Engineer Taller Technologies Argentina San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: 54 351 4217888 / +54 351 4218211