View Source edb_dap_eval_delegate (edb v0.5.0)
This module handles all the calls to edb:eval/1, and all callbacks are defined here. Because of that, this module will end up being transferred to the debuggee node, so the callbacks can be executed.
It is very important that this has no dependencies on anything other than kernel, stdlib and edb_core, as those are the only apps that can be assumed to be running on the debuggee.
Summary
Types
-opaque accessor()
-opaque callback(Result)
-type eval_name() :: binary() | none.
-type evaluation_result() :: #{type := success, value_rep := binary(), structure := none | structure()} | #{type := exception, class := error | exit | throw, reason := term(), stacktrace := erlang:stacktrace()}.
-type scope() :: #{type := process | locals | registers, variables := [variable()]}.
-type structure() :: #{count := pos_integer(), accessor := accessor(), evaluate_name := eval_name()}.
-type window() :: #{start := pos_integer(), count := non_neg_integer() | infinity}.
Functions
-spec eval(Opts) -> not_paused | undefined | {ok, Result} | {eval_error, edb:eval_error()} when Opts :: #{context := {pid(), edb:frame_id()}, max_term_size => non_neg_integer(), timeout => timeout(), function := callback(Result)}.
-spec evaluate_callback(Expr, CompiledExpr, Fmt) -> callback(evaluation_result()) when Expr :: binary(), CompiledExpr :: edb_expr:compiled_expr(), Fmt :: format_full | format_short.
-spec format_bytes(Bytes :: non_neg_integer()) -> binary().
-spec slice_list(List, Window) -> Slice when List :: [A], Window :: window(), Slice :: [A].