summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Coutand2012-06-28 09:38:49 (EDT)
committerEugene Tarassov2012-06-29 10:40:04 (EDT)
commitc7982cbaf27d2e58404cc5313a14665a9427a08c (patch)
tree8566d491535fc44ff3ce9223043a2d8c51b14ff3
parent436f4747e00e53297faf53a40bc1f81034faf709 (diff)
downloadorg.eclipse.tcf.agent-c7982cbaf27d2e58404cc5313a14665a9427a08c.zip
org.eclipse.tcf.agent-c7982cbaf27d2e58404cc5313a14665a9427a08c.tar.gz
org.eclipse.tcf.agent-c7982cbaf27d2e58404cc5313a14665a9427a08c.tar.bz2
Fix more DWARF relocation.
To be on the safe side, it's better to always go through the relocation code.
-rw-r--r--agent/tcf/services/dwarfcache.c2
-rw-r--r--agent/tcf/services/dwarfecomp.c3
-rw-r--r--agent/tcf/services/dwarfexpr.c3
-rw-r--r--agent/tcf/services/dwarfio.c14
-rw-r--r--agent/tcf/services/dwarfio.h2
5 files changed, 5 insertions, 19 deletions
diff --git a/agent/tcf/services/dwarfcache.c b/agent/tcf/services/dwarfcache.c
index e8412f5..a40f58f 100644
--- a/agent/tcf/services/dwarfcache.c
+++ b/agent/tcf/services/dwarfcache.c
@@ -829,7 +829,7 @@ static void load_addr_ranges(void) {
for (;;) {
ELF_Section * range_sec = NULL;
ContextAddress addr = (ContextAddress)dio_ReadAddressX(&range_sec, addr_size);
- ContextAddress size = (ContextAddress)dio_ReadUX(addr_size);
+ ContextAddress size = (ContextAddress)dio_ReadAddressX(&range_sec, addr_size);
if (addr == 0 && size == 0) break;
if (size == 0) continue;
add_addr_range(range_sec, sCompUnit, addr, size);
diff --git a/agent/tcf/services/dwarfecomp.c b/agent/tcf/services/dwarfecomp.c
index 9ee7169..ff575af 100644
--- a/agent/tcf/services/dwarfecomp.c
+++ b/agent/tcf/services/dwarfecomp.c
@@ -224,12 +224,13 @@ static void op_implicit_pointer(void) {
ContextAddress ref_id = 0;
U8_T offset = 0;
U8_T dio_pos = 0;
+ ELF_Section * DummySect = NULL;
expr_pos++;
if (op == OP_GNU_implicit_pointer && unit->mDesc.mVersion < 3) arg_size = unit->mDesc.mAddressSize;
dio_pos = expr->expr_addr + expr_pos - (U1_T *)expr->section->data;
dio_EnterSection(&expr->unit->mDesc, expr->section, dio_pos);
- ref_id = dio_ReadUX(arg_size);
+ ref_id = dio_ReadAddressX(&DummySect, arg_size);
offset = dio_ReadU8LEB128();
expr_pos += (size_t)(dio_GetPos() - dio_pos);
dio_ExitSection();
diff --git a/agent/tcf/services/dwarfexpr.c b/agent/tcf/services/dwarfexpr.c
index c86246b..648bb16 100644
--- a/agent/tcf/services/dwarfexpr.c
+++ b/agent/tcf/services/dwarfexpr.c
@@ -48,11 +48,12 @@ void dwarf_find_expression(PropertyValue * Value, U8_T IP, DWARFExpressionInfo *
U8_T Offset = 0;
U8_T AddrMax = ~(U8_T)0;
DWARFCache * Cache = (DWARFCache *)Unit->mFile->dwarf_dt_cache;
+ ELF_Section * DummySect = NULL;
assert(Cache->magic == DWARF_CACHE_MAGIC);
if (Cache->mDebugLoc == NULL) str_exception(ERR_INV_DWARF, "Missing .debug_loc section");
dio_EnterSection(&Unit->mDesc, Unit->mDesc.mSection, Value->mAddr - (U1_T *)Unit->mDesc.mSection->data);
- Offset = dio_ReadUX(Value->mSize);
+ Offset = dio_ReadAddressX(&DummySect, Value->mSize);
dio_ExitSection();
Base = Unit->mObject->u.mCode.mLowPC;
if (Unit->mDesc.mAddressSize < 8) AddrMax = ((U8_T)1 << Unit->mDesc.mAddressSize * 8) - 1;
diff --git a/agent/tcf/services/dwarfio.c b/agent/tcf/services/dwarfio.c
index a697442..d52860f 100644
--- a/agent/tcf/services/dwarfio.c
+++ b/agent/tcf/services/dwarfio.c
@@ -254,20 +254,6 @@ I8_T dio_ReadS8LEB128(void) {
return (I8_T)Res;
}
-U8_T dio_ReadUX(int Size) {
- switch (Size) {
- case 2:
- return dio_ReadU2();
- case 4:
- return dio_ReadU4();
- case 8:
- return dio_ReadU8();
- default:
- str_exception(ERR_INV_DWARF, "Invalid data size");
- return 0;
- }
-}
-
U8_T dio_ReadAddressX(ELF_Section ** s, int size) {
U8_T pos = sDataPos;
switch (size) {
diff --git a/agent/tcf/services/dwarfio.h b/agent/tcf/services/dwarfio.h
index 6e60e4e..83c6f3c 100644
--- a/agent/tcf/services/dwarfio.h
+++ b/agent/tcf/services/dwarfio.h
@@ -65,8 +65,6 @@ extern I4_T dio_ReadSLEB128(void);
extern U8_T dio_ReadU8LEB128(void);
extern I8_T dio_ReadS8LEB128(void);
-extern U8_T dio_ReadUX(int Size);
-
/*
* Read link-time address value.
* Relocation tables are used if necessary to compute the address value.