From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20104 invoked by alias); 7 Nov 2014 17:37:01 -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 20091 invoked by uid 89); 7 Nov 2014 17:37:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-lb0-f177.google.com Received: from mail-lb0-f177.google.com (HELO mail-lb0-f177.google.com) (209.85.217.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 17:37:00 +0000 Received: by mail-lb0-f177.google.com with SMTP id z12so2960929lbi.8 for ; Fri, 07 Nov 2014 09:36:56 -0800 (PST) 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=wUjuigH0p6mdZnvn16OM6fF4rHEEZ2gSwPOTb2FMM+A=; b=JME20yqfEeP+BpOIPFP3jkkox8hjX4rPxOv1JVih+SYP9J5QKWtHGu6iqsP5cK0DHK kgjsGt1KWpL7uevLIDvzfeRMkPsUmW1bCXpZws5+kIc21/QNQ70drt9C9J2stGI15aA5 tsjGq4qfQpHlpY/ArwGJ6VGXJKkzJ6SJ3pBmTpRCoq3G1K6VskcHAI7ZUhf4gOPGv+ms 2hHdf/s3iT8oODlC+j3ouUMJMOtZJ93OWNx1/LjrhonerSdtrUvdwsfiIbd7ti4pu7Zy m+D1sB6H+ZZieGmi5ROvlN3pz4YkDSqTQDoE396dZmwUu9Ldt86sl55ooqemdshskS4/ 5xgw== X-Gm-Message-State: ALoCoQkMcpa+4uxjw1JNfefDMeBNprNW+O1CxMzfcKvqwPJlcAEkbE1P6NbQ4wkbHrpWeTKuK4LQ MIME-Version: 1.0 X-Received: by 10.112.162.101 with SMTP id xz5mr12146883lbb.49.1415381816891; Fri, 07 Nov 2014 09:36:56 -0800 (PST) Received: by 10.112.59.129 with HTTP; Fri, 7 Nov 2014 09:36:56 -0800 (PST) In-Reply-To: <201411071727.sA7HRNIQ007851@d03av02.boulder.ibm.com> References: <201411071727.sA7HRNIQ007851@d03av02.boulder.ibm.com> Date: Fri, 07 Nov 2014 17:37:00 -0000 Message-ID: Subject: Re: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid From: Martin Galvan To: Ulrich Weigand Cc: gdb-patches@sourceware.org, Doug Evans , Eli Zaretskii , Pedro Alves , Daniel Gutson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-11/txt/msg00147.txt.bz2 On Fri, Nov 7, 2014 at 2:27 PM, Ulrich Weigand wrote: > Martin Galvan wrote: > >> +stack_is_destroyed (gdb_py_ulongest pc) >> +{ >> + return gdbarch_in_function_epilogue_p (python_gdbarch, pc); >> +} > > Just one comment here: python_gdbarch isn't really correct here. > If you have a platform that supports multiple architectures, then > you really should use the appropriate gdbarch for PC. Agreed. I used python_gdbarch because it's used all over the API, so I thought I could use it in here. > Ideally, the Python interface should carry enough information to > determine the appropriate gdbarch, e.g. by operating on a Frame > instead of a plain PC value. If I understand correctly, using a Frame would require the program to be already running by the time we call the API function, which isn't really what we want. > If that isn't possible, one fall-back might be to look up the > symbol table from the PC, and use the associated objfile arch. I'll look into this. 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