From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15051 invoked by alias); 9 Feb 2004 19:21:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15039 invoked from network); 9 Feb 2004 19:21:48 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 9 Feb 2004 19:21:48 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BD6272B92; Mon, 9 Feb 2004 14:21:47 -0500 (EST) Message-ID: <4027DDCB.50003@gnu.org> Date: Mon, 09 Feb 2004 19:21:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: Daniel Jacobowitz , Joel Brobecker , Elena Zannoni Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] use frame IDs to detect function calls while stepping References: <20040205044119.GC18961@gnat.com> <20040205171324.GF18961@gnat.com> <20040205190115.GA9918@nevyn.them.org> <16418.38762.170920.223023@localhost.redhat.com> <20040205194933.GB30363@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00203.txt.bz2 > On Thu, Feb 05, 2004 at 02:20:10PM -0500, Elena Zannoni wrote: > >> Daniel Jacobowitz writes: >> >> > > + if (IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)) >> > > + { >> > > + /* We landed in a shared library call trampoline, so it >> > > + is a subroutine call. */ >> > > + handle_step_into_function (ecs); >> > > + return; >> > > + } >> > > + >> > > + if (frame_id_eq (get_frame_id (get_prev_frame (get_current_frame ())), >> > > + step_frame_id)) >> > > + { >> > > + /* It's a subroutine call. */ >> > > + handle_step_into_function (ecs); >> > > + return; >> > > + } >> > > + >> > >> > get_prev_frame can return NULL. In fact, it generally does in main. >> > >> >> I don't think it matters, frame_id_eq will handle a comparison with >> null_frame_id. > > > Oh, you're right - I was expecting get_frame_id (NULL) to be a problem, > but it isn't. Hmm, I suspect there's a latent bug here. In this context, when at main, get_prev_frame should unconditionally return main's caller. Even when backtrace-beyond-main is false. This suggests that some of the conditions found in get_prev_frame (namely in_entry_func and in_main_func) should be separated out. However, that can be sorted later. Andrew