Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `binary:match/2` and `binary:match/3`
- Added `supervisor:which_children/1`
- Added `monitored_by` in `process_info/2`
- Added `AVM_PRINT_PROCESS_CRASH_DUMPS` option

### Changed

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option(AVM_RELEASE "Build an AtomVM release" OFF)
option(AVM_CREATE_STACKTRACES "Create stacktraces" ON)
option(AVM_BUILD_RUNTIME_ONLY "Only build the AtomVM runtime" OFF)
option(COVERAGE "Build for code coverage" OFF)
option(AVM_PRINT_PROCESS_CRASH_DUMPS "Print crash reports when processes die with non-standard reasons" ON)

if((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") OR
(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") OR
Expand Down
4 changes: 4 additions & 0 deletions src/libAtomVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ if(HAVE_PLATFORM_ATOMIC_H)
target_compile_definitions(libAtomVM PUBLIC HAVE_PLATFORM_ATOMIC_H)
endif()

if (AVM_PRINT_PROCESS_CRASH_DUMPS)
target_compile_definitions(libAtomVM PUBLIC AVM_PRINT_PROCESS_CRASH_DUMPS)
endif()

# Platforms that run select in a task must set this option
if(AVM_SELECT_IN_TASK)
target_compile_definitions(libAtomVM PUBLIC AVM_SELECT_IN_TASK)
Expand Down
2 changes: 2 additions & 0 deletions src/libAtomVM/opcodesswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7181,10 +7181,12 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
}
}

#ifdef AVM_PRINT_PROCESS_CRASH_DUMPS
// Do not print crash dump if reason is normal or shutdown.
if (x_regs[0] != LOWERCASE_EXIT_ATOM || (x_regs[1] != NORMAL_ATOM && x_regs[1] != SHUTDOWN_ATOM)) {
context_dump(ctx);
}
#endif

if (x_regs[0] == LOWERCASE_EXIT_ATOM) {
ctx->exit_reason = x_regs[1];
Expand Down
Loading