From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12175 invoked by alias); 24 Oct 2008 02:52:17 -0000 Received: (qmail 12167 invoked by uid 22791); 24 Oct 2008 02:52:16 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Oct 2008 02:51:44 +0000 Received: by ti-out-0910.google.com with SMTP id d10so355999tib.12 for ; Thu, 23 Oct 2008 19:51:41 -0700 (PDT) Received: by 10.110.68.10 with SMTP id q10mr962330tia.37.1224816701060; Thu, 23 Oct 2008 19:51:41 -0700 (PDT) Received: by 10.110.42.9 with HTTP; Thu, 23 Oct 2008 19:51:40 -0700 (PDT) Message-ID: Date: Fri, 24 Oct 2008 02:52:00 -0000 From: teawater To: "Michael Snyder" Subject: Re: [RFA] Deal with get ecs->stop_func_end fail Cc: "gdb-patches@sourceware.org" In-Reply-To: <4901225F.2030008@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4901225F.2030008@vmware.com> 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/msg00601.txt.bz2 OK. Thanks Michael. Hui On Fri, Oct 24, 2008 at 09:18, Michael Snyder wrote: > teawater wrote: >> >> Hi Michael, >> >> I try a program and got: >> (gdb) start >> Temporary breakpoint 1 at 0x80483c1: file 1.c, line 20. >> Starting program: /media/disk/a.out >> >> Temporary breakpoint 1, main () at 1.c:20 >> 20 int b = 0; >> (gdb) rec >> (gdb) n >> 21 int c = 1; >> (gdb) >> 24 printf ("a = %d b = %d c = %d\n", a, b, c); >> (gdb) >> a = 0 b = 0 c = 1 >> 25 b = cool (); >> (gdb) rn >> >> No more reverse-execution history. >> main () at 1.c:20 >> 20 int b = 0; >> >> >> It's clear that "rn" got error. >> This is because: >> find_pc_partial_function (stop_pc, &ecs->stop_func_name, >> &ecs->stop_func_start, &ecs->stop_func_end); >> This part get ecs->stop_func_end is 0. > > Aha. This is because we have stepped backward into > a shared-library trampoline. You understand trampoline? > > It means that this was the first time the program calls > "printf", which is in a shared library, so the program > jumps into a jump table which causes the dymanic runtime > resolver (ld-linux.so) to be called. > > We actually succeeded in "nexting" backward through printf, > and then we succeeded in "nexting" backward thru _dl_runtime_resolver, > but we failed when we hit the trampoline (backward). > > Give me some time, I need to figure out how to handle > trampolines backward! ;-) > > Meanwhile, this is obviously a problem in infrun, so > it does not need to affect your work on record/replay. > > Leave this to me. ;-) > >