1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Debugging the code

Discussion in 'Civ4 - Community Enchancement Project' started by Jorgen_CAB, May 4, 2006.

  1. Jorgen_CAB

    Jorgen_CAB Chieftain

    Joined:
    Feb 11, 2004
    Messages:
    132
    Location:
    Sweden
    Are there anyone here who know a how to debug the code, I have tried and failed every time. Both through the debug mode directly in Visual Studio 2003 and as an external process attached, but I don't seem to register.

    I created the debug dll and started the game and got a message that said something was wrong loading the python part then the game start, I attach Visual Studio to the CivIV process but still I can't seem to get any breakpoint from the dll.
     
  2. SimCutie

    SimCutie Chieftain

    Joined:
    Dec 10, 2005
    Messages:
    197
    Hmmm... strange..
    I am doing my debugging just exactly same way as you said. i.e. Running the Civ4 exe and attaching to the process using the MSVS 2003 VC++ Debug/Process.. menu.. But I have no problem in setting break point or proving variables or single stepping in the source code.
    Did the DLL include proper Debugging inforamtion? It can be set in the Project Property menu. (/Zi) and DLL size will be around 8-9 MB. Or you may be setting break point in wrong place or your code may not be executed at all. It should be properly initialized and called from anywhere from the existing code.
    Faulty python mod or even faulty xml file may hinder debugging. Many Assert failure message box will pop up with faulty XML or python code. Start with clean installation ( No python mod or modded xml) and add one by one until you find same fault.
     
  3. Jorgen_CAB

    Jorgen_CAB Chieftain

    Joined:
    Feb 11, 2004
    Messages:
    132
    Location:
    Sweden
    Ok, my debug file is nearly 12MB large, where do you insert the (Zi) switch... this is not my area really... I have had no problem doing debugging at work before.
     
  4. Jorgen_CAB

    Jorgen_CAB Chieftain

    Joined:
    Feb 11, 2004
    Messages:
    132
    Location:
    Sweden
    Ok, my debug file is nearly 12MB large, where do you insert the (Zi) switch... this is not my area really... I have had no problem doing debugging at work before.

    Thew command line look like this

     
  5. dsplaisted

    dsplaisted Chieftain

    Joined:
    Oct 4, 2005
    Messages:
    52
    You need to change the output file. Right now it has the wrong filename and is probably being placed in the wrong directory. The correct filename will be CvGameCoreDLL.dll I think. You probably want to specify the absolute path to a Mod direcory or maybe the customassets directory.

    Daniel
     
  6. Jorgen_CAB

    Jorgen_CAB Chieftain

    Joined:
    Feb 11, 2004
    Messages:
    132
    Location:
    Sweden
    Thats not a problem, I just grab the file rename it and place it where I want to have it. The game starts and use the file as intended, I just don't seem to be able to do any debugging with it. I also get that annoying error message that tells me the python part is not correctly loaded (the dll that is).
     
  7. dsplaisted

    dsplaisted Chieftain

    Joined:
    Oct 4, 2005
    Messages:
    52
    I'm pretty sure that for debugging to work, copying and renaming the file is not good enough. Try modifying the project properties so that it outputs directly to the DLL Civ4 will load. I don't know anything about the annoying error message you mention though, so that also might be part of the problem.

    Daniel
     

Share This Page