Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/agent/tcf
diff options
context:
space:
mode:
authorEugene Tarassov2020-12-30 04:19:20 +0000
committerEugene Tarassov2020-12-30 04:19:20 +0000
commit22568cb1bfa11888d788eb01e7b386dde3010969 (patch)
tree335fc1c6303c5bb4c18e06b2213832da3ebdf2f7 /agent/tcf
parentacb889e9e397a3ab7dfbd39f6bb577481b10e724 (diff)
downloadorg.eclipse.tcf.agent-master.tar.gz
org.eclipse.tcf.agent-master.tar.xz
org.eclipse.tcf.agent-master.zip
TCF Agent: Fixed computation of run-time addresses of symbols from a separate debug info fileHEADmaster
Some versions of Linux require p-header address from debug file, the rest of p-header info - from executable file
Diffstat (limited to 'agent/tcf')
-rw-r--r--agent/tcf/services/tcf_elf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/agent/tcf/services/tcf_elf.c b/agent/tcf/services/tcf_elf.c
index 90292cc1..e6a859f1 100644
--- a/agent/tcf/services/tcf_elf.c
+++ b/agent/tcf/services/tcf_elf.c
@@ -1824,11 +1824,14 @@ ContextAddress elf_run_time_address_in_region(Context * ctx, MemoryRegion * r, E
}
for (i = 0; i < mem_file->pheader_cnt; i++) {
ELF_PHeader * p = mem_file->pheaders + i;
- if (!is_p_header_region(mem_file, p, r)) continue;
- if (addr < p->address || addr >= p->address + p->mem_size) continue;
- rt = (ContextAddress)(addr - p->address + p->offset - r->file_offs + r->addr);
- if (rt < r->addr || rt > r->addr + r->size - 1) continue;
- return rt;
+ if (p->type == PT_LOAD) {
+ U8_T p_addr = i < file->pheader_cnt ? file->pheaders[i].address : p->address;
+ if (addr < p_addr || addr >= p_addr + p->mem_size) continue;
+ if (!is_p_header_region(mem_file, p, r)) continue;
+ rt = (ContextAddress)(addr - p_addr + p->offset - r->file_offs + r->addr);
+ if (rt < r->addr || rt > r->addr + r->size - 1) continue;
+ return rt;
+ }
}
}
else if (sec != NULL) {

Back to the top