class DebugAdapterContext

Defined at line 58 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

Handles processing requests from debug adapter client with help from zxdb client session and dap

library.

Note: All methods in this class need to be executed on main thread to avoid concurrency bugs.

Public Methods

void DebugAdapterContext (Console * console, debug::StreamBuffer * stream)

Defined at line 35 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

Console * console ()

Defined at line 68 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

Session * session ()

Defined at line 69 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

dap::Session & dap ()

Defined at line 70 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

bool supports_run_in_terminal ()

Defined at line 71 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

void set_destroy_connection_callback (DestroyConnectionCallback cb)

Callback to delete the connection and hence this context. This callback will be posted on

message loop.

Defined at line 78 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

void ~DebugAdapterContext ()

Defined at line 80 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DidResolveConnection (const Err & err)

SessionObserver implementation:

Defined at line 90 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeinitializeAsyncBacktraceSubscriptionForTesting ()

Deinitializes the `AsyncBacktraceSubscription` for testing purposes.

This can be used to reduce noise for tests that don't care about async backtrace behavior, as

leaving it in-place results in additional `dap::Event`s on thread events, requiring extra

`RunClient()` calls.

This can only be called once, after `DebugAdapterContext::Init`.

Defined at line 141 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

void OnStreamReadable ()

Notification about the stream.

Defined at line 226 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DidCreateThread (Thread * thread)

ThreadObserver implementation:

Defined at line 232 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void WillDestroyThread (Thread * thread)

Defined at line 239 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void OnThreadStopped (Thread * thread, const StopInfo & info)

Defined at line 246 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DidUpdateStackFrames (Thread * thread)

Defined at line 292 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DidCreateProcess (Process * process, uint64_t timestamp)

ProcessObserver implementation:

Defined at line 294 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void WillDestroyProcess (Process * process, DestroyReason reason, int exit_code, uint64_t timestamp)

Defined at line 311 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void OnBreakpointMatched (Breakpoint * breakpoint, bool user_requested)

BreakpointObserver implementation:

Defined at line 341 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

Thread * GetThread (uint64_t koid)

Defined at line 354 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

Err CheckStoppedThread (Thread * thread)

Checks if thread is in stopped state; returns error if not stopped.

`thread` can be nullptr, in which case an error is returned.

Defined at line 376 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

std::vector<PrettyStackManager::Match> GetElidedFrames (const Stack & stack)

Returns a vector of elided frame matches against a stack.

The returned vector will have the same `size()` as the `stack`.

Defined at line 397 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

int64_t IdForFrame (uint64_t thread_koid, int64_t stack_index)

Helper methods to get/set frame to ID mapping

Defined at line 429 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

Frame * FrameforId (int64_t id)

Defined at line 445 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeleteFrameIdsForThread (Thread * thread)

Defined at line 465 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

int64_t IdForVariables (int64_t frame_id, VariablesType type, std::unique_ptr<FormatNode> parent, fxl::WeakPtr<FormatNode> child)

Helper methods to get/set variables references

Defined at line 490 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

VariablesRecord * VariablesRecordForID (int64_t id)

Defined at line 514 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeleteVariablesIdsForFrameId (int64_t id)

Defined at line 527 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void StoreBreakpointForSource (const std::filesystem::path & source, Breakpoint * bp)

Helper methods to get/set breakpoint to source file mapping.

Defined at line 537 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

std::vector<fxl::WeakPtr<Breakpoint>> * GetBreakpointsForSource (const std::filesystem::path & source)

Defined at line 543 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

int64_t IdForBreakpoint (Breakpoint * breakpoint)

Helper methods to get/set breakpoint to ID mapping

Defined at line 330 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeleteBreakpointsForSource (const std::filesystem::path & source)

These 2 methods only delete breakpoints added by the debug adapter.

Breakpoints added from console are not deleted.

Defined at line 552 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeleteAllBreakpoints ()

Defined at line 567 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc