From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2748 invoked by alias); 15 Oct 2012 17:23:19 -0000 Received: (qmail 2737 invoked by uid 22791); 15 Oct 2012 17:23:16 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RCVD_IN_NIX_SPAM,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Oct 2012 17:23:09 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MBY002002V7N800@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Mon, 15 Oct 2012 19:23:04 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MBY002NQ2YG6C70@a-mtaout20.012.net.il>; Mon, 15 Oct 2012 19:23:04 +0200 (IST) Date: Mon, 15 Oct 2012 17:23:00 -0000 From: Eli Zaretskii Subject: Re: [RFC] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) In-reply-to: <006001cdaada$00c81f00$02585d00$%muller@ics-cnrs.unistra.fr> To: Pierre Muller Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83obk34pku.fsf@gnu.org> References: <83a9vs89r9.fsf@gnu.org> <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> <834nm07z0s.fsf@gnu.org> <5077FEB9.4030304@redhat.com> <83y5jb7rfe.fsf@gnu.org> <006001cdaada$00c81f00$02585d00$%muller@ics-cnrs.unistra.fr> 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: 2012-10/txt/msg00222.txt.bz2 > From: "Pierre Muller" > Date: Mon, 15 Oct 2012 15:35:55 +0200 > > After some investigation, I noticed that > the minimal symbol GetLastError was offset by 0xf0000 > respective to the '_imp__GetLastError@0'. > > The patch attached allowed me to call > (gdb) call GetLastError () > And get a simple > $2 = 126 > (for instance, depending on when you do the call). Thanks. > Could someone please test the patch and > confirm that it does fix the problem? I will try that in a few days. > + if (!section_found) > + { > + char * forward_name = (char *) (erva + func_rva); > + char * funcname = (char *) (erva + name_rva); > + if ((func_rva >= export_rva) > + && (func_rva < export_rva + export_size)) > + printf ("%s is a forward to %s\n", funcname, forward_name); Is this printf really necessary?