AP_InternalError: only panic in SITL if debug enabled

a user recently had a flow of control panic in quadplane in
cygwin/missionplanner SITL. The panic this caused means we don't get
logging information on what line of code was triggered

the panic in SITL for internal errors is only useful if you have debug
information and can then attach a debugger. Without debug information
it is much better to behave the same as a real vehicle and report an
internal error (with line number)
This commit is contained in:
Andrew Tridgell 2022-10-21 11:28:40 +11:00 committed by Peter Barker
parent 725b7b30ae
commit bb1b2dafae
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ extern const AP_HAL::HAL &hal;
static AP_InternalError instance;
void AP_InternalError::error(const AP_InternalError::error_t e, uint16_t line) {
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL && defined(HAL_DEBUG_BUILD)
switch (e) {
case AP_InternalError::error_t::watchdog_reset:
case AP_InternalError::error_t::main_loop_stuck: