Win32 API stack walk with MinGW/MSYS?

后端 未结 3 892
猫巷女王i
猫巷女王i 2020-12-09 12:46

i\'ve to develop a stack trace walk to our win32 API plattform support to catch any exception with a behaviour of a JAVA stacktrace. Actually we got a full functional implem

3条回答
  •  春和景丽
    2020-12-09 13:24

    Check Mr. Edd's stack trace library at the following link. It will produce a nice stack frame listing and has specific code to support MinGW.

    http://www.mr-edd.co.uk/code/stack_trace

    His library uses dbghelp.dll, however, so you may get into some problems trying to compile it. As far as I know, MinGW doesn't include an import library for this DLL (see a old feature request here). I had success, however, creating one import library myself. You can do the same just using a .def file from the Wine project (check the previous link's attached files for one) and running the MingW utility dlltool:

    dlltool -k -d dbghelp.def -l dbghelp.a
    

    You can then include the resulting dbghelp.a file in your project. You won't probably like to have dependencies towards dbghelp.dll in your release builds, as the DLL itself is surely not redistributable.

提交回复
热议问题