Category Archives: Advanced Debugging

Windows thread pool keeps threads even after being closed

Windows Thread pool maintains threads so that it doesn’t have to create a new one when a work item is submitted. It may surprise you that it maintains threads even after you close the thread pool with CloseThreadpool() API function. … Continue reading

Posted in Advanced Debugging, C++ | Tagged , | 1 Comment

Debug Windows Service through Remote Desktop

Debugging Windows NT Service is headache. Doing so through remote desktop is even more difficult. But the remote debugging makes the story easier. Let’s review the background. Debugging a service is challenging because the service process starts before you log-in … Continue reading

Posted in Advanced Debugging, Tips | Leave a comment

Automatic debugging and API monitoring

The debugger allows you to set a break point with commands which is executed on the break point. For example, the following debugging commands shows the stack trace whenever CreateFileW API is called and write them into the log file. … Continue reading

Posted in Advanced Debugging | Leave a comment

Debugging std::string argument

When a function takes a parameter of “std::string const&”, it would be a little trickier to debug than the simple “char const*” case. #include <string> extern void print(const std::string& text); int main(int argc, char** argv){ print("Hello World. This is a … Continue reading

Posted in Advanced Debugging | Leave a comment

Member functions in 64bits code

Let’s take a look how 64bits compiler compiles C++ code. Here is the sample code: // main function #include "foo.hpp" int main(){ Foo foo(123); foo.Func(); return 0; } // Header File. class Foo { public: Foo(int value); void Func(); private: … Continue reading

Posted in Advanced Debugging | Leave a comment

The first look at 64bits code

I got a new machine with Windows7 64bits version last week so it’s time to try out the 64bits code debugging. #include <stdio.h> int main(){ printf("Hello Worldn"); return 0; } The compiled main function is here. 0:000> uf main test!main: … Continue reading

Posted in Advanced Debugging | Leave a comment

Debugging a problem which happens on logging off

Recently, I got an error report of access violation which happens only when the current user is logging off from the session. It was difficult to attach a debugger because the debugger was shutdown along with the target process on … Continue reading

Posted in Advanced Debugging | Leave a comment