LiveDebugger.Structs.Trace (LiveDebugger v0.1.4)

View Source

This module provides a struct to represent a trace.

ID is number generated by :dbg tracer. PID is always present. CID is optional - it is filled when trace comes from LiveComponent.

When trace has PID and CID it means that it comes from LiveComponent. When trace has only PID it means that it comes from LiveView. There cannot be a trace with CID and without PID.

Summary

Functions

Checks if the trace is a delete live component trace.

Creates a new trace struct.

Returns the node id from the trace. It is PID if trace comes from a LiveView, CID if trace comes from a LiveComponent.

Types

t()

@type t() :: %LiveDebugger.Structs.Trace{
  args: list(),
  arity: non_neg_integer(),
  cid: struct() | nil,
  function: atom(),
  id: integer(),
  module: atom(),
  pid: pid(),
  timestamp: non_neg_integer()
}

Functions

callback_name(trace)

@spec callback_name(t()) :: String.t()

live_component_delete?(arg1)

@spec live_component_delete?(t()) :: boolean()

Checks if the trace is a delete live component trace.

new(id, module, function, args, pid)

@spec new(integer(), atom(), atom(), list(), pid()) :: t()

Creates a new trace struct.

new(id, module, function, args, pid, cid)

@spec new(integer(), atom(), atom(), list(), pid(), LiveDebugger.CommonTypes.cid()) ::
  t()

node_id(trace)

@spec node_id(t()) :: pid() | LiveDebugger.CommonTypes.cid()

Returns the node id from the trace. It is PID if trace comes from a LiveView, CID if trace comes from a LiveComponent.