From 2562e5185ceebf76f6db759161e6300b2de6f4e6 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 9 Mar 2005 22:05:43 +0000 Subject: [PATCH] Command B_DEBUG_MESSAGE_GET_WHY_STOPPED supports a reply port now. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11633 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/user_debugger.h | 5 +++++ src/kernel/core/user_debugger.cpp | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/headers/private/kernel/user_debugger.h b/headers/private/kernel/user_debugger.h index 085e5be577..43fb208a45 100644 --- a/headers/private/kernel/user_debugger.h +++ b/headers/private/kernel/user_debugger.h @@ -94,12 +94,17 @@ typedef struct { bool single_step; } debugged_thread_continue; +typedef struct { + port_id reply_port; +} debugged_thread_get_why_stopped; + typedef struct { debug_cpu_state cpu_state; } debugged_thread_set_cpu_state; typedef union { debugged_thread_continue continue_thread; + debugged_thread_get_why_stopped get_why_stopped; debugged_thread_set_cpu_state set_cpu_state; } debugged_thread_message_data; diff --git a/src/kernel/core/user_debugger.cpp b/src/kernel/core/user_debugger.cpp index 3fc9fccbce..57ea4546b1 100644 --- a/src/kernel/core/user_debugger.cpp +++ b/src/kernel/core/user_debugger.cpp @@ -306,6 +306,9 @@ thread_hit_debug_event(uint32 event, const void *message, int32 size, case B_DEBUGGED_THREAD_GET_WHY_STOPPED: { + port_id replyPort + = commandMessage.get_why_stopped.reply_port; + // get the team debug info (just in case it has changed) team_debug_info teamDebugInfo; get_team_debug_info(teamDebugInfo); @@ -322,7 +325,7 @@ thread_hit_debug_event(uint32 event, const void *message, int32 size, teamDebugInfo.nub_port, additionalData); // send it - error = kill_interruptable_write_port(debuggerPort, event, + error = kill_interruptable_write_port(replyPort, event, &stoppedMessage, sizeof(stoppedMessage)); break; @@ -973,6 +976,7 @@ debug_nub_thread(void *) { // get the parameters thread_id threadID = message.get_why_stopped.thread; + port_id replyPort = message.get_why_stopped.reply_port; TRACE(("nub thread %ld: B_DEBUG_MESSAGE_GET_WHY_STOPPED: " "thread: %ld\n", nubThread->id, threadID)); @@ -994,8 +998,11 @@ debug_nub_thread(void *) // send a message to the debugged thread if (threadDebugPort >= 0) { + debugged_thread_get_why_stopped commandMessage; + commandMessage.reply_port = replyPort; write_port(threadDebugPort, - B_DEBUGGED_THREAD_GET_WHY_STOPPED, NULL, 0); + B_DEBUGGED_THREAD_GET_WHY_STOPPED, &commandMessage, + sizeof(commandMessage)); } break;