Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA/windows] Spurious "dll not found" error messages on   x64-windows.
Date: Thu, 11 Feb 2010 11:22:00 -0000	[thread overview]
Message-ID: <20100211112157.GD2907@adacore.com> (raw)
In-Reply-To: <20100204221752.GA27209@ednor.casa.cgf.cx>

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

> Sorry but, I don't think this right.  What's the point of issuing the
> error after inferior startup?  I think it's only during startup that
> something like this would be useful.
> 
> I think making the error a complaint makes more sense.

Sure. I am not sure when DLLs are unloaded most... I was thinking
more about the case where a user does a LoadLibrary/FreeLibrary.

Regardless, here is a version that transforms the error into a complaint.
So far, complaints appears to be used only for symbol file events.
It's a tiny bit of a strech to include our complaint in that category,
but I think that creating a different category for that might be
a bit overkill. I don't mind doing so, however. I chose the simpler
approach for now, which gives us the following complaint when they
are activated:

    [New Thread 94404.0x222a8]
    During symbol reading, dll starting at 0x77a60000 not found..
    During symbol reading, dll starting at 0x77650000 not found..
    [...]

The "During symbol reading" is where the complaint category comes
in play.

Note that the module description in complaints.h says:

    Definitions for complaint handling during symbol reading in GDB.

But I don't see why this couldn't be used for other purposes (and
hence why we couldn't create new categories if necessary).

gdb/ChangeLog:

        * windows-nat.c: Add include of complaints.h.
        (handle_unload_dll): Change dll-not-found error into a complaint.

Tested on x86_64-windows with an x86-windows toolchain.

-- 
Joel

[-- Attachment #2: unloaded-dll-not-found.diff --]
[-- Type: text/x-diff, Size: 1146 bytes --]

--- windows-nat.c.orig	2010-02-11 12:09:23.911442400 +0100
+++ windows-nat.c	2010-02-11 11:22:29.060598600 +0100
@@ -64,6 +64,7 @@
 #include "windows-tdep.h"
 #include "windows-nat.h"
 #include "i386-nat.h"
+#include "complaints.h"
 
 #define AdjustTokenPrivileges		dyn_AdjustTokenPrivileges
 #define DebugActiveProcessStop		dyn_DebugActiveProcessStop
@@ -783,8 +784,15 @@ handle_unload_dll (void *dummy)
 	return 1;
       }
 
-  error (_("Error: dll starting at %s not found."),
-	   host_address_to_string (lpBaseOfDll));
+  /* We did not find any DLL that was previously loaded at this address,
+     so register a complaint.  We do not report an error, because we have
+     observed that this may be happening under some circumstances.  For
+     instance, 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, the interface between
+     32bit and 64bit worlds).  */
+  complaint (&symfile_complaints, _("dll starting at %s not found."),
+	     host_address_to_string (lpBaseOfDll));
 
   return 0;
 }

  reply	other threads:[~2010-02-11 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04  4:13 Joel Brobecker
2010-02-04 22:18 ` Christopher Faylor
2010-02-11 11:22   ` Joel Brobecker [this message]
2010-02-11 17:24     ` Christopher Faylor
2010-02-12  4:55       ` Joel Brobecker
2010-02-11 19:53     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100211112157.GD2907@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox