From 46b77c7f691b602961ff77951abcdea52ecce175 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 21 May 2016 23:47:58 +0200 Subject: [PATCH] autoexp.dat instructions added --- README.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/README.md b/README.md index 63d4b64f..88a42e70 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,96 @@ void main() std::cout << (LPCTSTR)path << std::endl; } ``` + +##Debugging +For user friendlier display of variables of WinStd types in Visual Studio 2010 debugger, find the file _autoexp.dat_ in your _C:\Program Files (x86)\Microsoft Visual Studio 2010_ and open it with Notepad. +Locate the `[AutoExpand]` section and add the following lines: +``` +winstd::variant=$BUILTIN(VARIANT) +``` +Locate the `[Visualizer]` section and add the following lines: +``` +; WinStd +winstd::com_obj<*>|winstd::handle<*>|winstd::dplhandle<*>|winstd::cert_context|winstd::cert_chain_context|winstd::cert_store|winstd::crypt_prov|winstd::crypt_hash|winstd::crypt_key|winstd::event_provider|winstd::library|winstd::heap{ + preview ([$e.m_h]) +} +winstd::bstr{ + preview ([$e.m_h,su]) + stringview ([$e.m_h,sub]) +} +winstd::sanitizing_vector<*>{ + preview ( + #( + "S[", + $e._Mylast - $e._Myfirst, + "](", + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mylast - $e._Myfirst), + #([capacity] : $e._Myend - $e._Myfirst), + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ) + ) + ) +} +winstd::eap_attr{ + preview ( + #( + $e.eaType, + " [", + $e.dwLength, + "](", + #array( + expr: $e.pValue[$i], + size: $e.dwLength + ), + ")" + ) + ) + + children ( + #( + #([type] : $e.eaType), + #([size] : $e.dwLength), + #array( + expr: $e.pValue[$i], + size: $e.dwLength + ) + ) + ) +} +winstd::event_data{ + preview ( + #( + "[", + $e.Size, + "](", + #array( + expr: [((unsigned char*)$e.Ptr)[$i],x], + size: $e.Size + ), + ")" + ) + ) + + children ( + #( + #([size] : $e.Size), + #array( + expr: [((unsigned char*)$e.Ptr)[$i],x], + size: $e.Size + ) + ) + ) +} +```