From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6064 invoked by alias); 4 Feb 2010 04:13:03 -0000 Received: (qmail 6054 invoked by uid 22791); 4 Feb 2010 04:13:01 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS 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; Thu, 04 Feb 2010 04:12:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 26B1C2BAB27 for ; Wed, 3 Feb 2010 23:12:56 -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 gwEJswuZcLPR for ; Wed, 3 Feb 2010 23:12:56 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 8E9762BAB21 for ; Wed, 3 Feb 2010 23:12:55 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A151CF59A2; Thu, 4 Feb 2010 08:12:48 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/windows] Spurious "dll not found" error messages on x64-windows. Date: Thu, 04 Feb 2010 04:13:00 -0000 Message-Id: <1265256768-30183-1-git-send-email-brobecker@adacore.com> 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: 2010-02/txt/msg00100.txt.bz2 When running 32bit programs on x64 windows, GDB produces the following error messages: (gdb) start Temporary breakpoint 1 at 0x4015ae: file simple_main.adb, line 4. Starting program: C:\[...]/simple_main.exe [New Thread 31464.0x8cd4] !!! -> Error: dll starting at 0x77a60000 not found. !!! -> Error: dll starting at 0x77650000 not found. !!! -> Error: dll starting at 0x77a60000 not found. !!! -> Error: dll starting at 0x77990000 not found. Temporary breakpoint 1, simple_main () at simple_main.adb:4 4 simple.test_simple; This is something that was already discussed previously for gdbserver, where these events were not well handled and eventually lead to a crash: http://www.sourceware.org/ml/gdb-patches/2010-02/msg00011.html A quick investigation showed that there were no dll-load-events that correspond to these base addresses. A search on the net points at the WOW layer which interfaces between the 32bit and 64bit worlds. My first proposal is to silently ignore these spurious events during the startup phase. We could probably refine this check by also verifying that we are running a 32bit exe on 64bit Windows. But given that this error did not trigger in the past, I think that'd be overkill. In fact, I don't think that ditching the error would be a big loss (we could turn it into a complaint if we want to be able to see it in special occasions). gdb/ChangeLog: * windows-nat.c (handle_unload_dll): Disable unknown-dll error during the inferior startup phase. Tested on x86_64-windows using a x86-windows compiler/debugger. OK to apply? Thanks, -- Joel --- diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 2740366..4c2d1d8 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -783,7 +783,16 @@ handle_unload_dll (void *dummy) return 1; } - error (_("Error: dll starting at %s not found."), + /* We did not find any DLL that was previously loaded at this address. + This is normally an error. However, we have observed that running + 32bit applications on x64 Windows causes us to receive 4 mysterious + UNLOAD_DLL_DEBUG_EVENTs during the startup phase. These events are + apparently caused by the WOW layer (this is the interface between + the 32bit and 64bit worlds). Because of these events, we only report + the error after the initialization phase is complete (there is not + much data that we can use to identify these spurious events). */ + if (windows_initialization_done) + error (_("Error: dll starting at %s not found."), host_address_to_string (lpBaseOfDll)); return 0; -- 1.6.3.3