class DebugAdapterContext

Defined at line 57 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 67 of file ../../src/developer/debug/zxdb/debug_adapter/context.h

Session * session ()

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

dap::Session & dap ()

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

bool supports_run_in_terminal ()

Defined at line 70 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 77 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 OnStreamReadable ()

Notification about the stream.

Defined at line 224 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 DidCreateThread (Thread * thread)

ThreadObserver implementation:

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

void WillDestroyThread (Thread * thread)

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

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

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

void DidUpdateStackFrames (Thread * thread)

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

void DidCreateProcess (Process * process, uint64_t timestamp)

ProcessObserver implementation:

Defined at line 292 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 309 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void OnBreakpointMatched (Breakpoint * breakpoint, bool user_requested)

BreakpointObserver implementation:

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

Thread * GetThread (uint64_t koid)

Defined at line 352 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 374 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 395 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 427 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

Frame * FrameforId (int64_t id)

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

void DeleteFrameIdsForThread (Thread * thread)

Defined at line 463 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 488 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

VariablesRecord * VariablesRecordForID (int64_t id)

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

void DeleteVariablesIdsForFrameId (int64_t id)

Defined at line 525 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 535 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

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

Defined at line 541 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 328 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 550 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc

void DeleteAllBreakpoints ()

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