From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31150 invoked by alias); 25 Oct 2008 03:04:22 -0000 Received: (qmail 31139 invoked by uid 22791); 25 Oct 2008 03:04:21 -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; Sat, 25 Oct 2008 03:03:46 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 0FE4642003; Fri, 24 Oct 2008 20:03:44 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost4.vmware.com (Postfix) with ESMTP id 41476C9A3C; Fri, 24 Oct 2008 20:03:44 -0700 (PDT) Message-ID: <49028B5C.2000508@vmware.com> Date: Sat, 25 Oct 2008 03:04:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , teawater Subject: [RFA] Handle runtime loader dyn sym resolution in reverse Content-Type: multipart/mixed; boundary="------------070407060203060600040209" 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/msg00631.txt.bz2 This is a multi-part message in MIME format. --------------070407060203060600040209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 298 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. --------------070407060203060600040209 Content-Type: text/plain; name="shmain.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="shmain.txt" Content-length: 1210 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); --------------070407060203060600040209--