Code Monkey home page Code Monkey logo

drmingw's People

Contributors

aitap avatar alvinhochun avatar bigfarts avatar cybershadow avatar datallah avatar hmartinez82 avatar jannick0 avatar jrfonseca avatar jschueller avatar luzpaz avatar oltolm avatar robyt3 avatar yrnkrn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drmingw's Issues

Dump also module base addresses in ExcHndl

With ASLR enabled in the process, the DLLs are loaded to a random location, so the PC addresses in the stack trace cannot be used directly to assist debugging.

It can be helpful if the base addresses are dumped to the log too.

executable never unblocked

I’d like to be able to leave the »Dr. Mingw« window open while compiling and running the program again.
This is impossible because the linker cannot write the new executable.

Unable to set as Default Debugger

(I hope this is the right location to post an issue I am facing. If not then please redirect me to the correct location. Thanks!)

Hi there,

I downloaded the 0.6.3 version of DrMingw. I ran 'drmingw.exe -a -i' to install it as the default JIT debugger as suggested in the 'Usage Instructions' page.

I then compiled the sample provided. I ran the sample.exe to see the crash.

image

When I selected 'Debug the program' I was asked to choose the debugger, I was shown this dialog

image

Then when I selected 'Debug with default debugger', I was asked to select The Visual Studio JIT debugger.

image

Now, does this mean the DrMingw debugger isn't isntalled? Am I missing something here?

Cheers!
Bharath

Information about multiple threads and exchndl requested

In one of the closed issues here, I noticed a comment that the Exchndl_Init handler doesn't work for all threads.

I have an app with many many threads and was curious if I am still able to achieve what I am after with Exchndl bundled with the program. I need to make sure a crash from any of the threads properly triggers a RPT file but I am not seeing that.

Were you hinting that multiple threads are not supported?
Or just that each thread needs to register the handler when it starts?
Are there any race conditions on setting a custom report file location with multiple threads or should only the main (1st) thread do that before spawning others?

Am I supposed to get an RPT file for unhandled exceptions which just print to the console and then call abort/terminate? Or is this purely for segfaults?

Appreciate any info.

Error installing 0.9.3 64bit on win7

Hi, I've been DrMingW for years, it's one of my favorite & most useful utilities besides the c compiler itself! :)
Starting with 0.9.3 there is an issue when I run drmingw -i, this error shows up:
drmingw093

0.9.2 and all previous versions install perfectly.
I'm using Win7 w/all the latest updates.

best regards,

  • dink

Compile error in Msys2

I'm trying to compile DrMingw in Msys2 and get the following linking errors:

$ mkdir build; cd build; cmake ..; make

C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x712): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x762): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x7fd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x813): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x820): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x8ff): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0x921): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0xa9c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text+0xab0): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_[__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_]+0x25): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::end()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_[__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_]+0x45): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::end()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_[__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendIPKcvEERS4_T_S9_]+0x80): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char const*, char const*)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_[__ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_]+0x247): undefined reference to `__cxa_begin_catch'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_[__ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_]+0x2b0): undefined reference to `__cxa_rethrow'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_[__ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_]+0x2b7): undefined reference to `__cxa_end_catch'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9constructIS6_JRS6_EEEvPT_DpOT0_[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9constructIS6_JRS6_EEEvPT_DpOT0_]+0x4a): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_M_check_lenEjPKc[__ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_M_check_lenEjPKc]+0x4d): undefined reference to `std::__throw_length_error(char const*)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE10deallocateEPS6_j[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE10deallocateEPS6_j]+0x26): undefined reference to `operator delete(void*)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7destroyIS6_EEvPT_[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7destroyIS6_EEvPT_]+0x1f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZSt8_DestroyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEvPT_[__ZSt8_DestroyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEvPT_]+0x1c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEjPKv[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEjPKv]+0x34): undefined reference to `std::__throw_bad_alloc()'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEjPKv[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEjPKv]+0x48): undefined reference to `operator new(unsigned int)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_[__ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_]+0x86): undefined reference to `__cxa_begin_catch'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_[__ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_]+0x9d): undefined reference to `__cxa_rethrow'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_[__ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_]+0xa4): undefined reference to `__cxa_end_catch'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZSt10_ConstructINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJS5_EEvPT_DpOT0_[__ZSt10_ConstructINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJS5_EEvPT_DpOT0_]+0x43): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.text$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9constructIS6_JS6_EEEvPT_DpOT0_[__ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9constructIS6_JS6_EEEvPT_DpOT0_]+0x46): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame+0x113): undefined reference to `__gxx_personality_v0'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame$_ZNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev+0x13): undefined reference to `__gxx_personality_v0'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED1Ev+0x13): undefined reference to `__gxx_personality_v0'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_+0x13): undefined reference to `__gxx_personality_v0'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame$_ZN9__gnu_cxx13new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9constructIS6_JRS6_EEEvPT_DpOT0_+0x13): undefined reference to `__gxx_personality_v0'
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/mgwhelp.dir/dwarf_pe.cpp.obj:dwarf_pe.cpp:(.eh_frame$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyISt13move_iteratorIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES9_EET0_T_SC_SB_+0x13): more undefined references to `__gxx_personality_v0' follow

Faulting location incorrect if executable uses ASLR.

Used MSYS2 mingw32 to compile the sample program.

I noticed the AddrPC of where the crashing code occurred would not match where it's actually located.
Compiling the sample program with -Wl,--disable-dynamicbase passed to the linker shows the correct AddrPC.
Top is the sample program without the flag set and bottom is the sample program with the flag set.
000E50E2
004050E2
In addtion gdb shows no file and line number when setting a breakpoint and addr2line will just output ??:0.

Have it handle stack corruption

It would be nice if it could handle stack corruption so it shows the function responsible for a crash instead of nothing.

ExcHndl doesn't work on Windows 10

Hello!
I use ExcHndl for crash reporting. It works fine on Windows 7. But on Windows 10 it doesn't write crashlogs. After some research I found out that WinApi function SetUnhandledExceptionFilter used in ExcHndl doesn't work on Windows 10 as expected. It sets exception handler, but it never called.
Do you know, how to fix this problem?

Thank you!

Stack overflow

After integrating Dr. MinGW with Very Sleepy, a problem quickly surfaced - mgwhelp.dll is crashing with a stack overflow on this program: VerySleepy/verysleepy#9 (comment)

Here's a partial stack trace:

msvcrt_malloc
allocate_ts_entry
tsearch_inner
_dwarf_tsearch
_dwarf_get_alloc
dwarf_siblingof_b
dwarf_siblingof
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func
search_func

Version 0.7.0 produce empty output

Hello,

I downloaded and tried last version 0.7.0 and it seems do not works. I used exchndl.dll. All what i see in report is:


Error occured on понедельник, апреля 27, 2015 at 12:55:39.

I test with my example program and one i have found in folder 'sample'. Result the same.

Previous versions 0.6.6 and 0.6.4 generate report as expected.

Binary package includes Microsoft binaries

Unless you have some sort of special permission from Microsoft, it's almost certainly not OK to distribute dbghelp.dll and symsrv.dll.

Additionally, using the versions of these not distributed with the system I think is somewhat problematic from a licensing perspective. It's theoretically fine for drmingw itself since it's LGPL, but it means that drmingw/exchndl.dll becomes GPL-incompatible.

Wrong a crash report after compiler optimizations.

Hi.

I use exchndl.dll for catching crashes in my project. When i tried the last version DrMingw 0.7.6, i got strange behavior. Seems like, now compiler optimizations change crash reports. This never happens in older versions.

I can repeat the issue with test program:

#include <Windows.h>
#include <string>
class Test
{
public:
    Test();
    int length() const;
private:
    int size;
};
Test::Test() 
    :size(0)
{}
inline int Test::length() const
{ 
    return size; 
}
int main()
{
    LoadLibraryA("exchndl.dll");
    std::string *a;
    a = NULL;
    *a += "pi is " + std::to_string(3.1415926);
    return(0);
} 

I always strip with

objcopy --only-keep-debug test.exe test.dbg
objcopy --strip-debug test.exe
objcopy --add-gnu-debuglink="test.dbg" test.exe

Build with

g++ -O0 -g -std=c++0x main.cpp -o test.exe
Report is:
-------------------

Error occured on Sunday, September 13, 2015 at 10:04:19.

test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.

Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00010202

AddrPC   Params
6FC8AAA6 0022FED8 00409078 00000000  libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8  test.exe!operator+<char, std::char_traits<char>, std::allocator<char> >  [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
  2473:     operator+(const _CharT* __lhs,
  2474:       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
> 2475:     { return std::move(__rhs.insert(0, __lhs)); }
  2476: 
  2477:   template<typename _CharT, typename _Traits, typename _Alloc>
004016BA 003E3998 00000011 00000001  test.exe!main  [C:\test/main.cpp @ 27]
    25: std::string *a;
    26: a = NULL;
>   27: *a += "pi is " + std::to_string(3.1415926);
    28: return(0);
    29: }
004013DE 00380039 00340034 7FFDE000  test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341  kernel32.dll!BaseProcessStart

test.exe
ntdll.dll       5.1.2600.5755
kernel32.dll    5.1.2600.5781
libgcc_s_dw2-1.dll
msvcrt.dll      7.0.2600.5512
libwinpthread-1.dll 1.0.0.0
libstdc++-6.dll
USER32.dll      5.1.2600.5512
GDI32.dll       5.1.2600.5698
prio.dll        1.9.8.0
exchndl.dll     0.7.6.0
mgwhelp.dll     0.7.6.0
dbghelp.dll     6.3.9600.17029
ADVAPI32.dll    5.1.2600.5755
RPCRT4.dll      5.1.2600.5795
Secur32.dll     5.1.2600.5834
PSAPI.DLL       5.1.2600.5512
SHELL32.DLL     6.0.2900.5686
SHLWAPI.dll     6.0.2900.5512
VERSION.dll     5.1.2600.5512
comctl32.dll    6.0.2900.5512
comctl32.dll    5.82.2900.5512

Windows 5.1.2600
DrMingw 0.7.6

But if i use optimization O1 or O2 get the same broken result:

g++ -O2 -g -std=c++0x main.cpp -o test.exe
-------------------

Error occured on Sunday, September 13, 2015 at 10:00:44.

test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.

Registers:
eax=003e2574 ebx=00000000 ecx=003e4ea4 edx=00020002 esi=0022fecc edi=00000011
eip=6fc8aaa6 esp=0022fe70 ebp=0000000e iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00010202

AddrPC   Params
6FC8AAA6 00409068 00000000 0022FECC  libstdc++-6.dll!ZNSs6appendERKSs
7C801DA8 0022FECC 00000000 0022FEC7  kernel32.dll!LoadLibraryA
004075F7 003E3998 00000011 00000001  test.exe!main  [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 950]
   948:       basic_string&
   949:       operator+=(const basic_string& __str)
>  950:       { return this->append(__str); }
   951: 
   952:       /**
004013DE 00380039 00340034 7FFDE000  test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341  kernel32.dll!BaseProcessStart

test.exe
ntdll.dll       5.1.2600.5755
kernel32.dll    5.1.2600.5781
libgcc_s_dw2-1.dll
msvcrt.dll      7.0.2600.5512
libwinpthread-1.dll 1.0.0.0
libstdc++-6.dll
USER32.dll      5.1.2600.5512
GDI32.dll       5.1.2600.5698
prio.dll        1.9.8.0
exchndl.dll     0.7.6.0
mgwhelp.dll     0.7.6.0
dbghelp.dll     6.3.9600.17029
ADVAPI32.dll    5.1.2600.5755
RPCRT4.dll      5.1.2600.5795
Secur32.dll     5.1.2600.5834
PSAPI.DLL       5.1.2600.5512
SHELL32.DLL     6.0.2900.5686
SHLWAPI.dll     6.0.2900.5512
VERSION.dll     5.1.2600.5512
comctl32.dll    6.0.2900.5512
comctl32.dll    5.82.2900.5512
WS2_32.dll      5.1.2600.5512
WS2HELP.dll     5.1.2600.5512
WININET.dll     6.0.2900.5835
CRYPT32.dll     5.131.2600.5512
MSASN1.dll      5.1.2600.5512
OLEAUT32.dll    5.1.2600.5512
ole32.dll       5.1.2600.5512
wsock32.dll     5.1.2600.5512
RASAPI32.DLL    5.1.2600.5512
rasman.dll      5.1.2600.5512
NETAPI32.dll    5.1.2600.5694
TAPI32.dll      5.1.2600.5512
rtutils.dll     5.1.2600.5512
WINMM.dll       5.1.2600.5512
sensapi.dll     5.1.2600.5512
USERENV.dll     5.1.2600.5512
urlmon.dll      6.0.2900.5835
mswsock.dll     5.1.2600.5625
DNSAPI.dll      5.1.2600.5797
iphlpapi.dll    5.1.2600.5512
rasadhlp.dll    5.1.2600.5512
hnetcfg.dll     5.1.2600.5589
wshtcpip.dll    5.1.2600.5512

Windows 5.1.2600
DrMingw 0.7.6

No line numbers with Clang due to missing DWARF .debug_aranges section

when i compile a program with msys2 based gcc or clang built with -g and run it in gdb, symbols are resolved correctly to file with line numbers

but when i observe a crash with Dr. Mingw i only get line numbers and the source file content with gcc, but not with clang

i think this used to work and i’m not sure what clang would be doing differently now

what can i check to discover differences and why does it work in gdb but not Dr. Mingw?

Search for debug symbols in .debug folder

The .gnu_debuglink feature used by GDB allows for placing the debug symbols alongside the executables but also within a .debug folder at the same place. This is a follow-up to issue #11 since Dr. MinGW lacks support for this alternative.

drmingw-0.6.2-win32 - giving no useful report on memory overrun

I had reported this issue before, but now I have a small sample program which demonstrates the problem. I compiled and ran the following program, which has a data overrun:
//**********************************************************************
// Demo program for bug in drmingw
//
// drmingw version: drmingw-0.6.2-win32
// toolchain version: g++ (4.3.3-tdm-1 mingw32) 4.3.3
// build: g++ -Wall -O -ggdb drmingw_test.cpp -o drmingw_test.exe
//**********************************************************************

include <windows.h>

include <stdio.h>

//***************************************************
static void run_test_func(void)
{
unsigned int usernum = 0x72925 ;
printf("[%s] command faulted\n", usernum) ;
}

//***************************************************
int main(void)
{
run_test_func() ;
return 0;
}
//**********************************************************************
When I ran the program, it crashed (as it should), and this is what drmingw displayed:
drmingw_test.exe caused an Access Violation at location 7c34fedc in module msvcr71.dll Reading from location 00072925.

Registers:
eax=00072925 ebx=7efde073 ecx=7ffffffe edx=0042d838 esi=0028fc94 edi=00403027
eip=7c34fedc esp=0028fc54 ebp=0028fce0 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202

Call stack:
7C34FEDC msvcr71.dll:7C34FEDC setvbuf
//******************************************************************
This is not a very useful report, though... drmingw used to actually report the line in my code where the error occurred, but at some point it stopped doing so. It may have been when I upgraded from g++ v3.4.5 to V4.3.3, though I'm not sure.

Is there some way to improve its reporting for these bugs??

Allow alternative report location

The Program Files directory where applications are usually installed normally requires administration privileges for writing the crash report alongside the executable. Can you please add this simple function for allowing us to set an alternative location? Thanks.

Not buildable with Visual Studio

I've tried to generate a Visual Studio solution using Cmake, so that I could debug how Very Sleepy (which uses Visual Studio) interacts with mgwhelp.dll. However, the CMakeLists files contain a few switches specific to the gcc toolchain, which break the VS build:

------ Build started: Project: common, Configuration: Debug Win32 ------
cl : Command line error D8021: invalid numeric argument '/Wmissing-prototypes'
------ Build started: Project: dwarf, Configuration: Debug Win32 ------
cl : Command line error D8021: invalid numeric argument '/Wno-pointer-to-int-cast'
------ Build started: Project: mgwhelp_implib, Configuration: Debug Win32 ------
  Building Custom Rule C:/Projects/Extern/drmingw/src/CMakeLists.txt
  CMake does not need to re-run because C:\Projects\Extern\drmingw-bin\src\CMakeFiles\generate.stamp is up-to-date.
  Generating libmgwhelp.a
  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30723 for x86
  Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002: ignoring unknown option '--output-lib'
cl : Command line warning D9002: ignoring unknown option '--dllname'
cl : Command line warning D9002: ignoring unknown option '--kill-at'
cl : Command line warning D9002: ignoring unknown option '--input-def=C:/Projects/Extern/drmingw/src/dbghelp.def'
cl : Command line warning D9024: unrecognized source file type 'C:/Projects/Extern/drmingw-bin/src/libmgwhelp.a', object file assumed
cl : Command line warning D9024: unrecognized source file type 'mgwhelp.dll', object file assumed
  Microsoft (R) Incremental Linker Version 12.00.30723.0
  Copyright (C) Microsoft Corporation.  All rights reserved.

  /out:libmgwhelp.exe 
  C:/Projects/Extern/drmingw-bin/src/libmgwhelp.a 
  mgwhelp.dll 
LINK : fatal error LNK1181: cannot open input file 'C:/Projects/Extern/drmingw-bin/src/libmgwhelp.a'
------ Build started: Project: addr2line, Configuration: Debug Win32 ------
LINK : fatal error LNK1104: cannot open file 'libmgwhelp.a'
------ Build started: Project: drmingw, Configuration: Debug Win32 ------
cl : Command line error D8021: invalid numeric argument '/Wmissing-prototypes'
------ Build started: Project: exchndl, Configuration: Debug Win32 ------
cl : Command line error D8021: invalid numeric argument '/Wmissing-prototypes'
------ Build started: Project: mgwhelp, Configuration: Debug Win32 ------
cl : Command line warning D9002: ignoring unknown option '-ggdb'
cl : Command line warning D9002: ignoring unknown option '-O0'
  demangle.cxx
C:\Projects\Extern\drmingw\src\demangle.cxx(2): fatal error C1083: Cannot open include file: 'cxxabi.h': No such file or directory
------ Build started: Project: test, Configuration: Debug Win32 ------
cl : Command line error D8021: invalid numeric argument '/Wmissing-prototypes'
------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
Project not selected to build for this solution configuration 
------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32 ------
Project not selected to build for this solution configuration 
========== Build: 0 succeeded, 8 failed, 3 up-to-date, 2 skipped ==========

I'm not familiar with CMake, but would it be possible to allow building with VS as well?

Print drmingw version in a crash report.

What do you think about idea print in a crash report current drmingw version number? I think it will useful know which version generated report especially when we speak about debugging drmingw itself.

mgwhelp.dll not providing any symbols

Hi,

I've tried to use mgwhelp.dll as a drop-in replacement for Very Sleepy. Currently we use Wine's DbgHelp which is occasionally buggy, not very portable, uses its own DWARF parser, and doesn't understand DWARF-4.

However, I couldn't get any symbols out of it at all. I've tried with 32-bit Cygwin and MSys64 with -gdwarf-2, which Wine's DbgHelp manages.

easier installation

From time to time i let users install Dr. Mingw and it’s a bit weird to tell them that they have to open an Admin command prompt, navigate to the extracted folder and execute some command to get it working.

Logic like this could imo be implemented as part of the usage prompt that comes up if you execute drmingw.exe in the explorer, but i currently simply share the following script which could be included as is without much further work needed:

REM http://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file#10052222
@echo off

:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------
"%CD%/bin/drmingw.exe" -i

DrMinGW pauses for a long time when run for the first time

I have this version of mingw64:

x86_64-4.9.1-release-posix-seh-rt_v3-rev0

I have installed your application as a default debugger and launched my buggy application. But after it failed I only received an empty drmingw window - without any text there.

What could be the problem cause?

Cygwin64 i686-w64-mingw32 runtime issue entry point for stackwalk64 not found

Hi,

when compiling under cygwin with mingw
the compilation is fine

but at runtime entrypoint I get an error :
entry point for stackwalk64 not found,

I included the CMakeCache.txt used

I tried googling but I don't really get what I am doing wrong,

to compile;
"unpack the release in /drmingw-0.6.4"
/drmingw-0.6.4
mkdir drmingw-0.6.4
cmake -i ../drmingw-0.6.4
cmake ../drmingw-0.6.4
make

any help appreciated,
Regards,

Pierre

# This is the CMakeCache file.
# For build in directory: /drmingw-0.6.4Build
# It was generated by CMake: /usr/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//Path to a library.
BINUTILS_BFD_LIBRARY:FILEPATH=/usr/lib/libbfd.a

//Path to a file.
BINUTILS_INCLUDE_DIR:PATH=/usr/include

//Path to a library.
BINUTILS_LIBERTY_LIBRARY:FILEPATH=BINUTILS_LIBERTY_LIBRARY-NOTFOUND

//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar.exe

//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=

//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON

//CXX compiler.
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/i686-w64-mingw32-g++.exe

//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=

//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g

//Flags used by the compiler during release minsize builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the compiler during Release with Debug Info builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//C compiler.
CMAKE_C_COMPILER:FILEPATH=/usr/bin/i686-w64-mingw32-gcc.exe

//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=

//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the compiler during release minsize builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the compiler during Release with Debug Info builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--enable-auto-import

//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF

//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld.exe

//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make.exe

//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=' '

//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm.exe

//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy.exe

//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump.exe

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=drmingw

//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib.exe

//RC compiler.
CMAKE_RC_COMPILER:FILEPATH=/usr/bin/i686-w64-mingw32-windres.exe

//Flags for Fortran compiler.
CMAKE_RC_FLAGS:STRING=' '

//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=' '

//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO

//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO

//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip.exe

//If true, cmake will use relative paths in makefiles and projects.
CMAKE_USE_RELATIVE_PATHS:BOOL=OFF

//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make.  This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE

//Enable to build Cygwin source packages
CPACK_SOURCE_CYGWIN:BOOL=ON

//Dependencies for the target
common_LIB_DEPENDS:STATIC=general;psapi;

//Value Computed by CMake
drmingw_BINARY_DIR:STATIC=/drmingw-0.6.4Build

//Value Computed by CMake
drmingw_SOURCE_DIR:STATIC=/drmingw-0.6.4

//Dependencies for target
dwarf_LIB_DEPENDS:STATIC=

//Dependencies for the target
exchndl_LIB_DEPENDS:STATIC=general;common;general;/drmingw-0.6.4Build/src/libmgwhelp.a;

//Dependencies for the target
mgwhelp_LIB_DEPENDS:STATIC=general;common;general;dwarf;general;dbghelp;


########################
# INTERNAL cache entries
########################

//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_BUILD_TOOL
CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
//What is the target build tool cmake is generating for.
CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make.exe
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/drmingw-0.6.4Build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=11
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest.exe
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake.exe
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Start directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/drmingw-0.6.4
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=5
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_COMPILER
CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
CMAKE_RC_COMPILER_WORKS:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS
CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/share/cmake-2.8.11.2
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS
CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CPACK_SOURCE_CYGWIN
CPACK_SOURCE_CYGWIN-ADVANCED:INTERNAL=1
//Test HAVE_STATIC_LIBGCC_FLAG
HAVE_STATIC_LIBGCC_FLAG:INTERNAL=1
//Test HAVE_STATIC_LIBSTDCXX_FLAG
HAVE_STATIC_LIBSTDCXX_FLAG:INTERNAL=1

SetLogFileNameA not working

I can't make the new SetLogFileNameA function work. I'm trying to call it like this:

if ((module = LoadLibraryA(exchndl_path))) {
    typedef BOOL (APIENTRY* LPFNSETLOGFILE)(const char*);
    LPFNSETLOGFILE MySetLog = (LPFNSETLOGFILE) GetProcAddress(module, "SetLogFileNameA");
    char logfile[MAX_PATH];

    if (MySetLog && (GetTempPathA(sizeof(logfile), logfile) != 0)) {
        strcat(logfile, "pidgin.RPT");
        MySetLog(logfile);
    }
}

Starting with revision 318048b I get:

Program received signal SIGILL, Illegal instruction.
0x68cc1635 in ?? () from C:\ProgramFiles.x86\Pidgin++\libssp-0.dll

DrMinGW V0.8.2 - Doesn't work on Windows 10/64-bit

I'm building my application using MinGW V4.4.1; 32-bit application;
I build with -g debug flag.
I wanted to use DrMinGW to find out what's going wrong, as I've done so often in the past,
but your program doesn't trigger at all when my program crashes, for some reason.
I get the dialog for "this program has terminated improperly blah blah blah",
but I only get the Close button, no Debug button.

I ran 'drmingw.exe -i' as admin on this machine, and it said that it installed successfully.

Any idea what is going on, and maybe what could be done about it?

Feature request: Callback on crash to log extra information.

First off, THANKS. DrMingw and especially the "exchndl" part that you can link to your application is a great help.

I was wondering if it's possible to add the functionality to get a callback when an a fatal exception happens, and then allow the application to log some additional information. I know there is the added risk of that code throwing an exception again, not sure what would happen then.

(I have the case where a crash happens inside some of my UI handling code, and I know the type of UI control that is clicked that is causing the crash, but due to the use of function pointers the exact control is hard to trace down. If I could log the mouse position on exception, which is accessible trough a global variable in my code then I would know where the user had clicked. Which is of great assistance in finding the offending code)

I wouldn't mind building&contributing this feature. But I'm not a 100% sure where to start and if you would like this feature as well.

add copy to Clipboard

please add the copy to Clipboard of the output.
Something like a menu: Edit, Select all and copy

The README file in this repo has some bad links - [404:NotFound]

The README file in this repo has some bad links - [404:NotFound]

Status code [404:NotFound] - Link: https://bitbucket.org/edd/dbg/wiki/Home
Status code [404:NotFound] - Link: http://www.microsoft.com/msj/0197/exception/exception.htm
Status code [404:NotFound] - Link: http://www.microsoft.com/msj/0497/hood/hood0497.htm
Status code [404:NotFound] - Link: http://www.microsoft.com/msj/0597/hood0597.htm
Status code [404:NotFound] - Link: http://www.microsoft.com/msj/0898/bugslayer0898.htm

These old links are re-directing:
Status code [403:Forbidden] - Link: http://msdn.microsoft.com/en-us/library/windows/desktop/ms679294.aspx
Status code [403:Forbidden] - Link: http://msdn.microsoft.com/en-us/library/windows/desktop/bb204634.aspx
Status code [403:Forbidden] - Link: http://msdn.microsoft.com/en-us/library/windows/hardware/ff558829.aspx
Status code [403:Forbidden] - Link: https://msdn.microsoft.com/en-us/library/ms809754.aspx

This was found by an new experimental hobby project that I have just created: https://github.com/MrCull/GitHub-Repo-ReadMe-Dead-Link-Finder
If this has been in any way helpful then please consider giving the above Repo a Star.

Help using mgwhelp for stack tracing.

I'm trying to use mgwhelp to get a call stack after a Qt assert, but I can't figure out how to get the right context (and no, I don't have a lot of experience with this, so any help would be useful).

The code I've seen used elsewhere (with dbghelp) is this:

    PEXCEPTION_POINTERS pPointers = GetExceptionInformation();
    CONTEXT* context = pPointers->ContextRecord;

But GetExceptionInformation() doesn't seem to be available (or isn't linking correctly for me) in mgwhelp.

I am successfully using exchndl for crash reports, but in the case of these Qt asserts, nothing is generated (I'm assuming this is because Qt is handling them and then exiting instead of having an exception thrown).

SetLogFileNameA implementation is broken

This function is currently broken because it uses agnostic functions like _tcslen and _tcsncpy for dealing with a bare char parameter. This will fail when the function is compiled with _UNICODE defined, for example when some Unicode application links directly to exchndl2.cpp.

Also, I think the A/W suffix is an implementation detail to be automatically handled by the Unicode macros, so I would rename the function to SetLogFileName. The application could either require Unicode or ANSI builds of exchndl DLL with the same function name, or this name could be provided as a macro that resolved to appropriate implementations contained in same DLL.

unable to execute sample with mingw 64bit built binaries

i am testing the project with mingw64.
i can compile everything out of the box with mingw64 release and also with mingw32 release.

i try to test the build on mingw32-build.
sample.rpt is created, a assertion message box is shown.

i try to test the build on mingw64-build
sample.rpt is NOT created, a assertion message box is shown.

adding some fprintf(stderr, ),
it seems the registered exception function seems not to be called on mingw64.
any hints welcome :-)

The reading debug symbols from external files doesn't works. Possible regression.

Hi.

I checked with version 0.7.2. And it again doesn't work.

#include <Windows.h>
#include <string>
class Test
{
public:
    Test();
    int length() const;
private:
    int size;
};
Test::Test() 
    :size(0)
{}
inline int Test::length() const
{ 
    return size; 
}
int main()
{
    LoadLibraryA("exchndl.dll");
    std::string *a;
    a = NULL;
    *a += "pi is " + std::to_string(3.1415926);
    return(0);
} 

Build with
g++ -g -std=c++0x main.cpp -o test.exe

Strip with
objcopy --only-keep-debug test.exe test.dbg
objcopy --strip-debug test.exe
objcopy --add-gnu-debuglink="test.dbg" test.exe

Report without strip

Error occured on воскресенье, мая 10, 2015 at 17:45:03.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits, std::allocator > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
2473: operator+(const _CharT* __lhs,
2474: basic_string<_CharT, _Traits, _Alloc>&& __rhs)

2475: { return std::move(__rhs.insert(0, __lhs)); }
2476:
2477: template<typename _CharT, typename _Traits, typename _Alloc>
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
25: std::string *a;
26: a = NULL;
27: *a += "pi is " + std::to_string(3.1415926);
28: return(0);
29: }
004013DE 00380039 00340034 7FFD6000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart

Report with strip

Error occured on воскресенье, мая 10, 2015 at 17:46:02.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits, std::allocator > std::operator+<char, std::char_traits, std::allocator >(char const*, std::basic_string<char, std::char_traits, std::allocator >&&)
004016BA 003E3998 00000011 00000001 test.exe!main
004013DE 00380039 00340034 7FFDB000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart

How always i used all dll's.

Unnecessary module versions in report

The version-info dumping implemented in a36b428 floods the crash report with many unrelated DLLs. It was supposed to not clutter the stack trace, but it clutters the whole report instead. I suggest you to cache the involved modules in dumpStack for printing only these.

Two different crashes

I found 2 bugs in 0.7.6 code that cause crash when generating the report for my executable.

First is in dwarf_pe.c in function pe_get_section_info() line 69:

return_section->name = (const char *)pSection->Name;
if (return_section->name[0] == '/') {
    // Crashes here if atoi() returns value bigger then 1
    return_section->name = &pe_obj->pStringTable[atoi(&return_section->name[1])];

Second one is mgwhelp.c in function pe_find_symbol():

DWORD i;
for (i = 0; i < pNtHeaders->FileHeader.NumberOfSymbols; ++i) {
    // pSymbol has a vary large address and seems to point to garbage
    PIMAGE_SYMBOL pSymbol = &pSymbolTable[i];

I will send the executable by private email message so you can reproduce.

Stack dump failure with some clang-compiled 32-bit binaries

Hello,

I ran into an issue when debugging clang created binaries. Under certain conditions I get empty stack, even though gdb does manage to produce something:

Dr. Mingw report

-------------------

Error occured on Sunday, September 4, 2016 at 17:07:31.

sample.exe caused an Illegal Instruction at location 00401674 in module sample.exe.

Registers:
eax=00004823 ebx=00000438 ecx=00000780 edx=00000000 esi=005ec034 edi=00000029
eip=00401674 esp=0088fe40 ebp=00000000 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202

AddrPC   Params

sample.exe
ntdll.dll       6.2.10586.306
KERNEL32.DLL    6.2.10586.0
KERNELBASE.dll  6.2.10586.494
GDI32.dll       6.2.10586.420
USER32.dll      6.2.10586.306
IMM32.DLL       6.2.10586.0
msvcrt.dll      7.0.10586.0
ole32.dll       6.2.10586.545
combase.dll     6.2.10586.103
RPCRT4.dll      6.2.10586.306
SspiCli.dll     6.2.10586.0
CRYPTBASE.dll   6.2.10586.0
bcryptPrimitives.dll    6.2.10586.420
sechost.dll     6.2.10586.0
OLEAUT32.dll    6.2.10586.0
SHELL32.dll     6.2.10586.545
cfgmgr32.dll    6.2.10586.0
OPENGL32.DLL    6.2.10586.0
windows.storage.dll 6.2.10586.494
advapi32.dll    6.2.10586.63
shlwapi.dll     6.2.10586.0
DDRAW.dll       6.2.10586.0
GLU32.dll       6.2.10586.0
kernel.appcore.dll  6.2.10586.0
shcore.dll      6.2.10586.494
powrprof.dll    6.2.10586.0
DCIMAN32.dll    6.2.10586.3
profapi.dll     6.2.10586.0
VERSION.dll     6.2.10586.0
WINMM.DLL       6.2.10586.0
WINMMBASE.dll   6.2.10586.0
exchndl.dll     0.8.0.0
PSAPI.DLL       6.2.10586.0
mgwhelp.dll     0.8.0.0
dbghelp.dll     6.3.9600.17029
WS2_32.dll      6.2.10586.420
WININET.dll     11.0.10586.545
iertutil.dll    11.0.10586.545
ondemandconnroutehelper.dll 6.2.10586.212
IPHLPAPI.DLL    6.2.10586.0
winhttp.dll     6.2.10586.420
mswsock.dll     6.2.10586.420
NSI.dll         6.2.10586.0
WINNSI.DLL      6.2.10586.0
DNSAPI.dll      6.2.10586.212
dhcpcsvc6.DLL   6.2.10586.420
urlmon.dll      11.0.10586.545
dhcpcsvc.DLL    6.2.10586.420
rasadhlp.dll    6.2.10586.71
clbcatq.dll     2001.12.10941.16384
fwpuclnt.dll    6.2.10586.212
bcrypt.dll      6.2.10586.0

Windows 6.2.9200
DrMingw 0.8.0

gdb output

(gdb) c
Continuing.

Thread 1 received signal SIGILL, Illegal instruction.
0x00401674 in B::myMethod(void*, unsigned int, unsigned int) ()
(gdb) bt
#0  0x00401674 in B::myMethod(void*, unsigned int, unsigned int) ()
#1  0x00401646 in SDL_main ()
#2  0x00501683 in WinMain@16 ()
#3  0x00000001 in ?? ()
#4  0x00000001 in ?? ()
#5  0x00912fc8 in ?? ()
#6  0x5c766564 in ?? ()
#7  0x63736e6f in ?? ()
#8  0x74706972 in ?? ()
#9  0x6c2d7265 in ?? ()
#10 0x5c6d766c in ?? ()
#11 0x706d6173 in ?? ()
#12 0x652e656c in ?? ()
#13 0x20006578 in ?? ()
#14 0xbaadf000 in ?? ()
#15 0xbaadf00d in ?? ()
#16 0xbaadf00d in ?? ()
#17 0xbaadf00d in ?? ()
#18 0xbaadf00d in ?? ()
#19 0xbaadf00d in ?? ()
#20 0xbaadf00d in ?? ()
#21 0xbaadf00d in ?? ()
#22 0xbaadf00d in ?? ()
#23 0xababfeee in ?? ()
#24 0xabababab in ?? ()
#25 0xfeeeabab in ?? ()
#26 0xfeeefeee in ?? ()
#27 0x0000
I suspect the issue to be caused by SDL because I failed to make a sample without it. However, I guess it is not much relevant. I [uploaded](https://github.com/jrfonseca/drmingw/files/453959/sample.zip) a binary, source code, compilation arguments and related stuff. Could anything be done with it?

Regards,
Vit

Does not demangle MinGW 4.8 C++ names

I use DrMinGW 0.7.5 (32) with an app compiled with MinGW 4.8.2. It works good but doesn't demangle C++ (Qt) names, ex:

6E1EBA87 0091C698 6E26612C 0029FD0C QtCore4.dll!ZN21QEventDispatcherWin3213processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE
6E1C457E 0029FD0C 00000014 00000004 QtCore4.dll!ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE
6E1C4859 0029FD44 00000000 0091AA81 QtCore4.dll!ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE
6E1C93A1 0000000C 00918A9C 00000014 QtCore4.dll!ZN16QCoreApplication4execEv

I think the problem is in mgwhelp.c:

DWORD WINAPI
MgwUnDecorateSymbolName(PCSTR DecoratedName, PSTR UnDecoratedName, DWORD UndecoratedLength, DWORD Flags)
{
   assert(DecoratedName != NULL);

    if (DecoratedName[0] == '_' && DecoratedName[1] == 'Z') {

I think the condition should be changed to:

if ((DecoratedName[0] == '_' && DecoratedName[1] == 'Z') || (DecoratedName[0] == 'Z' && DecoratedName[1] == 'N')) {

catchsegv: error: message dialog detected

Dear jrfonseca,

I'm writing to submit a possible (may be it's just my lack of understanding) issue I got using DrMinGw. I was debugging and obscure bug that is crashing my application. I'm using the wxWidgets framework 3.1.4 , GCC 10.2 compiler suite from Msys2. The issue seems be present in both Win7 Pro SP1 and Win10 pro 20H2 (OS Build 19042.685). I'm using the binary release 0.9.2 of DrMinGw. During the investigation I was always compiling with the -g3 option, but the wxWidgets was compiled as a RELEASE version without debugging information

At the beginning I was adding the call ExcHndlInit() and linking the the related dll, but after the crash no RPT file was present. Then I used the catchsegv program and I got a report from it. The triggering event is a Modal showing of a Dialog (wxDialog).

After an investigation of the code I was unable to discover any issue. But then I understood that catchsegv is reporting an issue at the ShowModal() call of ANY Dialog. Even the Dialog provided by the wxWidgets framework.

Because it will be too complicated to discuss my code I created a minimal example. I just copied the HelloWorld example from the wiki pages of the WxWidgets site. The code is contained in two files HelloWorldApp.h and HelloWorldApp.cpp. The call wxMessageBox("Foo","Foo"); was added to the example just to have a Modal Dialog.

/**** HelloWorldApp.h ****/

#ifndef INCLUDED_HELLOWORLDAPP_H
#define INCLUDED_HELLOWORLDAPP_H

// The HelloWorldApp class. This class shows a window
// containing a statusbar with the text "Hello World"
class HelloWorldApp : public wxApp
{
public:
	virtual bool OnInit();
};

DECLARE_APP(HelloWorldApp) 

/**** HelloWorldApp.h ****/

#include "wx/wx.h"

#include "HelloWorldApp.h"

IMPLEMENT_APP(HelloWorldApp)

// This is executed upon startup, like 'main()' in non-wxWidgets programs.
bool HelloWorldApp::OnInit()
{
	wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));
	frame->CreateStatusBar();
	frame->SetStatusText(_T("Hello World"));
	frame->Show(true);
	SetTopWindow(frame);

	wxMessageBox("Foo","Foo");
	return true;
}

#endif // INCLUDED_HELLOWORLDAPP_H

The compilation

-------------- Build: Debug in Test (compiler: GNU MINGW64)---------------

g++.exe -std=c++11 -fexceptions -mthreads -m64 -pipe -isystem C:\Development\wxMSW-3.1.4\include -isystem C:\Development\wxMSW-3.1.4\lib\gcc_lib\mswu -D__MINGW64__ -D__WIN64__ -D__WXMSW__ -DwxUSE_UNICODE -Wnon-virtual-dtor -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wfloat-equal -Winline -Wunreachable-code -Wmissing-declarations -Wswitch-enum -Wswitch-default -Wzero-as-null-pointer-constant -Wextra -Wall -Wconversion -Wpointer-arith -Wwrite-strings -Wlogical-op -Wdisabled-optimization -Woverlength-strings -O0 -g3 -IC:\Development\wxMSW-3.1.4\include -IC:\Development\wxMSW-3.1.4\lib\gcc_lib\mswu -IC:\Development\include -IC:\Development\include -IC:\Development\Projects\Test -IC:\Development\Projects\Test -c C:\Development\Projects\Test\HelloWorldApp.cpp -o obj\Debug\HelloWorldApp.o
g++.exe -LC:\Development\wxMSW-3.1.4\lib\gcc_lib -LC:\Development\lib -LC:\Development\lib -o bin\Test.exe obj\Debug\HelloWorldApp.o -m64 -Wl,--enable-auto-import -mthreads -lwxExtraObjectsDbg -lExtraObjectsDbg -lexchndl -lgsl -lgslcblas -ldislin -lSqlite -lws2_32 -lwxmsw31u -lwxexpat -lwxpng -lwxzlib -lwxregexu -lwxjpeg -lwinspool -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lopengl32 -lshlwapi -luxtheme -loleacc -lversion -mwindows
Output file is bin\Test.exe with size 10.51 MB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))

seems OK.

Running the program with

catchsegv.exe -v -z Test.exe

the program crashed with the following messages

c:\Development\Projects\Test\bin>c:\Development\Tool\DrMingw\catchsegv.exe -v -z
 Test.exe
CREATE_PROCESS PID=10460 TID=8304 lpBaseOfImage=0000000000400000 Test.exe
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=0000000077600000 ntdll.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=00000000773E0000 kernel32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFD2B0000 KernelBase.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFDF70000 advapi32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFDE30000 msvcrt.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFF370000 sechost.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFEF50000 rpcrt4.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEF9280000 comctl32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFEE80000 gdi32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=0000000077500000 user32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFF360000 lpk.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFF210000 usp10.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFDED0000 comdlg32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFDAE0000 shlwapi.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFE050000 shell32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFD600000 ole32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEF9D70000 oleacc.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFD9E0000 oleaut32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFB460000 uxtheme.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFC130000 version.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEF9200000 winspool.drv
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEEDEB0000 libgcc_s_seh-1.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEED180000 libwinpthread-1.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEDAC50000 libstdc++-6.dll
EXCEPTION PID=10460 TID=8304 ExceptionCode=0x80000003 dwFirstChance=1
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFF390000 imm32.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFD4E0000 msctf.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFCFC0000 cryptbase.dll
LOAD_DLL PID=10460 TID=8304 lpBaseOfDll=000007FEFB090000 dwmapi.dll
catchsegv: error: message dialog detected (Foo)
AddrPC           Params
0000000077518FDA 0000000000100DAC 000000000123F0C0 0000000000000001  USER32.dll!
ZwUserWaitMessage
0000000077524864 0000000000100DAC 0000000077573904 0000000000000001  USER32.dll!
DialogBox2
0000000077524B85 0000000000DE19F0 FFFFFFFFFFFFFFFF 0000000000000001  USER32.dll!
InternalDialogBox
0000000077572E30 00000000000000A1 0000000000000035 0000000000DE19F0  USER32.dll!
SoftModalMessageBox
0000000077572125 000000007766F020 0000000000100DAC 0000000000000040  USER32.dll!
MessageBoxWorker
000000007757197B 000000000022F710 0000000000000040 000000000022F250  USER32.dll!
MessageBoxTimeoutW
0000000077571872 00000000002F0200 0000000000000000 000000000022F0F0  USER32.dll!
MessageBoxW
000000000051941C 000000000022F3B0 0000000000000000 0000000000000000  Test.exe!wx
MessageDialog::ShowMessageBox
000000000051BC44 0000000000000000 00000000004F432F 0000000000000000  Test.exe!wx
MessageDialog::ShowModal
00000000004B4629 000000000022FD80 00000000007FA134 00000000FFFFFFFF  Test.exe!wx
MessageBox
00000000004017CE 00000000002FFBE0 00000000004B876B 000000000034A400  Test.exe!On
Init  [C:/Development/Projects/Test/HelloWorldApp.cpp @ 16]
    14: SetTopWindow(frame);
    15:
>   16: wxMessageBox("Foo","Foo");
    17: return true;
    18: }
0000000000627C5C 0000000000000001 0000000000000009 000000000034A400  Test.exe!wx
EntryReal
0000000000401574 0000000000400000 0000000000000000 0000000000D83F08  Test.exe!Wi
nMain  [C:/Development/Projects/Test/HelloWorldApp.cpp @ 5]
     3: #include "HelloWorldApp.h"
     4:
>    5: IMPLEMENT_APP(HelloWorldApp)
     6:
     7: // This is executed upon startup, like 'main()' in non-wxWidgets program
s.
00000000004013C1 0000000000000000 0000000000000000 0000000000000000  Test.exe!__
tmainCRTStartup  [C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtex
e.c @ 333]
00000000004014D6 0000000000000000 0000000000000000 0000000000000000  Test.exe!Wi
nMainCRTStartup  [C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtex
e.c @ 186]
00000000773F556D 0000000000000000 0000000000000000 0000000000000000  kernel32.dl
l!BaseThreadInitThunk
000000007765372D 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!R
tlUserThreadStart

info: minidump written to 10460.dmp

Moreover running and then closing the program using gdb is not signalling any issue. Moreover using this very simple program without gdb or catchsegv no issue is present


c:\Development\Projects\Test\bin>gdb Test.exe
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from Test.exe...
(gdb) run
Starting program: c:\Development\Projects\Test\bin\Test.exe
[Inferior 1 (process 2604) exited normally]
(gdb)

So I'm wondering if the message

catchsegv: error: message dialog detected (Foo)

received at the usage of dialog boxes is signalling a real issue or not. If you need the related minidump can be found in my google drive

https://drive.google.com/file/d/1jiRK3yDXiCbUshwZKjXUvSh8qJjrDhBf/view?usp=sharing

In any case I'd like to thank for, in advance, for any attention and for the DrMinGW tools.

Regards

Max

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.