This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix "PC register is not available" issue
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Mon, 07 Apr 2014 21:24:53 +0300
- Subject: Re: [PATCH] Fix "PC register is not available" issue
- Authentication-results: sourceware.org; auth=none
- References: <83txawa9wk dot fsf at gnu dot org> <20140318161608 dot GD4282 at adacore dot com> <83pplja2h9 dot fsf at gnu dot org> <20140318165413 dot GE4282 at adacore dot com> <834n2kztfw dot fsf at gnu dot org> <53358C37 dot 9050907 at redhat dot com> <83a9cafcpz dot fsf at gnu dot org> <5335B619 dot 6040605 at redhat dot com> <8361myfa6l dot fsf at gnu dot org> <83ioqucrkw dot fsf at gnu dot org> <5342DBBC dot 4090500 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 07 Apr 2014 18:09:16 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: brobecker@adacore.com, gdb-patches@sourceware.org
>
> > Funnily enough, I cannot get GDBserver to emit similar warnings in the
> > same situation. I don't understand the reasons for that, since the
> > code is very similar, and with a single exception, we do check the
> > return values of calls to GetThreadContext, SetThreadContext, and
> > SuspendThread in GDBserver. But the fact remains that no warnings
> > about these threads are ever seen when debugging remotely. I do see
> > the extra threads under GDBserver as well.
>
> GDBserver's warnings are guarded by 'if (debug_threads)' (see OUTMSG2).
But the warnings I was talking about are output with OUTMSG, which
doesn't depend on debug_threads. Here's an example:
static void
suspend_one_thread (struct inferior_list_entry *entry)
{
struct thread_info *thread = (struct thread_info *) entry;
win32_thread_info *th = inferior_target_data (thread);
if (!th->suspended)
{
if (SuspendThread (th->h) == (DWORD) -1)
{
DWORD err = GetLastError ();
OUTMSG (("warning: SuspendThread failed in suspend_one_thread, "
"(error %d): %s\n", (int) err, strwinerror (err)));
Did I miss something?