From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30292 invoked by alias); 24 Jun 2004 00:27:42 -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 30281 invoked from network); 24 Jun 2004 00:27:41 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 24 Jun 2004 00:27:41 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5O0Ree1007581 for ; Wed, 23 Jun 2004 20:27:41 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5O0Rdw21463; Wed, 23 Jun 2004 20:27:39 -0400 Received: from redhat.com (dhcp-172-16-25-160.sfbay.redhat.com [172.16.25.160]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i5O0RdP13307; Wed, 23 Jun 2004 17:27:39 -0700 Message-ID: <40DA1FFA.3030706@redhat.com> Date: Thu, 24 Jun 2004 00:27:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.2) Gecko/20040301 MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] Pb stepping inside DLL function References: <20040624002220.GK1143@gnat.com> In-Reply-To: <20040624002220.GK1143@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00511.txt.bz2 Joel, did you forget to attach the patch? ;-) Joel Brobecker wrote: > Hello, > > We have the following little C program (a.c): > > #include > > extern _stdcall int sub (); > > main () > { > int a = 0; > > a = sub (); > printf ("%d\n", a); > } > > ``sub()'' is a function provided by a DLL. It has all the necessary > debug information. The following transcript shows that GDB is currently > unable to step into sub(): > > (gdb) start > Breakpoint 1 at 0x4012d2: file a.c, line 7. > Starting program: /[...]/a.exe > main () at a.c:7 > 7 int a = 0; > (gdb) step > 9 a = sub (); > (gdb) p a > $1 = 0 > (gdb) step > 10 printf ("%d\n", a); > (gdb) print a > $2 = 5 > > During the step, GDB lands inside sub@0, which is the trampoline > for sub(), but doesn't realize it. The fix is to teach GDB how to > recognize them, and hand to find where they will eventually take us. > For that, I found a function that was actually dead but did exactly > what I needed, so I reused it. > > 2004-06-23 Joel Brobecker > > * i386-cygwin-tdep.c (i386-cygwin-tdep.c): New function. > (i386_cygwin_in_solib_call_trampoline): New function. > (i386_cygwin_init_abi): Initialize the in_solib_call_trampoline > and skip_trampoline_code gdbarch methods. > > Tested on x86-windows (XP), no regression. > OK to apply? > > Thanks,