"별것 아닌 것 같지만, 도움이 되는"은 디버깅 할 때 조사식을 스크립팅 할 수 있도록 도와주는 Visual Studio Extension 입니다.
정상적으로 설치되면 Visual Studio 메뉴-"Tools"-"Script - A Small, Good Thing"이 나타납니다.
- Visual Studio 2013
- Visual Studio 2015
C++
int n = 123;
Python
>>> n = AsVariable('n')
>>> print n
AsDebuggerExtension.AsVariable
Name : n
Value : 123
Type : int
>>> print n.Name
n
>>> print n.Value
123
>>> print n.Type
int
C++
enum Gender {
kMale,
kFemale
};
struct Person {
int age;
Gender gender;
};
Person p = { 2, Gender::kFemale };
Python
>>> p = AsVariable('p')
>>> print p
AsDebuggerExtension.AsVariable
Name : p
Value : {age=2 gender=kFemale (1) }
Type : Person
>>> for c in p.Children: print c
AsDebuggerExtension.AsVariable
Name : age
Value : 2
Type : int
AsDebuggerExtension.AsVariable
Name : gender
Value : kFemale
Type : Gender
>>> print p[0]
AsDebuggerExtension.AsVariable
Name : age
Value : 2
Type : int
>>> print p[1]
AsDebuggerExtension.AsVariable
Name : gender
Value : kFemale
Type : Gender
>>> print p['age']
AsDebuggerExtension.AsVariable
Name : age
Value : 2
Type : int
>>> print p['gender']
AsDebuggerExtension.AsVariable
Name : gender
Value : kFemale
Type : Gender
C++
std::vector<int> v = { 10, 11, 12, 13, 14 };
Python
>>> v = AsVariable('v')
>>> print v
AsDebuggerExtension.AsVariable
Name : v
Value : { size=5 }
Type : std::vector<int,std::allocator<int> >
>>> from vs2015 import *
>>> pyList = LoadVector(AsVariable('v'), lambda x : int(x.Value))
>>> print pyList
[10, 11, 12, 13, 14]
STL 컨테이너 관련 함수
- std::vector - IterateVector, LoadVector
- std::list - IterateList, LoadList
- std::unordered_map - IterateUMap, LoadUMap
- std::map - IterateMap, LoadMap
문자열 관련 함수
- std::string - LoadString
- std::wstring - LoadWString
- char array - LoadCharArray
- wchar_t array - LoadWCharArray