View Source edb_dap_id_mappings (edb v0.3.0)
An mapper of IDs for the debug adapter
The DAP protocol expects numeric ids for threads, frames, scopes, etc. These ids are represented as number() in the JSON specification, and are expected to fit in a 64-bit float. Some ids like thread_ids are expected to be unique across the debugging session, while others (frame-ids, etc), need be unique only between pauses. The specification recommends adapters to reset them on continue
requests. For more details see https://microsoft.github.io/debug-adapter-protocol/overview
This module implements the mapping fo PIDs to thread-ids, etc, generically.
Summary
Functions
An integer that fits in a 64-bit float
Types
-type id() :: non_neg_integer().
-type pid_frame() :: #{pid := pid(), frame_no := non_neg_integer()}.
-type scope() :: locals | registers | messages.
-type state(A) :: id_mapping(A).
-type validator(A) :: fun((term()) -> {ok, A} | invalid).
Functions
-spec frame_scope_to_var_reference(frame_scope()) -> id().
-spec handle_call({get_id, A}, gen_server:from(), state(A)) -> {reply, id(), state(A)}; ({from_id, id()}, gen_server:from(), state(A)) -> {reply, {ok, A} | {error, not_found}, state(A)}; (reset, gen_server:from(), state(A)) -> {reply, ok, state(A)}.
-spec reset() -> ok.
-spec start_link_frame_ids_server() -> gen_server:start_ret().
-spec start_link_thread_ids_server() -> gen_server:start_ret().
An integer that fits in a 64-bit float
This is the requirement the DAP spec puts on ids.
-spec start_link_var_reference_ids_server() -> gen_server:start_ret().
-spec var_reference_to_frame_scope(id()) -> {ok, frame_scope()} | {error, not_found}.