diff --git a/arch/arm/src/common/arm_backtrace_sp.c b/arch/arm/src/common/arm_backtrace_sp.c index b143d551c7..47ec8f324e 100644 --- a/arch/arm/src/common/arm_backtrace_sp.c +++ b/arch/arm/src/common/arm_backtrace_sp.c @@ -77,11 +77,6 @@ static bool in_code_region(unsigned long pc) { int i = 0; - if (pc >= (unsigned long)_START_TEXT && pc < (unsigned long)_END_TEXT) - { - return true; - } - if (g_backtrace_code_regions) { while (g_backtrace_code_regions[i] && @@ -98,6 +93,13 @@ static bool in_code_region(unsigned long pc) } } + /* When g_backtrace_code_regions is null, try to use all the text section */ + + else if (pc >= (unsigned long)_START_TEXT && pc < (unsigned long)_END_TEXT) + { + return true; + } + return false; }