mdebug

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fe8c772672f36a87bc12085c9c2cc898feb2e188
parent 8243ce5c486524db856c449fbf476a185ba3ad5a
Author: Brian Swetland <swetland@frotz.net>
Date:   Mon,  3 Aug 2015 16:03:05 -0700

lkdebug: use vector table offset register to find vectors

Otherwise if they're not at zero we can't find the thread info.

Diffstat:
Mtools/lkdebug.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/lkdebug.c b/tools/lkdebug.c @@ -143,12 +143,15 @@ void free_lk_threads(lkthread_t *list) { static int load_debuginfo(lkdebuginfo_t *di, int verbose) { u32 x; - if (swdp_ahb_read(DI_OFF_MAGIC, &x)) return -1; + u32 vtbl; + //read Vector Table Offset Register + if (swdp_ahb_read(0xE000ED08, &vtbl)) vtbl = 0; + if (swdp_ahb_read((DI_OFF_MAGIC + vtbl), &x)) return -1; if (x != DI_MAGIC) { if (verbose) xprintf("debuginfo: bad magic\n"); return -1; } - if (swdp_ahb_read(DI_OFF_PTR, &x)) return -1; + if (swdp_ahb_read((DI_OFF_PTR + vtbl), &x)) return -1; if (x & 3) return -1; if (verbose) xprintf("debuginfo @ %08x\n", x); if (swdp_ahb_read32(x, (void*) di, sizeof(lkdebuginfo_t) / 4)) return -1;