summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2010-12-03 22:38:02 (GMT)
committersagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2010-12-03 22:38:02 (GMT)
commit9abc7a50ef3cbd89fca9bfc7e7eff60f8b44eb50 (patch)
tree1b23f6ac6a136d75d532129ef1d1095c3d9e3d5d /src
parent87ef1f3346ea8764c14ed54c771194dffebfe943 (diff)
downloadcv2pdb-9abc7a50ef3cbd89fca9bfc7e7eff60f8b44eb50.zip
cv2pdb-9abc7a50ef3cbd89fca9bfc7e7eff60f8b44eb50.tar.gz
cv2pdb-9abc7a50ef3cbd89fca9bfc7e7eff60f8b44eb50.tar.bz2
now converting only class pointers to references, not pointers to structs or void
Diffstat (limited to 'src')
-rw-r--r--src/cv2pdb.cpp9
-rw-r--r--src/cv2pdb.h1
-rw-r--r--src/cvutil.cpp12
-rw-r--r--src/cvutil.h1
4 files changed, 22 insertions, 1 deletions
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp
index e61fd12..f4f674e 100644
--- a/src/cv2pdb.cpp
+++ b/src/cv2pdb.cpp
@@ -1863,6 +1863,13 @@ bool CV2PDB::isCppInterface(const codeview_type* cvtype)
return off == 0;
}
+bool CV2PDB::isClassType(int type)
+{
+ if(const codeview_type* cvt = getTypeData(type))
+ return isClass(cvt);
+ return false;
+}
+
void CV2PDB::ensureUDT(int type, const codeview_type* cvtype)
{
if (getStructProperty(cvtype) & kPropIncomplete)
@@ -2125,7 +2132,7 @@ bool CV2PDB::initGlobalTypes()
case LF_POINTER_V1:
dtype->pointer_v2.id = LF_POINTER_V2;
dtype->pointer_v2.datatype = translateType(type->pointer_v1.datatype);
- if (Dversion > 0 && type->pointer_v1.datatype >= 0x1000
+ if (Dversion > 0 && isClassType(type->pointer_v1.datatype)
&& (type->pointer_v1.attribute & 0xE0) == 0)
{
if (thisIsNotRef) // const pointer for this
diff --git a/src/cv2pdb.h b/src/cv2pdb.h
index 0b93b38..cdfed36 100644
--- a/src/cv2pdb.h
+++ b/src/cv2pdb.h
@@ -79,6 +79,7 @@ public:
int fixProperty(int type, int prop, int fieldType);
bool derivesFromObject(const codeview_type* cvtype);
bool isCppInterface(const codeview_type* cvtype);
+ bool isClassType(int type);
int sizeofClassType(const codeview_type* cvtype);
int sizeofBasicType(int type);
diff --git a/src/cvutil.cpp b/src/cvutil.cpp
index c125b41..64802f2 100644
--- a/src/cvutil.cpp
+++ b/src/cvutil.cpp
@@ -21,6 +21,18 @@ bool isStruct(const codeview_type* cvtype)
return false;
}
+bool isClass(const codeview_type* cvtype)
+{
+ switch(cvtype->common.id)
+ {
+ case LF_CLASS_V1:
+ case LF_CLASS_V2:
+ case LF_CLASS_V3:
+ return true;
+ }
+ return false;
+}
+
int getStructProperty(const codeview_type* cvtype)
{
switch(cvtype->common.id)
diff --git a/src/cvutil.h b/src/cvutil.h
index 83b0939..4b35c6a 100644
--- a/src/cvutil.h
+++ b/src/cvutil.h
@@ -39,6 +39,7 @@ static const int kPropIncomplete = 0x80;
static const int kPropScoped = 0x100;
bool isStruct(const codeview_type* cvtype);
+bool isClass(const codeview_type* cvtype);
int getStructProperty(const codeview_type* cvtype);
int getStructFieldlist(const codeview_type* cvtype);
bool isCompleteStruct(const codeview_type* type, const BYTE* name, bool cstr);