Skip to content

Commit d4ab674

Browse files
committed
Merge pull request #1799 from mat-hek/mf/allow-disable-dumps
Add AVM_PRINT_PROCESS_CRASH_DUMPS option These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents cac5a1d + bcfdcc6 commit d4ab674

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5757
- Added mock implementation for `current_stacktrace` in `process_info`
5858
- Added `erlang:list_to_bitstring`
5959
- Reimplemented `lists:keyfind`, `lists:keymember` and `lists:member` as NIFs
60+
- Added `AVM_PRINT_PROCESS_CRASH_DUMPS` option
6061

6162
### Changed
6263

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ option(AVM_RELEASE "Build an AtomVM release" OFF)
3939
option(AVM_CREATE_STACKTRACES "Create stacktraces" ON)
4040
option(AVM_BUILD_RUNTIME_ONLY "Only build the AtomVM runtime" OFF)
4141
option(COVERAGE "Build for code coverage" OFF)
42+
option(AVM_PRINT_PROCESS_CRASH_DUMPS "Print crash reports when processes die with non-standard reasons" ON)
4243

4344
# JIT & execution of precompiled code
4445
if(NOT Erlang_VERSION VERSION_GREATER_EQUAL "23")

src/libAtomVM/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ if(HAVE_PLATFORM_ATOMIC_H)
187187
target_compile_definitions(libAtomVM PUBLIC HAVE_PLATFORM_ATOMIC_H)
188188
endif()
189189

190+
if (AVM_PRINT_PROCESS_CRASH_DUMPS)
191+
target_compile_definitions(libAtomVM PUBLIC AVM_PRINT_PROCESS_CRASH_DUMPS)
192+
endif()
193+
190194
# Platforms that run select in a task must set this option
191195
if(AVM_SELECT_IN_TASK)
192196
target_compile_definitions(libAtomVM PUBLIC AVM_SELECT_IN_TASK)

src/libAtomVM/opcodesswitch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7429,10 +7429,12 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
74297429
}
74307430
}
74317431

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

74377439
if (x_regs[0] == LOWERCASE_EXIT_ATOM) {
74387440
ctx->exit_reason = x_regs[1];

0 commit comments

Comments
 (0)