From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31053 invoked by alias); 7 Jan 2009 11:46:34 -0000 Received: (qmail 31044 invoked by uid 22791); 7 Jan 2009 11:46:33 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 11:46:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F3AFD2A9620 for ; Wed, 7 Jan 2009 06:46:27 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sF9ReUjc78dl for ; Wed, 7 Jan 2009 06:46:27 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 201DC2A9618 for ; Wed, 7 Jan 2009 06:46:27 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 17957E7ACD; Wed, 7 Jan 2009 15:46:20 +0400 (RET) Date: Wed, 07 Jan 2009 11:46:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/win32] Change the DLL base address type to LPVOID Message-ID: <20090107114620.GE1751@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zjcmjzIkjQU2rmur" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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: 2009-01/txt/msg00085.txt.bz2 --zjcmjzIkjQU2rmur Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 789 This patch changes the type used to manipulate the DLL base address from DWORD to LPVOID. The Windows headers declare this address as an LPVOID, and using DWORD causes problems on x86_64-windows because the types do not have the same size. 2009-01-07 Joel Brobecker * win32-nat.c (get_module_name): Change the type of parameter "base_address" to LPVOID. Remove unnecessary cast. (struct lm_info): Change type of load_addr to LPVOID. (win32_make_so): Change the type of parameter "load_addr" to LPVOID. Remove some unnecessary casts. (handle_unload_dll): Change the type of "lpBaseOfDll" to LPVOID. (win32_xfer_shared_libraries): Add missing cast. Tested on x86-windows. OK to apply? Thanks, -- Joel --zjcmjzIkjQU2rmur Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="farproc.diff" Content-length: 1677 diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 1b15dfb..5300731 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1600,11 +1600,11 @@ has_detach_ability (void) if (kernel32) { if (!kernel32_DebugSetProcessKillOnExit) - kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32, - "DebugSetProcessKillOnExit"); + kernel32_DebugSetProcessKillOnExit = + (void *) GetProcAddress (kernel32, "DebugSetProcessKillOnExit"); if (!kernel32_DebugActiveProcessStop) - kernel32_DebugActiveProcessStop = GetProcAddress (kernel32, - "DebugActiveProcessStop"); + kernel32_DebugActiveProcessStop = + (void *) GetProcAddress (kernel32, "DebugActiveProcessStop"); if (kernel32_DebugSetProcessKillOnExit && kernel32_DebugActiveProcessStop) return 1; @@ -1641,13 +1641,14 @@ set_process_privilege (const char *privilege, BOOL enable) if (!(advapi32 = LoadLibrary ("advapi32.dll"))) goto out; if (!OpenProcessToken) - OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken"); + OpenProcessToken = + (void *) GetProcAddress (advapi32, "OpenProcessToken"); if (!LookupPrivilegeValue) - LookupPrivilegeValue = GetProcAddress (advapi32, - "LookupPrivilegeValueA"); + LookupPrivilegeValue = + (void *) GetProcAddress (advapi32, "LookupPrivilegeValueA"); if (!AdjustTokenPrivileges) - AdjustTokenPrivileges = GetProcAddress (advapi32, - "AdjustTokenPrivileges"); + AdjustTokenPrivileges = + (void *) GetProcAddress (advapi32, "AdjustTokenPrivileges"); if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges) { advapi32 = NULL; --zjcmjzIkjQU2rmur--