diff options
author | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2009-06-11 09:01:00 (GMT) |
---|---|---|
committer | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2009-06-11 09:01:00 (GMT) |
commit | d23bb945bd86c6533c78846f095337d776e2bc4a (patch) | |
tree | fc7d9b2544cb432a84663d316a8d9c23f9001bbf | |
parent | b7a856759a005b30c998e4272b69d998ea88dc27 (diff) | |
download | cv2pdb-d23bb945bd86c6533c78846f095337d776e2bc4a.zip cv2pdb-d23bb945bd86c6533c78846f095337d776e2bc4a.tar.gz cv2pdb-d23bb945bd86c6533c78846f095337d776e2bc4a.tar.bz2 |
v0.8:
- tweaked visualizer macros to detect uninitialized associative arrays and to limit expansion
to arrays with less than 1024 entries
- renamed "data" pointer member of dynamic arrays to "ptr"
-rw-r--r-- | CHANGES | 7 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | autoexp.snippet | 212 | ||||
-rw-r--r-- | src/cv2pdb.cpp | 2 | ||||
-rw-r--r-- | test/cvtest.d | 8 |
6 files changed, 132 insertions, 101 deletions
@@ -50,3 +50,10 @@ Version history 2009-06-08 Version 0.7
* corrected number of field entries in classes or struct, because DMD miscounts private members
+
+2009-06-11 Version 0.8
+
+ * tweaked visualizer macros to detect uninitialized associative arrays and to limit expansion
+ to arrays with less than 1024 entries
+ * renamed data pointer member of dynamic arrays to "ptr" to be consistent with the array property
+ in D.
@@ -19,7 +19,7 @@ Features * generates generic debug info for dynamic arrays, associative arrays and delegates
* autoexp.dat allows convenient display of dynamic and associative arrays in watch windows
* demangles function names for convenient display of callstack
-* support for DMC CodeView information
+* also works for the Digital Mars C/C++ compiler DMC
License information
-------------------
@@ -1 +1 @@ -VERSION = 0.7
+VERSION = 0.8
diff --git a/autoexp.snippet b/autoexp.snippet index 45dd5c8..0165311 100644 --- a/autoexp.snippet +++ b/autoexp.snippet @@ -36,123 +36,141 @@ dstring_viewhelper=$ADDIN(dviewhelper.dll,_DDStringView@28) ; string, wstring and dstring use __viewhelper
string|wstring|dstring {
- preview (
- #if ($e.data == 0) ( "null" )
- #else (
- #(
- "[", $e.length, "] ", [$e.__viewhelper]
- )
- )
- )
- stringview (
- #if ($e.data == 0) ( "null" )
- #else (
- #(
- [$e.data, s]
- )
- )
- )
- children (
- #(
- length: [$e.length, i],
- data: [$e.data]
- )
- )
+
+ preview (
+ #if ($e.ptr == 0) ( "null" )
+ #else (
+ #( "[", $e.length, "] ", [$e.__viewhelper] )
+ )
+ )
+ stringview (
+ #if ($e.ptr == 0) ( "null" )
+ #else (
+ #( [$e.ptr, s] )
+ )
+ )
+ children (
+ #(
+ length: [$e.length, i],
+ data: [$e.ptr]
+ )
+ )
}
; strings as dynamic arrays of char (no __viewhelper, check -D option for cv2pdb!)
const char[]|char[]|const wchar[]|wchar[]|const dchar[]|dchar[] {
- preview (
- #if ($e.data == 0) ( "null" )
- #else (
- #(
- "[", $e.length, "] ", [$e.data]
- )
- )
- )
- stringview (
- #if ($e.data == 0) ( "null" )
- #else (
- #(
- [$e.data, s]
- )
- )
- )
- children (
- #(
- length: [$e.length, i],
- data: [$e.data]
- )
- )
+
+ preview (
+ #if ($e.ptr == 0) ( "null" )
+ #else (
+ #( "[", $e.length, "] ", [$e.ptr] )
+ )
+ )
+ stringview (
+ #if ($e.ptr == 0) ( "null" )
+ #else (
+ #( [$e.ptr, s] )
+ )
+ )
+ children (
+ #(
+ length: [$e.length, i],
+ data: [$e.ptr]
+ )
+ )
}
; dynamic array
*[] {
- preview (
- #if ($e.data == 0) ( "null" )
- #else (
- #(
- "[", $e.length, "](",
- #array
- (
- expr : ($e.data)[$i],
- size : $e.length
- ),
- ")"
- )
- )
- )
- children (
- #(
- length: [$e.length, i],
- #array (
- expr: $e.data[$i],
- size: $e.length
- )
- )
- )
+ preview (
+ #if ($e.ptr == 0) ( "null" )
+ #else (
+ #(
+ "[", $e.length, "](",
+ #array (
+ expr : ($e.ptr)[$i],
+ size : $e.length
+ ),
+ ")"
+ )
+ )
+ )
+ children (
+ #(
+ length: [$e.length, i],
+ #array (
+ expr: $e.ptr[$i],
+ size: $e.length
+ )
+ )
+ )
}
;; display associative array
;;
+;; the "magic" sizes of the basic dynamic array are used to check for uninitialized
+;; arrays
+;; 97UL, 389UL,
+;; 1_543UL, 6_151UL,
+;; 24_593UL, 98_317UL,
+;; 393_241UL, 1_572_869UL,
+;; 6_291_469UL, 25_165_843UL,
+;; 100_663_319UL, 402_653_189UL,
+;; 1_610_612_741UL, 4_294_967_291UL,
aa<*> {
- preview(
- #(
- "[", $e.a->nodes, "] ", [(void*) $e.a]
- )
- )
- children(
- #(
- #array (
- expr: &$e.a->b.data[$i],
- size: $e.a->b.length
- ) :
- #tree (
- head : $e,
- left : left,
- right : right,
- ; size : $c.size
- ) : $e
- )
- )
+ preview(
+ #if($e.a == 0 || $e.a->b.ptr == 0) ( "null" )
+ ; expressions must be in a sinlge line (sigh)
+ #elif($e.a->b.length == 97 || $e.a->b.length == 389 || $e.a->b.length == 1543 || $e.a->b.length == 6151 || $e.a->b.length == 24593 || $e.a->b.length == 98317 || $e.a->b.length == 393241 || $e.a->b.length == 1572869 || $e.a->b.length == 6291469 || $e.a->b.length == 25165843)
+ (
+ #if($e.a->nodes > 1024) (
+ #( "[", $e.a->nodes, "] ", [(void*) $e.a], " too large for expansion" )
+ )
+ #else (
+ #( "[", $e.a->nodes, "] ", [(void*) $e.a] )
+ )
+ )
+ #elif (1) ; no #else in a series of #elif !?
+ (
+ #( "[", $e.a->nodes, "] ", [(void*) $e.a], " uninitialized" )
+ )
+ )
+ children(
+ #if($e.a == 0 || $e.a->b.ptr == 0 || $e.a->nodes > 1024)
+ ( #array( expr: 0, size: 0 ) )
+ #else (
+ #(
+ #array (
+ expr: &$e.a->b.ptr[$i],
+ size: $e.a->b.length
+ ) :
+ #tree (
+ head : $e,
+ left : left,
+ right : right,
+ ) : $e
+ )
+ )
+ )
}
; display tree
internal@aaA<*,*> {
- preview(
- #( "<", $e.key, ", ", $e.value, ">" )
- )
+ preview(
+ #( "<", $e.key, ", ", $e.value, ">" )
+ )
}
-;; display null references for class objects
+; display null references for class objects
*@* {
- preview(
- #(
- #if (&$e == 0) ( "null" )
- #else ( #( "[", [$e.__viewhelper], "] ", [$e,!] ) )
- ;; #else ( #( [$e,!] ) )
- )
- )
+ preview(
+ #(
+ #if (&$e == 0) ( "null" )
+ #else (
+ #( "[", [$e.__viewhelper], "] ", [$e,!] )
+ )
+ )
+ )
}
;; eo section Visualizer for D variables ;;;;;;;;;;;;;;;;;;;;;;
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp index 4a3cba8..48d42b9 100644 --- a/src/cv2pdb.cpp +++ b/src/cv2pdb.cpp @@ -1214,7 +1214,7 @@ const char* CV2PDB::appendDynamicArray(int indexType, int elemType) // member elemType* data[] dfieldtype = (codeview_fieldtype*)(rdtype->fieldlist.list + len1); - int len2 = addFieldMember(dfieldtype, 1, 4, dataptrType, "data"); + int len2 = addFieldMember(dfieldtype, 1, 4, dataptrType, "ptr"); int numElem = 2; rdtype->fieldlist.len = len1 + len2 + 2; diff --git a/test/cvtest.d b/test/cvtest.d index 5c9c0dd..2336fc8 100644 --- a/test/cvtest.d +++ b/test/cvtest.d @@ -168,8 +168,14 @@ int main2(char[][]argv) alias_int_array int_array;
int[] int_oem_long_dynarray; int_oem_long_dynarray ~= 12;
- int[int] local_oem_int_assoc_array; local_oem_int_assoc_array[7] = 17;
+ int[int] local_oem_int_assoc_array;
+ for (int i = 0; i < 1024; i++)
+ local_oem_int_assoc_array[i] = 2*i;
+
+ local_oem_int_assoc_array[5000] = 1;
+
+ int *intptr = int_oem_long_dynarray.ptr;
Object null_obj;
derived_class null_derived;
|