diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-27 05:22:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-27 05:22:46 +0000 |
commit | d99d49c6cbe3af633233a1cff7897ec2f1887395 (patch) | |
tree | 9b44ea809471c4f5c3c0a90bfb844145e124e04a /clang | |
parent | 456b1edd0dc25342c5b328e9eb73fd8274be6f43 (diff) | |
download | bcm5719-llvm-d99d49c6cbe3af633233a1cff7897ec2f1887395.tar.gz bcm5719-llvm-d99d49c6cbe3af633233a1cff7897ec2f1887395.zip |
Easier debugging with Visual Studio Visualizers, from Nikola Smiljanic!
llvm-svn: 136207
Diffstat (limited to 'clang')
-rw-r--r-- | clang/utils/clangVisualizers.txt | 44 | ||||
-rw-r--r-- | clang/www/hacking.html | 22 |
2 files changed, 66 insertions, 0 deletions
diff --git a/clang/utils/clangVisualizers.txt b/clang/utils/clangVisualizers.txt new file mode 100644 index 00000000000..f9f834b76c5 --- /dev/null +++ b/clang/utils/clangVisualizers.txt @@ -0,0 +1,44 @@ + +[Visualizer] + +llvm::SmallVector<*,*>{ + preview ( + #( + "[", + ($T1*)$e.EndX - ($T1*)$e.BeginX, + "](", + #array( + expr: (($T1*)$e.BeginX)[$i], + size: ($T1*)$e.EndX - ($T1*)$e.BeginX + ), + ")" + ) + ) + + children ( + #( + #([size] : ($T1*)$e.EndX - ($T1*)$e.BeginX), + #([capacity] : ($T1*)$e.CapacityX - ($T1*)$e.BeginX), + #array( + expr: (($T1*)$e.BeginX)[$i], + size: ($T1*)$e.EndX - ($T1*)$e.BeginX + ) + ) + ) +} + +llvm::StringRef{ + preview ([$e.Data,s]) + stringview ([$e.Data,sb]) + + children ( + #( + #([size] : $e.Length), + #array(expr: $e.Data[$i], size: $e.Length) + ) + ) +} + +clang::Token{ + preview((clang::tok::TokenKind)(int)$e.Kind) +}
\ No newline at end of file diff --git a/clang/www/hacking.html b/clang/www/hacking.html index 969a39c5599..b65768c9873 100644 --- a/clang/www/hacking.html +++ b/clang/www/hacking.html @@ -86,6 +86,28 @@ </ul> <!--=====================================================================--> + <h3 id="debuggingVisualStudio">Debugging using Visual Studio</h3> + <!--=====================================================================--> + + <p>The file <tt>utils/clangVisualizers.txt</tt> provides debugger visualizers that make debugging + of more complex data types much easier.</p> + <p>There are two ways to install them:</p> + + <ul> + <li>Put the path to <tt>clangVisualizers.txt</tt> in the environment variable called + <tt>_vcee_autoexp</tt>. This method should work for Visual Studio 2008 and above. + </li> + <li>Edit your local <tt>autoexp.dat</tt> (make sure you make a backup first!), + located in <tt>Visual Studio Directory\Common7\Packages\Debugger</tt> and append + the contents of <tt>clangVisuailzers.txt</tt> to it. This method should work for + Visual Studio 2005 and above. + </li> + </ul> + + <p><i>[Note: To disable the visualizer for any specific variable, type + <tt>variable_name,!</tt> inside the watch window.]</i></p> + + <!--=====================================================================--> <h2 id="testing">Testing</h2> <!--=====================================================================--> |