This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit/windows] Add thread ID in SuspendThread error warning message.


> FWIW, I've seen this from time to time and have convinced myself that
> it's a red herring.  When it happens, it probably should just silently
> continue.

That's interesting. I have the following patch in AdaCore's tree
which I have been uhming and ahming about. Would it apply to your
situation as well?

-                   warning (_("SuspendThread failed. (winerr %u)"),
-                            (unsigned) err);
-                   return NULL;
+                   /* If SuspendThread failed with error 5 (access
+                      denied), then ignore the error.  It's unclear
+                      where this comes from and how to prevent it.
+                      But in the meantime, ignoring it seems to allow
+                      us to inspect the thread (including fetching
+                      registers) without apparent ill effect.  */
+                   if (err != 5)
+                     {
+                       warning (_("SuspendThread (tid=0x%x) failed."
+                                  " (winerr %d)"),
+                                (unsigned) id, (unsigned) err);
+                       return NULL;
+                     }

I think there are other situations as well were we emit a warning,
and where I've been considering the idea of downgrading them to
complaints, so that users don't unnecessarily get concerned. But
I wanted to investigate a little bit before doing so, and I've
never had the time :-(.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]