summaryrefslogtreecommitdiffstats
path: root/autoexp.snippet
blob: 6dd1a3b9c92f5e6e527c8117935ba93e5f49fb55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This file is part cv2pdb, a 
;; converter of DMD CodeView debug information to PDB files
;;
;; written by Rainer Schuetze, placed into the Public Domain
;;
;;	 D types
;; 
;; add the content of this file to 
;; <Visual Studio Installation Path>\Common7\Package\Debugger\autoexp.dat
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load helper dll dviewhelper.dll to display strings
;;
;; add the following 2 lines to the [AutoExpand] section
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; [AutoExpand] 

string_viewhelper=$ADDIN(dviewhelper.dll,_DStringView@28)
object_viewhelper=$ADDIN(dviewhelper.dll,_DObjectView@28)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;	 D types visualizer
;; 
;; add the remainder of this file to the [Visualizer] section
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; [Visualizer]

; string: dynamic array of char
const char[]|char[]|string {
    preview ( 
        #if ($e.data == 0) ( "null" )
        #else ( 
        #(
           "[", $e.length, "] ", [$e.__viewhelper]
           ;; "[", $e.length, "] ", [$e.data,s]
        )
      )
    )
    stringview ( 
        #if ($e.data == 0) ( "null" )
           #else ( 
        #(
           [$e.data, s]
        )
      )
    )
    children (
        #(
            length: [$e.length, i],
            data: [$e.data]
        )
    )
}

; 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
            )
        )
    )
}

;; display associative array
;;
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
        )
    )
}

; display tree
internal@aaA<*,*> {
    preview(
      #( "<", $e.key, ", ", $e.value, ">" )
    )
}

;; display null references for class objects
*@* {
    preview(
        #( 
        #if (&$e == 0) ( "null" )
   		#else ( #( "[", [$e.__viewhelper], "] ", [$e,!] ) )
   		;; #else ( #( [$e,!] ) )
    )
  )
}