From d1d742dfc4360731be2ecdd69511716414abcf8f Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 7 May 2018 07:01:51 -0700 Subject: Skylark debugging proto: add a 'pause thread' request/response. To handle a common debugging workflow where you want to pause execution of one/all threads. PiperOrigin-RevId: 195657472 --- .../lib/skylarkdebug/proto/skylark_debugging.proto | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/skylarkdebug/proto/skylark_debugging.proto b/src/main/java/com/google/devtools/build/lib/skylarkdebug/proto/skylark_debugging.proto index e9bd422ac8..804319397a 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkdebug/proto/skylark_debugging.proto +++ b/src/main/java/com/google/devtools/build/lib/skylarkdebug/proto/skylark_debugging.proto @@ -35,6 +35,7 @@ message DebugRequest { EvaluateRequest evaluate = 103; ListFramesRequest list_frames = 104; StartDebuggingRequest start_debugging = 105; + PauseThreadRequest pause_thread = 106; } } @@ -84,6 +85,15 @@ message ListFramesRequest { message StartDebuggingRequest { } +// A request to pause execution of a thread, or all threads. +message PauseThreadRequest { + // The identifier of the thread to be paused. + // + // If not set (i.e. zero), all current and future Skylark threads will be + // paused until resumed via a ContinueExecutionRequest. + int64 thread_id = 1; +} + // There are two kinds of events: "responses", which correspond to a // DebugRequest sent by the client, and other asynchronous events that may be // sent by the server to notify the client of activity in the Skylark code being @@ -104,6 +114,7 @@ message DebugEvent { EvaluateResponse evaluate = 103; ListFramesResponse list_frames = 104; StartDebuggingResponse start_debugging = 105; + PauseThreadResponse pause_thread = 106; ThreadStartedEvent thread_started = 1000; ThreadEndedEvent thread_ended = 1001; @@ -150,6 +161,12 @@ message ListFramesResponse { message StartDebuggingResponse { } +// The response to a PauseThreadRequest. This is an acknowledgement that the +// request was received. Actual pausing of individual threads happens +// asynchronously, and will be communicated via ThreadPausedEvent(s). +message PauseThreadResponse { +} + // An event indicating that a thread has begun executing Skylark code. message ThreadStartedEvent { // The thread that began. -- cgit v1.2.3