I have the following c++ code compiled into 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 type the following command in the debugger immediate window
x program!*foo*
This gives me the following output
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 the first output is foo
's destructor and the third one is foo
's constructor. What are the second and fourth ones (the ones with the backticks) ?. More generally, what are the other places where I might see backticks in the user mode debugger?
Interestingly, the backtick functions go away if any of the following are done
std::cout
statementsstd::string s
throw()
keyword in front of the constructor and destructorThis seems to suggest the backtick functions have something to do with exception handling
These are internal names generated by the Microsoft compiler for "glue" functions that help things fit together, but don't correspond directly to a line of source code. It is normal.
There are other situations where you'll see similar internal names with backticks, such as using lambda functions, or calling a function that's declared inside a struct that's inside another function.
Other compilers have different ways of representing similar nameless blocks of code; the standard doesn't dictate any particular behavior here, and it's only observable via the debugger anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With