Remote debugging functions for inspecting and controlling remote nodes.
These functions automatically use the node selected via
DalaDev.Remote.select_node/1.
Summary
Functions
Evaluates Elixir code on the selected node.
Gets the state of a process on the selected node.
Inspects a process on the selected node.
Gets a memory report from the selected node.
Gets the supervision tree from the selected node.
Traces messages sent to/from a process on the selected node.
Functions
Evaluates Elixir code on the selected node.
Returns {:ok, result} on success, {:error, reason} on failure.
Examples
iex> DalaDev.Remote.Debugger.eval("1 + 1")
{:ok, 2}
iex> DalaDev.Remote.Debugger.eval("Enum.map(1..3, &(&1 * 2))")
{:ok, [2, 4, 6]}
iex> DalaDev.Remote.Debugger.eval("MyApp.Config.get(:api_key)")
{:ok, "secret_key"}
Gets the state of a process on the selected node.
Similar to :sys.get_state/1 from Erlang/OTP, this function retrieves
the internal state of a process. The process must be a system process
(e.g., a GenServer, GenStateMachine, or other process that implements
the sys protocol).
Parameters
pid_or_name- A PID or registered name of the process
Returns
{:ok, state}on success, wherestateis the process state{:error, reason}on failure
Examples
# Get state of a process by PID
iex> DalaDev.Remote.Debugger.get_state(#PID<0.123.0>)
{:ok, %{data: "...", status: :idle}}
# Get state of a process by registered name
iex> DalaDev.Remote.Debugger.get_state(:my_worker)
{:ok, %{count: 42}}See Also
Inspects a process on the selected node.
The process can be specified as:
- A PID (e.g.,
#PID<0.123.0>) - A registered name (atom)
- A module name (atom)
- A
{mod, fun}tuple
Returns {:ok, info} on success, {:error, reason} on failure.
Gets a memory report from the selected node.
Returns {:ok, report} on success, {:error, reason} on failure.
Gets the supervision tree from the selected node.
Returns {:ok, tree} on success, {:error, reason} on failure.
Traces messages sent to/from a process on the selected node.
Returns {:ok, messages} on success, {:error, reason} on failure.
Options
:duration- Tracing duration in ms (default: 5000):timeout- RPC timeout in ms (defaults to remote timeout)