Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: src/vm/session.cc

Issue 1987673002: Initial Implementation of the vm-service protocol (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Keep track of terminated state Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartino_compiler/lib/vm_context.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « pkg/dartino_compiler/lib/vm_context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698