jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
273 stars 53 forks source link

exchndl problem #89

Closed yuansunliang1988 closed 2 weeks ago

yuansunliang1988 commented 2 weeks ago

exchndl How to print local variable information when grabbing a crash? AddrPC Params 00007FFEA1174F99 000002215C48EDD8 00007FF64A7E03C1 00203A5D37313A37 KERNELBASE.dll!RaiseException+0x69 00007FF64A7E0011 000002215E778550 000002215DE357A0 000002215DE35864 Nara.exe!_Unwind_RaiseException+0x31 00007FF64A7E0110 000002215DE357D0 000002215C48EDD8 000002215DE357F8 Nara.exe!_Unwind_Resume_or_Rethrow+0x10 00007FF64A9F94CB 0000022100000000 000002215C480000 000002215DEC64B0 Nara.exe!__cxa_rethrow+0x3b 00007FF64A84AA61 0000000000000000 00000063A6BFFB68 0000000000000000 Nara.exe!boost::log::v2s_mt_nt6::sinks::basic_formatting_sink_frontend::feed_record<boost::recursive_mutex, boost::log::v2s_mt_nt6::sinks::basic_text_ostream_backend >+0x851 00007FF64A895F6D 000002215C48D5E0 0000000000000000 0000000000000000 Nara.exe!boost::detail::thread_data<boost::log::v2s_mt_nt6::sinks::asynchronous_sink<boost::log::v2s_mt_nt6::sinks::basic_text_ostream_backend, boost::log::v2s_mt_nt6::sinks::unbounded_fifo_queue>::run_func>::run+0x28d 00007FF64A7DA9B4 000002215C48D5E0 0000000000000000 000002215C48D5E0 Nara.exe!boost::(anonymous namespace)::thread_start_function+0x144 00007FFEA167AF5A 00007FFEA16D06D0 000002215C48D5E0 0000000000000000 msvcrt.dll!_beginthreadex+0x12a 00007FFEA167B02C 0000000000000000 0000000000000000 0000000000000000 msvcrt.dll!_endthreadex+0xac 00007FFEA2BE7034 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk+0x14 00007FFEA3622651 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart+0x21 I want to know which string was written with the exception.

jrfonseca commented 2 weeks ago

How to print local variable information when grabbing a crash?

I'm afraid that's not possible.

You could try to save a minidump to disk and then open it with windbg, but that doesn't work for MinGW executables.

yuansunliang1988 commented 2 weeks ago

Windbg can't resolve symbols other than pdb, so even with a dump file, it won't be able to do the same thing as a native vs compiled program.

jrfonseca commented 2 weeks ago

Right.

There are a few possible approaches here:

  1. Add to DrMingw the ability to generate gdb core dumps, as referenced in https://github.com/jrfonseca/drmingw/blob/master/TODO.md . (However note I have no time/interest to pursue this myself. I'd happily accept PRs though.)
  2. Build the application with MinGW Clang (instead of MinGW GCC) as it supports PDB -- see https://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html
  3. Or use https://github.com/rainers/cv2pdb