Index: src/vm/session.cc |
diff --git a/src/vm/session.cc b/src/vm/session.cc |
index 1c0f984dfe87af8fe0207d62ae02855245dae69b..81361795c0ba2d4a297997921d2099538a46283b 100644 |
--- a/src/vm/session.cc |
+++ b/src/vm/session.cc |
@@ -315,6 +315,14 @@ class RunningState : public ScheduledState { |
debug_info->ClearSteppingInterrupted(); |
} |
WriteBuffer buffer; |
+ buffer.WriteInt(debug_info->process_id()); |
+ session()->PushTopStackFrame(process->stack()); |
+ buffer.WriteInt64( |
+ session()->FunctionMessage(Function::cast(session()->Top()))); |
+ // Drop function from session stack. |
+ session()->Drop(1); |
+ // Pop bytecode index from session stack and send it. |
+ buffer.WriteInt64(session()->PopInteger()); |
connection()->Send(Connection::kUncaughtException, buffer); |
// If observing termination, remain paused to allow access to the |
// termination state. |
@@ -846,6 +854,23 @@ SessionState* SessionState::ProcessMessage(Connection::Opcode opcode) { |
break; |
} |
+ case Connection::kProcessGetProcessIds: { |
+ int count = 0; |
+ auto processes = program()->process_list(); |
+ for (auto process : *processes) { |
+ USE(process); |
+ ++count; |
+ } |
+ WriteBuffer buffer; |
+ buffer.WriteInt(count); |
+ for (auto process : *processes) { |
+ process->EnsureDebuggerAttached(); |
+ buffer.WriteInt(process->debug_info()->process_id()); |
+ } |
+ connection()->Send(Connection::kProcessGetProcessIdsResult, buffer); |
+ break; |
+ } |
+ |
#ifdef DARTINO_ENABLE_LIVE_CODING |
case Connection::kSetEntryPoint: { |
program()->set_entry(Function::cast(session()->Pop())); |
@@ -1386,23 +1411,6 @@ SessionState* PausedState::ProcessMessage(Connection::Opcode opcode) { |
break; |
} |
- case Connection::kProcessGetProcessIds: { |
- int count = 0; |
- auto processes = program()->process_list(); |
- for (auto process : *processes) { |
- USE(process); |
- ++count; |
- } |
- WriteBuffer buffer; |
- buffer.WriteInt(count); |
- for (auto process : *processes) { |
- process->EnsureDebuggerAttached(); |
- buffer.WriteInt(process->debug_info()->process_id()); |
- } |
- connection()->Send(Connection::kProcessGetProcessIdsResult, buffer); |
- break; |
- } |
- |
default: { |
return ScheduledState::ProcessMessage(opcode); |
} |