Skip to content
pubscout

native_stack_traces

0.7.1, released 2 weeks ago by tools.dart.dev

Decode non-symbolic stack traces from AOT-compiled Dart apps using stored debugging info

$ flutter pub add native_stack_traces
Source repository

What it does

This package reads debugging information (DWARF, PDB, Mach‑O) and translates raw stack traces that contain only program counters into symbolic stack traces with file, function, and line numbers. It also provides a CLI tool to perform the translation on error logs.

AI-written summary of version 0.7.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You ship an AOT‑compiled Dart app and want to debug crashes on production devices
  • You need to map stack traces back to source code after stripping debug info
  • You want a command‑line tool to translate logs offline

Skip it when

  • You are not using AOT compilation or your stack traces already contain symbols
  • You need a general-purpose stack‑trace library for runtime error handling

Strengths

  • Supports multiple binary formats (PE/COFF, Mach‑O, ELF) and DWARF/PDB
  • CLI tool simplifies offline translation
  • No code generation required
  • Pure Dart implementation

Weaknesses

  • Limited to non‑symbolic stack traces only
  • Requires access to the original debugging files
  • No runtime symbol resolution

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add dependency and run `dart pub global activate native_stack_traces` for CLI, or import library in code

```dart
import 'package:native_stack_traces/native_stack_traces.dart';

final translated = await NativeStackTraces.translate(
  debugFile: 'app.debug',
  stackTrace: rawStackTrace,
);
print(translated);
```

Alternatives

Packages that do the same job and could replace native_stack_traces.

  • gtk

    GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.

  • stack_trace

    Provides parsing, inspection, and readable formatting of Dart stack traces.

  • flutter_flavorizr

    A utility to easily create and configure application flavors in Flutter.

  • ffi

    Utilities for working with Foreign Function Interface (FFI) code in Dart.

Works with

Packages commonly used together with native_stack_traces: ones it builds on, ones built on it, and its own family.