## VS调试器调试技巧

• 调用堆栈
• 鼠标悬停查看变量信息
• 调试过程中直接给变量赋值
• 拖动黄色箭头改变程序运行流程
• 通过ptr+offset,count添加变量监视(watch)

## 断点和追踪点

https://msdn.microsoft.com/zh-cn/library/232dxah7(v=vs.90).aspx

## MACRO - ASSERT、TRACE、VERIFY

Syntax语法

Parameters参数
expression
: A scalar expression (including pointer expressions) that evaluates to nonzero (true) or 0 (false).

message
: The message to display.

filename
: The name of the source file the assertion failed in.

line
: The line number in the source file of the failed assertion.

## MACRO - OutputDebugString

You can use OutputDebugString. OutputDebugString is a macro that depending on your build options either maps to OutputDebugStringA(char const*)or OutputDebugStringW(wchar_t const*). In the later case you will have to supply a wide character string to the function. To create a wide character literal you can use the L prefix:
OutputDebugStringW(L"My output string.");
Normally you will use the macro version together with the _T macro like this:
OutputDebugString(_T("My output string."));
If you project is configured to build for UNICODE it will expand into:
OutputDebugStringW(L"My output string.");
If you are not building for UNICODE it will expand into:
OutputDebugStringA("My output string.");

## Logging Class

Logging Framework from Dr.p
http://www.drdobbs.com/cpp/logging-in-c/201804215