darwin: warning resuming inferior after attach
This patch avoids a warning when resuming the execution of a program
that we attached to. For instance:
(gdb) attach 29989
(gdb) continue
Continuing.
warning: Mach error at "/[...]/darwin-nat.c:738" in function
"darwin_resume_thread": (os/kern) failure (0x5)
The warning is relatively harmless, but worrisome for the average
user. The warning comes from the fact that darwin_wait recorded
that the fake stop event corresponding to the suspend action was
caused by the main thread being suspended on a SIGTRAP. As a result
of this, when resuming the program's execution, we try to resume
the thread's execution as well. This is where the issue occurs,
as the thread was not in fact suspended, thus triggering the warning.
gdb/ChangeLog:
* darwin-nat.c (darwin_setup_fake_stop_event): New function.
(darwin_attach): Adjust using darwin_setup_fake_stop_event.