fix(esp8266): fix backtrace does not trace ROM code

This commit is contained in:
Dong Heng
2019-12-02 10:19:52 +08:00
parent b30796bde2
commit a9c34d2c77
2 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,7 @@
#include <stdint.h>
#include "esp8266/eagle_soc.h"
static inline uint32_t prev_text_size(const uint32_t pc)
static uint32_t prev_text_size(const uint32_t pc)
{
uint32_t size;
extern uint32_t _text_start, _text_end;
@ -24,6 +24,8 @@ static inline uint32_t prev_text_size(const uint32_t pc)
size = pc - (uint32_t )&_text_start;
} else if (IS_IRAM(pc)) {
size = pc - IRAM_BASE;
} else if (IS_ROM(pc)) {
size = pc - ROM_BASE;
} else {
size = 0;
}