summaryrefslogtreecommitdiffstats
path: root/src/cvutil.cpp
diff options
context:
space:
mode:
authorsagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2012-02-12 16:05:27 (GMT)
committersagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2012-02-12 16:05:27 (GMT)
commit96e6e9fa7388b010f55cf8d122ef03a2a8ab87e4 (patch)
tree43bfb85629d0fa32de2d88d04997642a0828c128 /src/cvutil.cpp
parent805aac230223f45acc7db218eb64589a4adb390e (diff)
downloadcv2pdb-96e6e9fa7388b010f55cf8d122ef03a2a8ab87e4.zip
cv2pdb-96e6e9fa7388b010f55cf8d122ef03a2a8ab87e4.tar.gz
cv2pdb-96e6e9fa7388b010f55cf8d122ef03a2a8ab87e4.tar.bz2
* disabled named enumerator for D basic types to avoid debugger troubles displaying arrays
* added command line switch -e to enable using named enumerator for D basic types * added DWARF support * added x64 support
Diffstat (limited to 'src/cvutil.cpp')
-rw-r--r--src/cvutil.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/cvutil.cpp b/src/cvutil.cpp
index 64802f2..95e8ea3 100644
--- a/src/cvutil.cpp
+++ b/src/cvutil.cpp
@@ -110,7 +110,7 @@ bool isCompleteStruct(const codeview_type* type, const BYTE* name, bool cstr)
int numeric_leaf(int* value, const void* leaf)
{
unsigned short int type = *(const unsigned short int*) leaf;
- leaf = (const unsigned short int*) leaf + 2;
+ leaf = (const unsigned short int*) leaf + 1;
int length = 2;
*value = 0;
@@ -179,3 +179,35 @@ int numeric_leaf(int* value, const void* leaf)
return length;
}
+int write_numeric_leaf(int value, void* leaf)
+{
+ if(value >= 0 && value < LF_NUMERIC)
+ {
+ *(unsigned short int*) leaf = (unsigned short) value;
+ return 2;
+ }
+ unsigned short int* type = (unsigned short int*) leaf;
+ leaf = type + 1;
+ if (value >= -128 && value <= 127)
+ {
+ *type = LF_CHAR;
+ *(char*) leaf = (char)value;
+ return 3;
+ }
+ if (value >= -32768 && value <= 32767)
+ {
+ *type = LF_SHORT;
+ *(short*) leaf = (short)value;
+ return 4;
+ }
+ if (value >= 0 && value <= 65535)
+ {
+ *type = LF_USHORT;
+ *(unsigned short*) leaf = (unsigned short)value;
+ return 4;
+ }
+ *type = LF_LONG;
+ *(long*) leaf = (long)value;
+ return 6;
+}
+