jrfonseca / drmingw

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

Not buildable with Visual Studio #5

Closed CyberShadow closed 9 years ago

CyberShadow commented 9 years ago

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?

jrfonseca commented 9 years ago

Sorry but I have no intention to support MSVC to build DrMingw or MgwHelp.dll:

If somebody is committed to do it, I think I can accept the patches, but I don't recommend it. I just I don't see the need.

CyberShadow commented 9 years ago

Fair enough. However,

You can easily use the MinGW-buillt DLL with MSVC projects.

I would need a PDB file if I wanted to debug DrMingw with Visual Studio, or its DbgHelp in a VS project.

jrfonseca commented 9 years ago

I would need a PDB file if I wanted to debug DrMingw with Visual Studio, or its DbgHelp in a VS project.

Right. But if you want to debug MgwHelp internals , then you could do it with gdb. That's what I use.

Live debugging DrMingw is practically impossible, gdb or Visual Studio, because it registers itself as a JIT debugger. I rely on extenstive logging to figure out DrMingw issues.