diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2017-03-22 14:51:07 (GMT) |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2018-03-23 18:02:43 (GMT) |
commit | dca8f5d5edf9fbf1002e59473e903142b0afd802 (patch) | |
tree | cb3eca3dbb8601e857c083f1c1a4c0cb36cb8022 | |
parent | f9c54374f07264f0320eab3dca2d8764813ad8c5 (diff) | |
download | cv2pdb-dca8f5d5edf9fbf1002e59473e903142b0afd802.zip cv2pdb-dca8f5d5edf9fbf1002e59473e903142b0afd802.tar.gz cv2pdb-dca8f5d5edf9fbf1002e59473e903142b0afd802.tar.bz2 |
CV2PDB::getDWARFSubrangeInfo: use language-specific default lower bound
-rw-r--r-- | src/dwarf2pdb.cpp | 5 | ||||
-rw-r--r-- | src/readDwarf.cpp | 6 | ||||
-rw-r--r-- | src/readDwarf.h | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp index 221e8af..2a62a00 100644 --- a/src/dwarf2pdb.cpp +++ b/src/dwarf2pdb.cpp @@ -931,14 +931,15 @@ void CV2PDB::getDWARFSubrangeInfo(DWARF_InfoData& subrangeid, DWARF_CompilationU // In case of error, return plausible defaults. Assume the array
// contains one item: this is probably helpful to users.
basetype = T_INT4;
- lowerBound = 0;
+ lowerBound = currentDefaultLowerBound;
upperBound = lowerBound;
if (!cu || subrangeid.tag != DW_TAG_subrange_type)
return;
basetype = T_INT4; // TODO: somehow use subrangeid.type
- lowerBound = subrangeid.lower_bound;
+ if (subrangeid.has_lower_bound)
+ lowerBound = subrangeid.lower_bound;
upperBound = subrangeid.upper_bound;
}
diff --git a/src/readDwarf.cpp b/src/readDwarf.cpp index e5895fc..be1952c 100644 --- a/src/readDwarf.cpp +++ b/src/readDwarf.cpp @@ -492,8 +492,12 @@ bool DIECursor::readNext(DWARF_InfoData& id, bool stopAtNull) break;
case DW_AT_lower_bound:
assert(a.type == Const || a.type == Ref || a.type == ExprLoc);
- if (a.type == Const) // TODO: other types not supported yet
+ if (a.type == Const)
+ {
+ // TODO: other types not supported yet
id.lower_bound = a.cons;
+ id.has_lower_bound = true;
+ }
break;
case DW_AT_containing_type: assert(a.type == Ref); id.containing_type = a.ref; break;
case DW_AT_specification: assert(a.type == Ref); id.specification = a.ref; break;
diff --git a/src/readDwarf.h b/src/readDwarf.h index 8d98a00..8b9de3d 100644 --- a/src/readDwarf.h +++ b/src/readDwarf.h @@ -163,6 +163,7 @@ struct DWARF_InfoData DWARF_Attribute frame_base;
long upper_bound;
long lower_bound;
+ bool has_lower_bound;
unsigned language;
void clear()
@@ -192,6 +193,7 @@ struct DWARF_InfoData frame_base.type = Invalid;
upper_bound = 0;
lower_bound = 0;
+ has_lower_bound = false;
language = 0;
}
|