From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9732 invoked by alias); 27 Oct 2008 05:00:16 -0000 Received: (qmail 9682 invoked by uid 22791); 27 Oct 2008 05:00:14 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 27 Oct 2008 04:59:39 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 2823153005; Sun, 26 Oct 2008 21:59:37 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost2.vmware.com (Postfix) with ESMTP id 0CF9C8E558; Sun, 26 Oct 2008 21:59:37 -0700 (PDT) Message-ID: <4905496E.9080204@vmware.com> Date: Mon, 27 Oct 2008 05:00:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Michael Snyder CC: Joel Brobecker , "gdb-patches@sourceware.org" , teawater Subject: Re: [RFA] Handle runtime loader dyn sym resolution in reverse References: <49028B5C.2000508@vmware.com> <20081025160945.GI29998@adacore.com> <490546A7.9020002@vmware.com> In-Reply-To: <490546A7.9020002@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-10/txt/msg00653.txt.bz2 Michael Snyder wrote: > Joel Brobecker wrote: > >>> 2008-10-24 Michael Snyder >>> >>> * infrun.c (handle_inferior_event): Handle dynamic symbol >>> resolution in reverse. >> Looks OK to me, but I don't understand why you check that stop_func_start >> is zero. If I were to make a guess, it would be to quickly dismiss >> the case were we reverse stepped into a function call, and so don't >> need to check for trampolines (in other words, a CPU saver). > > Correct, but it's more than a CPU saver. > If we are in a function (stop_func_start is non-zero), > then we can set a step_resume breakpoint and continue, > which is way faster than single stepping. > > We single-step only when we have to, ie. when we have > actually stepped into the fixup jump table. The big difference is, 'in_solib_dynsym_resolve_code' returns true when we're in the dynamic loader function "_dl_runtime_resolve", but we really don't want to single step through that. Since it's a function with a minsym, we can jump over it just like any other function -- but then we hit the jump table and have to singlestep a few times. The test case was sent to me by teawater, who tried to reverse-next over a printf. GDB handled the printf call fine, then it stepped into _dl_runtime_resolve, which it also handled, but it stumbled over the jump table. Committed, by the way.