I also use GetThreadCallStack, it works very well. All in all, this is the worst platform with the worst tools when it comes to debugging. All BSs on msdn about doctorwatson must be partners or use the platform constructor. What about regular developers who need to resolve the source of crashes during release releases? In the digital age and computers, these “cool” map file tricks sound pretty slow; This task is ideal for computers. The only way to get the call stack in wince is GetThreadCallStack. The "OS-agnostic code" mentioned by the original poster does not work on wince. It was good enough for the author to work with his / os / cpu combo compiler, but it does not work for wince (in particular, it does not process LDR instructions that restore the PC case). I spent some time for this code to work, in general, I decided to skip it and a lot of waste: this code must be written by the manufacturer of the os or compiler, it is very difficult to make it work perfectly for all possible types of generated code.
For those who refuse to use all this mess with map files, I can recommend a tool that will help you avoid this step. John Robbins CrashFinder.exe can do this part for you. Also, when you get a column from GetThreadCallStack, print the addresses with the highest byte:
unsigned addr = addr1 & 0x00ffffff;
Then, in search of failures, you need to open the exe file of your wince application, and you can request addresses, and it will show you the names of the functions if the addresses are in your application. Usually, if an accident occurs somewhere inside winapi, I need to manually enter each address from callstack until I find the last one that was in my application.
Pavel source share