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

accessor()

-opaque accessor()

callback(Result)

-opaque callback(Result)

eval_name()

-type eval_name() :: binary() | none.

evaluation_result()

-type evaluation_result() ::
          #{type := success, value_rep := binary(), structure := none | structure()} |
          #{type := exception,
            class := error | exit | throw,
            reason := term(),
            stacktrace := erlang:stacktrace()}.

scope()

-type scope() :: #{type := process | locals | registers, variables := [variable()]}.

structure()

-type structure() :: #{count := pos_integer(), accessor := accessor(), evaluate_name := eval_name()}.

variable()

-type variable() :: #{name := binary(), value_rep := binary(), structure := none | structure()}.

window()

-type window() :: #{start := pos_integer(), count := non_neg_integer() | infinity}.

Functions

eval(Opts)

-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)}.

evaluate_callback(Expr, CompiledExpr, Fmt)

-spec evaluate_callback(Expr, CompiledExpr, Fmt) -> callback(evaluation_result())
                           when
                               Expr :: binary(),
                               CompiledExpr :: edb_expr:compiled_expr(),
                               Fmt :: format_full | format_short.

format_bytes(Bytes)

-spec format_bytes(Bytes :: non_neg_integer()) -> binary().

scopes_callback(Pid)

-spec scopes_callback(Pid) -> callback([scope()]) when Pid :: pid().

slice_list(List, Window)

-spec slice_list(List, Window) -> Slice when List :: [A], Window :: window(), Slice :: [A].

structure_callback(Accessor, EvalName, Window)

-spec structure_callback(Accessor, EvalName, Window) -> callback([variable()])
                            when Accessor :: accessor(), EvalName :: eval_name(), Window :: window().