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
This commit is contained in:
Ingo Weinhold
2005-03-09 22:05:43 +00:00
parent 9b92e8c011
commit 2562e5185c
2 changed files with 14 additions and 2 deletions
+5
View File
@@ -94,12 +94,17 @@ typedef struct {
bool single_step; bool single_step;
} debugged_thread_continue; } debugged_thread_continue;
typedef struct {
port_id reply_port;
} debugged_thread_get_why_stopped;
typedef struct { typedef struct {
debug_cpu_state cpu_state; debug_cpu_state cpu_state;
} debugged_thread_set_cpu_state; } debugged_thread_set_cpu_state;
typedef union { typedef union {
debugged_thread_continue continue_thread; debugged_thread_continue continue_thread;
debugged_thread_get_why_stopped get_why_stopped;
debugged_thread_set_cpu_state set_cpu_state; debugged_thread_set_cpu_state set_cpu_state;
} debugged_thread_message_data; } debugged_thread_message_data;
+9 -2
View File
@@ -306,6 +306,9 @@ thread_hit_debug_event(uint32 event, const void *message, int32 size,
case B_DEBUGGED_THREAD_GET_WHY_STOPPED: 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) // get the team debug info (just in case it has changed)
team_debug_info teamDebugInfo; team_debug_info teamDebugInfo;
get_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); teamDebugInfo.nub_port, additionalData);
// send it // send it
error = kill_interruptable_write_port(debuggerPort, event, error = kill_interruptable_write_port(replyPort, event,
&stoppedMessage, sizeof(stoppedMessage)); &stoppedMessage, sizeof(stoppedMessage));
break; break;
@@ -973,6 +976,7 @@ debug_nub_thread(void *)
{ {
// get the parameters // get the parameters
thread_id threadID = message.get_why_stopped.thread; 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: " TRACE(("nub thread %ld: B_DEBUG_MESSAGE_GET_WHY_STOPPED: "
"thread: %ld\n", nubThread->id, threadID)); "thread: %ld\n", nubThread->id, threadID));
@@ -994,8 +998,11 @@ debug_nub_thread(void *)
// send a message to the debugged thread // send a message to the debugged thread
if (threadDebugPort >= 0) { if (threadDebugPort >= 0) {
debugged_thread_get_why_stopped commandMessage;
commandMessage.reply_port = replyPort;
write_port(threadDebugPort, write_port(threadDebugPort,
B_DEBUGGED_THREAD_GET_WHY_STOPPED, NULL, 0); B_DEBUGGED_THREAD_GET_WHY_STOPPED, &commandMessage,
sizeof(commandMessage));
} }
break; break;