From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16008 invoked by alias); 22 Oct 2014 18:06:17 -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 15988 invoked by uid 89); 22 Oct 2014 18:06:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-lb0-f171.google.com Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com) (209.85.217.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 22 Oct 2014 18:06:16 +0000 Received: by mail-lb0-f171.google.com with SMTP id z12so3328377lbi.30 for ; Wed, 22 Oct 2014 11:06:11 -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:content-type:content-transfer-encoding; bh=gDPVKzyb8+LaaWTh1zel9u94T+wtw3wyguRhrkGfiik=; b=IPNOPjoNyU4tmGUpOOk5dqCeIvLpmF2BoXpCaDmjypc15sEGLXwuvjTSwUgjhC5QbJ x38aAWYU1rQdvjFUXIE2hGBDENquZuEb+lFGE8/Jv+NThxFTYQoFv4gLoEtaO9zoolY2 /ltfbgJVo7UaZ/zcDnb9yiPCja3x1J3rpvwjjYUGM4QQLNSOY+I3W5U3IR5/p/GqXXiW sBIAI04Jtgy2EVzHz7yvEps23B4SbNDFkJpX7RREBcF+P428z2VBCfh/zRtH8WEH2hUB KMTsKrUb8TUgC6Nhj1NUz+e1wXIQs87A9FN5TGlB/fHZ8ICmqvnIV8bKPenDqDCzS48l KS9Q== X-Gm-Message-State: ALoCoQnFLFoAJwE7XaYQgMCSN/WBSdFCcrnXoLXn+YcramcwgZY2gHiKP5GFQHflCo0VdNoT8Hyk MIME-Version: 1.0 X-Received: by 10.152.206.36 with SMTP id ll4mr43989851lac.64.1414001171382; Wed, 22 Oct 2014 11:06:11 -0700 (PDT) Received: by 10.112.59.129 with HTTP; Wed, 22 Oct 2014 11:06:11 -0700 (PDT) In-Reply-To: <83fveg809v.fsf@gnu.org> References: <1413986485-4673-1-git-send-email-martin.galvan@tallertechnologies.com> <83tx2w87j0.fsf@gnu.org> <83fveg809v.fsf@gnu.org> Date: Wed, 22 Oct 2014 18:06: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 , gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-10/txt/msg00585.txt.bz2 On Wed, Oct 22, 2014 at 2:47 PM, Eli Zaretskii wrote: > I think we are miscommunicating. What I had in mind is raise an > exception or display an error message when GDB has no other means to > determine where the function's start is (e.g., no debug info), and no > functionStart argument was passed. That is what I meant by > "require". IOW, it's up to the user to decide when to provide it, but > GDB will refuse to use some arbitrary number, such as zero, if it > cannot determine the starting address. Oh, I see. That's a great idea. I think the simplest way to do this is not to call GDB's in_prologue directly from gdbpy_is_in_prologue, but reproduce some of its behavior and adding a check on the return value of find_pc_partial_function which will throw an exception if functionStart wasn't provided. This may result in a bit of duplicated code, but in_prologue isn't that long a function if you take the comments out so I don't think that would be a problem. What do you think? > (Btw, using mixed-case argument names in thge manual is a bad idea, > because in the Info format @var causes its argument to be up-cased.) Indeed, will also change that. Thanks a lot! --=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