Build-matched symbol bundles and offline crash diagnosis for MoonBit Native.
objcopy --only-keep-debug app app.debug
strip --strip-debug appmoon run cmd --target native -- pack symbols-linux app app.debug libplugin.so libplugin.so.debug
moon run cmd --target native -- verify symbols-linux
moon run cmd --target native -- analyze symbols-linux crash.coremoon run cmd --target native -- pack symbols-windows app.exe app.pdb plugin.dll plugin.pdb
moon run cmd --target native -- verify symbols-windows
moon run cmd --target native -- analyze symbols-windows crash.dmpasync fn diagnose(bundle_dir : String, dump_file : String) -> @crash.Report {
let bundle = @crash.Bundle::open(bundle_dir)
@crash.analyze_file(dump_file, bundle~)
}| Frame status | Meaning |
|---|---|
| resolved | At least a function or a source file and line was found. |
| missing_symbols | The bundle or a needed artifact is absent. |
| identity_mismatch | The bundle contains a differently built module of the same name, or a file has a different Build ID or GUID and Age. |
| integrity_mismatch | The identity matches and the SHA-256 differs. |
| identity_unavailable | The dump has no usable build identity for the module. |
| no_module | The instruction is outside the recorded module ranges. |
| unresolved | The matching symbols give no location, or a required artifact cannot be read or parsed. |
python3 examples/capture.py artifacts/linux --alternate
python3 examples/capture.py artifacts/orbit --orbit
python3 examples/check.py artifacts/linux artifacts/orbitpython examples/capture.py artifacts/windows --alternate
python examples/check.py artifacts/windowspub(all) suberror CrashError {
InvalidManifest(String)
UnsupportedFormat(String)
IdentityMismatch(String)
IntegrityMismatch(String)
MissingArtifact(String)
InvalidArtifact(String)
InvalidInput(String)
} derive(Debug)impl Show for CrashErrorpub struct FrameReport {
address : UInt64
lookup_address : UInt64
kind : String
module_path : String?
module_offset : UInt64?
build_id : String?
status : FrameStatus
function : String?
file : String?
line : Int?
detail : String?
} derive(Debug)impl ToJson for FrameReportpub struct LoadedModule {
path : String
base : UInt64
build_id : String?
ranges : ReadOnlyArray[AddressRange]
} derive(Debug)impl ToJson for LoadedModulepub struct Report {
platform : Platform
architecture : String
thread_id : UInt64
exception : String
modules : ReadOnlyArray[LoadedModule]
frames : ReadOnlyArray[FrameReport]
} derive(Debug)