diff options
author | Simon Marlow <marlowsd@gmail.com> | 2016-06-29 21:50:18 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-07-01 13:26:26 +0100 |
commit | 6377757918c1e7f63638d6f258cad8d5f02bb6a7 (patch) | |
tree | f536fb6672918dee483c30772a75e9ad97bc6bd9 | |
parent | ee8d1facb20ab579c44bf4cd7d5fd807d547b6ad (diff) | |
download | haskell-6377757918c1e7f63638d6f258cad8d5f02bb6a7.tar.gz |
Linker: some extra debugging / logging
-rw-r--r-- | rts/Linker.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index b41bc1a641..894a31d80d 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1465,6 +1465,27 @@ void ghci_enquire(SymbolAddr* addr) } } } + +void ghci_find(SymbolAddr *addr); +void ghci_find(SymbolAddr *addr) +{ + ObjectCode *oc; + uint32_t i; + + for (oc = objects; oc != NULL; oc = oc->next) { + for (i = 0; i < (uint32_t)oc->n_sections; i++) { + Section *section = &oc->sections[i]; + if (addr > section->start && + (StgWord)addr < (StgWord)section->start+section->size) { + debugBelch("%p is in %" PATH_FMT, addr, + oc->archiveMemberName ? + oc->archiveMemberName : oc->fileName); + debugBelch(", section %d, offset %lx\n", i, + (StgWord)addr - (StgWord)section->start); + } + } + } +} #endif #if RTS_LINKER_USE_MMAP @@ -2537,6 +2558,10 @@ int ocTryLoad (ObjectCode* oc) { } } + IF_DEBUG(linker, debugBelch("Resolving %" PATH_FMT "\n", + oc->archiveMemberName ? + oc->archiveMemberName : oc->fileName)); + # if defined(OBJFORMAT_ELF) r = ocResolve_ELF ( oc ); # elif defined(OBJFORMAT_PEi386) |