* Automatic white-space cleanup.
* Handle the new B_DEBUGGER_MESSAGE_HANDED_OVER and pick the "causing thread" as our first victim. Fixes #2956. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1008,7 +1008,7 @@ haiku_child_resume (ptid_t ptid, int step, enum target_signal sig)
|
||||
|
||||
static ptid_t
|
||||
haiku_child_wait_internal (team_debug_info *teamDebugInfo, ptid_t ptid,
|
||||
struct target_waitstatus *ourstatus, bool *ignore)
|
||||
struct target_waitstatus *ourstatus, bool *ignore, bool *selectThread)
|
||||
{
|
||||
team_id teamID = ptid_get_pid(ptid);
|
||||
team_id threadID = ptid_get_tid(ptid);
|
||||
@@ -1019,6 +1019,8 @@ haiku_child_wait_internal (team_debug_info *teamDebugInfo, ptid_t ptid,
|
||||
pending_signal_status pendingSignalStatus = SIGNAL_FAKED;
|
||||
int reprocessEvent = -1;
|
||||
|
||||
*selectThread = false;
|
||||
|
||||
if (teamID < 0 || threadID == 0)
|
||||
threadID = -1;
|
||||
|
||||
@@ -1253,6 +1255,23 @@ TRACE(("haiku_child_wait_internal(): B_APP_IMAGE created, reprocess -> exec\n"))
|
||||
ourstatus->value.integer = 0;
|
||||
break;
|
||||
|
||||
case B_DEBUGGER_MESSAGE_HANDED_OVER:
|
||||
{
|
||||
TRACE(("haiku_child_wait_internal(): B_DEBUGGER_MESSAGE_HANDED_OVER: causing "
|
||||
"thread: %ld\n", event->data.handed_over.causing_thread));
|
||||
// The debugged team has been handed over to us by another debugger
|
||||
// (likely the debug server). This event also tells us, which
|
||||
// thread has caused the original debugger to be installed (if any).
|
||||
// So, if we're not looking for any particular thread, select that
|
||||
// thread.
|
||||
if (threadID < 0 && event->data.handed_over.causing_thread >= 0) {
|
||||
*selectThread = true;
|
||||
retval = ptid_build(event->data.origin.team, 0,
|
||||
event->data.handed_over.causing_thread);
|
||||
}
|
||||
*ignore = true;
|
||||
}
|
||||
|
||||
default:
|
||||
// unknown message, ignore
|
||||
*ignore = true;
|
||||
@@ -1294,13 +1313,16 @@ haiku_child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
||||
{
|
||||
ptid_t retval;
|
||||
bool ignore = true;
|
||||
bool selectThread = false;
|
||||
|
||||
TRACE(("haiku_child_wait(`%s', %p)\n",
|
||||
haiku_pid_to_str(ptid), ourstatus));
|
||||
|
||||
do {
|
||||
retval = haiku_child_wait_internal(&sTeamDebugInfo, ptid, ourstatus,
|
||||
&ignore);
|
||||
&ignore, &selectThread);
|
||||
if (selectThread)
|
||||
ptid = retval;
|
||||
} while (ignore);
|
||||
|
||||
TRACE(("haiku_child_wait() done: `%s'\n", haiku_pid_to_str(retval)));
|
||||
|
||||
Reference in New Issue
Block a user