summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2017-06-18 07:42:53 (GMT)
committerRainer Schuetze <r.sagitario@gmx.de>2017-06-18 07:42:53 (GMT)
commit8491f43ca9f13a8673211841f00dc7241eebe47b (patch)
treebb374ccc8e2f7b50fc6642b861b3a50d03fad496 /src
parent31189818cbfc6d0bebf82025f3df632a287b61d6 (diff)
downloadcv2pdb-8491f43ca9f13a8673211841f00dc7241eebe47b.zip
cv2pdb-8491f43ca9f13a8673211841f00dc7241eebe47b.tar.gz
cv2pdb-8491f43ca9f13a8673211841f00dc7241eebe47b.tar.bz2
fix building with VS2012 or earlier
Diffstat (limited to 'src')
-rw-r--r--src/cv2pdb.vcproj8
-rw-r--r--src/readDwarf.cpp18
2 files changed, 18 insertions, 8 deletions
diff --git a/src/cv2pdb.vcproj b/src/cv2pdb.vcproj
index fbf1e9a..4bd0db6 100644
--- a/src/cv2pdb.vcproj
+++ b/src/cv2pdb.vcproj
@@ -208,6 +208,10 @@
>
</File>
<File
+ RelativePath=".\dwarflines.cpp"
+ >
+ </File>
+ <File
RelativePath=".\LastError.h"
>
</File>
@@ -236,6 +240,10 @@
>
</File>
<File
+ RelativePath=".\readDwarf.cpp"
+ >
+ </File>
+ <File
RelativePath=".\symutil.cpp"
>
</File>
diff --git a/src/readDwarf.cpp b/src/readDwarf.cpp
index 1bab48e..7fe983b 100644
--- a/src/readDwarf.cpp
+++ b/src/readDwarf.cpp
@@ -16,6 +16,7 @@ static Location mkInReg(unsigned reg)
Location l;
l.type = Location::InReg;
l.reg = reg;
+ l.off = 0;
return l;
}
@@ -23,6 +24,7 @@ static Location mkAbs(int off)
{
Location l;
l.type = Location::Abs;
+ l.reg = 0;
l.off = off;
return l;
}
@@ -50,7 +52,7 @@ Location decodeLocation(const DWARF_Attribute& attr, const Location* frameBase,
Location stack[256];
int stackDepth = 0;
if (at == DW_AT_data_member_location)
- stack[stackDepth++] = Location { Location::Abs, 0, 0 };
+ stack[stackDepth++] = mkAbs(0);
for (;;)
{
@@ -86,10 +88,10 @@ Location decodeLocation(const DWARF_Attribute& attr, const Location* frameBase,
case DW_OP_constu: stack[stackDepth++] = mkAbs(LEB128(p)); break;
case DW_OP_consts: stack[stackDepth++] = mkAbs(SLEB128(p)); break;
- case DW_OP_plus_uconst:
+ case DW_OP_plus_uconst:
if (stack[stackDepth - 1].is_inreg())
return invalid;
- stack[stackDepth - 1].off += LEB128(p);
+ stack[stackDepth - 1].off += LEB128(p);
break;
case DW_OP_lit0: case DW_OP_lit1: case DW_OP_lit2: case DW_OP_lit3:
@@ -330,7 +332,7 @@ void DIECursor::gotoSibling()
// use sibling pointer, if available
ptr = sibling;
hasChild = false;
- }
+ }
else if (hasChild)
{
int currLevel = level;
@@ -453,10 +455,10 @@ bool DIECursor::readNext(DWARF_InfoData& id, bool stopAtNull)
switch (attr)
{
- case DW_AT_byte_size:
+ case DW_AT_byte_size:
assert(a.type == Const || a.type == Ref || a.type == ExprLoc);
if (a.type == Const) // TODO: other types not supported yet
- id.byte_size = a.cons;
+ id.byte_size = a.cons;
break;
case DW_AT_sibling: assert(a.type == Ref); id.sibling = a.ref; break;
case DW_AT_encoding: assert(a.type == Const); id.encoding = a.cons; break;
@@ -483,12 +485,12 @@ bool DIECursor::readNext(DWARF_InfoData& id, bool stopAtNull)
case DW_AT_type: assert(a.type == Ref); id.type = a.ref; break;
case DW_AT_inline: assert(a.type == Const); id.inlined = a.cons; break;
case DW_AT_external: assert(a.type == Flag); id.external = a.flag; break;
- case DW_AT_upper_bound:
+ case DW_AT_upper_bound:
assert(a.type == Const || a.type == Ref || a.type == ExprLoc);
if (a.type == Const) // TODO: other types not supported yet
id.upper_bound = a.cons;
break;
- case DW_AT_lower_bound:
+ 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
id.lower_bound = a.cons;