Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-02-15 18:43:20 -0500
committerEugene Tarassov2014-02-15 18:43:20 -0500
commitccb041d0eaed9c4fe7a27171d2fa1f6f2bde5834 (patch)
tree938c744781e9592efdd3f68288d5dab32af9b2ce
parentc4cc52f1e56395769b41551c29314a9b439bfda7 (diff)
downloadorg.eclipse.tcf.agent-ccb041d0eaed9c4fe7a27171d2fa1f6f2bde5834.tar.gz
org.eclipse.tcf.agent-ccb041d0eaed9c4fe7a27171d2fa1f6f2bde5834.tar.xz
org.eclipse.tcf.agent-ccb041d0eaed9c4fe7a27171d2fa1f6f2bde5834.zip
Bug 428117 - Debugger does not report sources file after stopped at main
-rw-r--r--agent/tcf/services/dwarfcache.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/agent/tcf/services/dwarfcache.c b/agent/tcf/services/dwarfcache.c
index 23adbbaa..19326215 100644
--- a/agent/tcf/services/dwarfcache.c
+++ b/agent/tcf/services/dwarfcache.c
@@ -851,6 +851,10 @@ static int addr_ranges_comparator(const void * x, const void * y) {
static void add_addr_range(ELF_Section * sec, CompUnit * unit, ContextAddress addr, ContextAddress size) {
UnitAddressRange * range = NULL;
+ if (addr + size <= addr) {
+ if (size == 0) return;
+ size = 0 - addr;
+ }
if (sCache->mAddrRangesCnt >= sCache->mAddrRangesMax) {
sCache->mAddrRangesMax = sCache->mAddrRangesMax == 0 ? 64 : sCache->mAddrRangesMax * 2;
sCache->mAddrRanges = (UnitAddressRange *)loc_realloc(sCache->mAddrRanges, sizeof(UnitAddressRange) * sCache->mAddrRangesMax);
@@ -981,9 +985,18 @@ static void load_addr_ranges(void) {
for (i = 0; i < sCache->mAddrRangesCnt - 1; i++) {
UnitAddressRange * x = sCache->mAddrRanges + i;
UnitAddressRange * y = x + 1;
+ ContextAddress x_end = x->mAddr + x->mSize;
if (x->mSection == y->mSection && x->mUnit == y->mUnit &&
- x->mAddr == y->mAddr && x->mSize == y->mSize) {
+ (x_end == 0 || x_end >= y->mAddr)) {
/* Skip duplicate entry */
+ ContextAddress y_end = y->mAddr + y->mSize;
+ y->mAddr = x->mAddr;
+ if (x_end == 0 || (y_end != 0 && x_end > y_end)) {
+ y->mSize = x->mSize;
+ }
+ else {
+ y->mSize = y_end - x->mAddr;
+ }
continue;
}
if (j < i) memcpy(sCache->mAddrRanges + j, x, sizeof(UnitAddressRange));

Back to the top