From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13204 invoked by alias); 25 Oct 2008 06:50:43 -0000 Received: (qmail 13186 invoked by uid 22791); 25 Oct 2008 06:50:41 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.185) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Oct 2008 06:50:06 +0000 Received: by ti-out-0910.google.com with SMTP id d10so701210tib.12 for ; Fri, 24 Oct 2008 23:50:03 -0700 (PDT) Received: by 10.110.40.8 with SMTP id n8mr1849773tin.50.1224917403042; Fri, 24 Oct 2008 23:50:03 -0700 (PDT) Received: by 10.110.42.9 with HTTP; Fri, 24 Oct 2008 23:50:02 -0700 (PDT) Message-ID: Date: Sat, 25 Oct 2008 06:50:00 -0000 From: teawater To: "Michael Snyder" Subject: Re: [RFA] Handle runtime loader dyn sym resolution in reverse Cc: "gdb-patches@sourceware.org" In-Reply-To: <49028B5C.2000508@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <49028B5C.2000508@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/msg00633.txt.bz2 Great! It's OK to me. Please check it into 0930 branch and main tree. On Sat, Oct 25, 2008 at 10:58, Michael Snyder wrote: > This is for both the main trunk and the record/replay branch > (so I'd appreciate review by both Hui and a global maintainer). > > It fixes a bug where you try to "reverse-next" over a > first-time dynamic function call (eg. printf). Infrun > would get lost when it stepped into the jump table > backwards. > > > 2008-10-24 Michael Snyder > > * infrun.c (handle_inferior_event): Handle dynamic symbol > resolution in reverse. > > Index: infrun.c > =================================================================== > RCS file: /cvs/src/src/gdb/infrun.c,v > retrieving revision 1.322.2.14 > diff -u -p -r1.322.2.14 infrun.c > --- infrun.c 23 Oct 2008 23:24:45 -0000 1.322.2.14 > +++ infrun.c 25 Oct 2008 02:57:37 -0000 > @@ -3212,6 +3212,22 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( > if (execution_direction == EXEC_REVERSE) > { > struct symtab_and_line sr_sal; > + > + if (ecs->stop_func_start == 0 > + && in_solib_dynsym_resolve_code (stop_pc)) > + { > + /* Stepped into runtime loader dynamic symbol > + resolution code. Since we're in reverse, > + we have already backed up through the runtime > + loader and the dynamic function. This is just > + the trampoline (jump table). > + > + Just keep stepping, we'll soon be home. > + */ > + keep_going (ecs); > + return; > + } > + /* Normal (staticly linked) function call return. */ > init_sal (&sr_sal); > sr_sal.pc = ecs->stop_func_start; > insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); > >