I have the following C ++ code compiled in Program.exe using vs12
class foo { public: foo() { std::cout << "in ctor\n"; } ~foo() { std::cout << "in dtor\n"; } std::string s; }; int main() { foo f{}; }
Then I go to Tools-> Launch Under Debugger ... "and enter the following command in the nearest debugger window
x program!*foo*
This gives me the following conclusion
0:000> x program!*foo* 00007ff6`11ce4b00 Program!foo::~foo (void) 00007ff6`11ceaef0 Program!`foo::~foo'::`1'::dtor$0 (void) 00007ff6`11ce48f0 Program!foo::foo (void) 00007ff6`11ceae90 Program!`foo::foo'::`1'::dtor$0 (void)
I understand that the first output is the foo destructor, and the third is the foo constructor. What are the second and fourth (those that have return lines)? More generally, what are the other places where I can see inverse images in a user mode debugger?
Interestingly, the return functions disappear if one of the following actions is performed:
- Delete
std::cout instructions - Delete
std::string s - Add
throw() keyword before constructor and destructor
This seems to suggest that the backtick functions have something to do with exception handling
source share