LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
293 stars 160 forks source link

Help running the debugger #7282

Closed RecursiveVision closed 3 years ago

RecursiveVision commented 3 years ago

So I'm trying to learn how to run the debugger so I can fix the problems in my latest build as well as with coop wars.

I followed the instructions as listed under "How do I debug this":

  1. Built the debug configuration of the project.
  2. Copied the DLL and PDB from BuildOutput and replaced the DLL from the installer.
  3. Started Civ 5 (legacy launcher).
  4. Loaded the mod (also IGE and Quick Turns, not sure if that prevents it from working).
  5. Opened the mod's .sln file in Visual Studio 2019.
  6. Clicked attach to process: Screenshot 1
  7. Chose my settings and hit launch game.

The debugger threw this exception and froze the game. When the debugger was unattached, the game continued normally. Screenshot 2

Any idea what I'm doing wrong?

I'm running Windows 10 Home Edition.

FYI, when I installed Visual Studio my install order was: VS Express 2008 with Service Pack 1 (no optional/online products) [VS2008ExpressWithSP1ENUX1504728.iso] VS Express 2010 (no optional/online products) [VS2010Express1.iso] VS 2008 Isolated Shell (no optional/online products) [VSIsoShell.exe] VS 2008 Hotfix for Precompiler Header Error [VS90SP1-KB976656-x86.exe] VS 2019 Community Edition (Desktop development with C++, default options)

My install order works fine for building the DLL so I doubt it's that but I listed it just in case.

RecursiveVision commented 3 years ago

@LoneGazebo @ilteroi

ilteroi commented 3 years ago

you only want to catch unhandled exceptions.

see the checkmark "break when this exception type is thrown"? remove it. might have to do that several times until all the benign exceptions are filtered.

RecursiveVision commented 3 years ago

Thanks! That explains it. I'd done it before but just got another exception so I thought I screwed up. Will let you know if I encounter further difficulties.

RecursiveVision commented 3 years ago

@ilteroi Okay, so it stopped throwing exceptions, but now I'm not seeing anything at all in the display (besides "process memory").

Screenshot

ilteroi commented 3 years ago

good. now you can set (conditional) breakpoints in interesting places to inspect variables and execute the code step by step.

RecursiveVision commented 3 years ago

I think I get it now; I set a breakpoint and was able to see the callstack. For some reason much of the diplo AI memory is unreadable, though.