class DebugAdapterContext
Defined at line 61 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
Console * console ()
Defined at line 72 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
Session * session ()
Defined at line 73 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
dap::Session & dap ()
Defined at line 74 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
debug::StreamBuffer * stream ()
Defined at line 75 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
bool supports_run_in_terminal ()
Defined at line 76 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
void DebugAdapterContext (Console * console, debug::StreamBuffer * stream)
Defined at line 78 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
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 86 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
void ~DebugAdapterContext ()
Defined at line 123 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
const std::vector<fxl::WeakPtr<Breakpoint>> & GetFunctionBreakpoints ()
Defined at line 142 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
const std::vector<fxl::WeakPtr<Breakpoint>> & GetDataBreakpoints ()
Defined at line 148 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
const std::vector<Filter *> & filters ()
Defined at line 162 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
std::map<int64_t, fxl::WeakPtr<Tracepoint>> & dap_tracepoints ()
Defined at line 165 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
const std::map<int64_t, fxl::WeakPtr<Tracepoint>> & dap_tracepoints ()
Defined at line 166 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
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 177 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
fxl::WeakPtr<DebugAdapterContext> GetWeakPtr ()
Defined at line 184 of file ../../src/developer/debug/zxdb/debug_adapter/context.h
void OnStreamReadable ()
Notification about the stream.
Defined at line 397 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnProcessPaused (Process * process)
Defined at line 508 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnThreadPaused (Thread * thread)
Defined at line 514 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DidResolveConnection (const Err & err)
SessionObserver implementation:
Defined at line 136 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DidCreateThread (Thread * thread)
ThreadObserver implementation:
Defined at line 407 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void WillDestroyThread (Thread * thread)
Defined at line 441 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnThreadStopped (Thread * thread, const StopInfo & info)
Defined at line 452 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DidUpdateStackFrames (Thread * thread)
Defined at line 520 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DidCreateProcess (Process * process, uint64_t timestamp)
ProcessObserver implementation:
Defined at line 522 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void WillDestroyProcess (Process *process,DestroyReasonreason,intexit_code,uint64_ttimestamp)
Defined at line 540 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnBreakpointMatched (Breakpoint * breakpoint, bool user_requested)
BreakpointObserver implementation:
Defined at line 570 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnBreakpointUpdateFailure (Breakpoint * breakpoint, const Err & err)
Defined at line 583 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void WillDestroyFilter (Filter * filter)
SystemObserver implementation:
Defined at line 886 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void OnTracepointHit (Tracepoint * tracepoint, const TracepointHitRecord & hit)
Defined at line 917 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void WillDestroyTracepoint (Tracepoint * tracepoint)
Defined at line 907 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
Thread * GetThread (uint64_t koid)
Defined at line 599 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 621 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 642 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 674 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
Frame * FrameforId (int64_t id)
Defined at line 690 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteFrameIdsForThread (Thread * thread)
Defined at line 710 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
int64_t IdForVariables (int64_tframe_id,VariablesTypetype,std::unique_ptr<FormatNode>parent,fxl::WeakPtr<FormatNode>child)
Helper methods to get/set variables references
Defined at line 735 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
VariablesRecord * VariablesRecordForID (int64_t id)
Defined at line 759 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteVariablesIdsForFrameId (int64_t id)
Defined at line 772 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 782 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
std::vector<fxl::WeakPtr<Breakpoint>> * GetBreakpointsForSource (const std::filesystem::path & source)
Defined at line 788 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void StoreFunctionBreakpoint (Breakpoint * bp)
Helper methods to get/set function breakpoint mapping.
Defined at line 812 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void StoreDataBreakpoint (Breakpoint * bp)
Helper methods to get/set data breakpoint (watchpoint) mapping.
Defined at line 827 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 559 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteBreakpointsForSource (const std::filesystem::path & source)
These methods only delete breakpoints added by the debug adapter.
Breakpoints added from console are not deleted.
Defined at line 797 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteAllFunctionBreakpoints ()
Defined at line 817 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteAllDataBreakpoints ()
Defined at line 832 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteAllBreakpoints ()
Defined at line 842 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void StoreFilter (Filter * filter)
Defined at line 857 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteAllFilters ()
Deletes all filters created dynamically by this DAP connection context.
We manage and clean up our own filters locally via `filters_` instead of calling the global
`session()->system().GetFilters()` because the debugger process and the core Session survive
DAP disconnections. Deleting all global filters on connection teardown would destructively
wipe out the developer's pre-configured startup filters loaded from `~/.fuchsia/debug/zxdbrc`
(e.g., `attach cobalt.cm`).
Defined at line 871 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc
void DeleteDapTracepoints ()
Defined at line 894 of file ../../src/developer/debug/zxdb/debug_adapter/context.cc