From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31107 invoked by alias); 7 Nov 2014 17:09:42 -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 31097 invoked by uid 89); 7 Nov 2014 17:09:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 07 Nov 2014 17:09:41 +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 sA7H9YZP017812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 7 Nov 2014 12:09:34 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA7H9VAp014121; Fri, 7 Nov 2014 12:09:32 -0500 Message-ID: <545CFCCA.1070304@redhat.com> Date: Fri, 07 Nov 2014 17:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Martin Galvan , gdb-patches@sourceware.org, Doug Evans , Eli Zaretskii , Ulrich Weigand , Daniel Gutson Subject: Re: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00144.txt.bz2 On 11/07/2014 01:32 PM, Martin Galvan wrote: > 2) The behavior of handle_step_into_function and setting breakpoints > is inconsistent for optimized code, at least in ARM. If you step into > a function in a program compiled with gcc -O1, you'll see the PC ends > up one instruction after the set of instructions that place the > arguments passed as registers in the registers they'll be used in. If > you do "break myFunction", however, the breakpoint will correctly be > placed at the very first instruction. Both handle_step.. and setting > breakpoints have the same effect on -O0 code. We should really fix this. I can't imagine we do this on purpose. > If we look at how "break myFunction" works, we'll see that we end up > calling find_function_start_sal to determine at which PC we have to > place our breakpoint. Therefore, that's the function we should be > calling when checking whether the stack frame will be valid at a > prologue, as it also accounts for optimizations. We expose functions and sals as python objects. Shouldn't we instead consider exposing find_function_start_sal in the function object? Or maybe symbol_to_sal in the Symbol object? I can well imagine these being useful to other use cases. Thanks, Pedro Alves