# `DalaDev.CrashDump`
[🔗](https://github.com/manhvu/dala_dev/blob/main/lib/dala_dev/crash_dump.ex#L1)

Parse BEAM crash dumps from devices.

BEAM crash dumps are text files generated when an Erlang VM crashes.
This module parses them to extract useful information for debugging
dala Elixir nodes.

## Examples

    # Parse a crash dump file
    {:ok, info} = DalaDev.CrashDump.parse_file("erl_crash.dump")

    # Parse from a device
    {:ok, info} = DalaDev.CrashDump.fetch_from_device(node, "/path/to/crash.dump")

    # Generate a summary report
    report = DalaDev.CrashDump.summary(info)

# `crash_info`

```elixir
@type crash_info() :: %{
  header: map(),
  system_info: map(),
  process_info: [map()],
  ports: [map()],
  ets_tables: [map()],
  timers: [map()],
  error_info: map() | nil,
  memory: map(),
  summary: String.t()
}
```

# `fetch_from_device`

```elixir
@spec fetch_from_device(node(), String.t(), keyword()) ::
  {:ok, crash_info()} | {:error, term()}
```

Fetch a crash dump from a remote device and parse it.

Options:
- `:timeout` - RPC timeout in ms (default: 30_000)

# `html_report`

```elixir
@spec html_report(crash_info()) :: String.t()
```

Generate an HTML report from crash dump info.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, crash_info()} | {:error, term()}
```

Parse crash dump content from a string.

Returns a crash_info map with all parsed sections.

# `parse_file`

```elixir
@spec parse_file(String.t()) :: {:ok, crash_info()} | {:error, term()}
```

Parse a crash dump file.

Returns a crash_info map with all parsed sections.

# `summary`

```elixir
@spec summary(crash_info()) :: String.t()
```

Generate a human-readable summary of the crash dump.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
