0

I'm attempting to debug an open-source C++ game on Windows 7 x64, but the debugger windows in Code::Blocks are empty when I debug the program. There's a "CataclysmWin.cbp" file that's included in the repository, but it is configured to use the Linux makefile, so I had to change some settings to get it to work in Windows. This is the .cbp file I'm using.

Here's my build log:

    -------------- Build: Release in Cataclysm (compiler: GNU GCC Compiler)---------------
mingw32-make.exe -f Makefile.Windows
mkdir objwin
g++ -g -O3 -c mapbuffer.cpp -o objwin/mapbuffer.o
g++ -g -O3 -c defense.cpp -o objwin/defense.o
g++ -g -O3 -c skill.cpp -o objwin/skill.o
g++ -g -O3 -c item.cpp -o objwin/item.o
g++ -g -O3 -c mtypedef.cpp -o objwin/mtypedef.o
g++ -g -O3 -c posix_time.cpp -o objwin/posix_time.o
g++ -g -O3 -c texthash.cpp -o objwin/texthash.o
g++ -g -O3 -c tutorial.cpp -o objwin/tutorial.o
g++ -g -O3 -c bionics.cpp -o objwin/bionics.o
g++ -g -O3 -c monmove.cpp -o objwin/monmove.o
g++ -g -O3 -c help.cpp -o objwin/help.o
g++ -g -O3 -c calendar.cpp -o objwin/calendar.o
g++ -g -O3 -c settlement.cpp -o objwin/settlement.o
g++ -g -O3 -c name.cpp -o objwin/name.o
g++ -g -O3 -c mission_place.cpp -o objwin/mission_place.o
g++ -g -O3 -c missiondef.cpp -o objwin/missiondef.o
g++ -g -O3 -c setvector.cpp -o objwin/setvector.o
g++ -g -O3 -c basecamp.cpp -o objwin/basecamp.o
g++ -g -O3 -c player.cpp -o objwin/player.o
g++ -g -O3 -c overmap.cpp -o objwin/overmap.o
g++ -g -O3 -c mission_start.cpp -o objwin/mission_start.o
g++ -g -O3 -c mutation_data.cpp -o objwin/mutation_data.o
g++ -g -O3 -c keypress.cpp -o objwin/keypress.o
g++ -g -O3 -c mission_end.cpp -o objwin/mission_end.o
g++ -g -O3 -c mapitemsdef.cpp -o objwin/mapitemsdef.o
g++ -g -O3 -c construction.cpp -o objwin/construction.o
g++ -g -O3 -c npcmove.cpp -o objwin/npcmove.o
g++ -g -O3 -c mongroupdef.cpp -o objwin/mongroupdef.o
g++ -g -O3 -c event.cpp -o objwin/event.o
g++ -g -O3 -c monster.cpp -o objwin/monster.o
g++ -g -O3 -c newcharacter.cpp -o objwin/newcharacter.o
g++ -g -O3 -c veh_interact.cpp -o objwin/veh_interact.o
g++ -g -O3 -c color.cpp -o objwin/color.o
g++ -g -O3 -c input.cpp -o objwin/input.o
g++ -g -O3 -c mission_fail.cpp -o objwin/mission_fail.o
g++ -g -O3 -c line.cpp -o objwin/line.o
g++ -g -O3 -c melee.cpp -o objwin/melee.o
g++ -g -O3 -c iexamine.cpp -o objwin/iexamine.o
g++ -g -O3 -c debug.cpp -o objwin/debug.o
g++ -g -O3 -c main_menu.cpp -o objwin/main_menu.o
g++ -g -O3 -c disease.cpp -o objwin/disease.o
g++ -g -O3 -c inventory.cpp -o objwin/inventory.o
g++ -g -O3 -c gamemode.cpp -o objwin/gamemode.o
g++ -g -O3 -c options.cpp -o objwin/options.o
g++ -g -O3 -c mission.cpp -o objwin/mission.o
g++ -g -O3 -c trapdef.cpp -o objwin/trapdef.o
g++ -g -O3 -c artifact.cpp -o objwin/artifact.o
g++ -g -O3 -c main.cpp -o objwin/main.o
g++ -g -O3 -c catacurse.cpp -o objwin/catacurse.o
catacurse.cpp: In function 'WINDOW* initscr()':
catacurse.cpp:270:27: warning: passing NULL to non-pointer argument 4 of 'int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT)' [-Wconversion-null]
catacurse.cpp:281:31: warning: passing NULL to non-pointer argument 4 of 'int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT)' [-Wconversion-null]
catacurse.cpp:317:27: warning: passing NULL to non-pointer argument 4 of 'int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT)' [-Wconversion-null]
g++ -g -O3 -c bodypart.cpp -o objwin/bodypart.o
g++ -g -O3 -c npc.cpp -o objwin/npc.o
g++ -g -O3 -c game.cpp -o objwin/game.o
g++ -g -O3 -c rng.cpp -o objwin/rng.o
g++ -g -O3 -c output.cpp -o objwin/output.o
g++ -g -O3 -c tileray.cpp -o objwin/tileray.o
g++ -g -O3 -c mapdata.cpp -o objwin/mapdata.o
g++ -g -O3 -c faction.cpp -o objwin/faction.o
g++ -g -O3 -c npctalk.cpp -o objwin/npctalk.o
g++ -g -O3 -c crafting.cpp -o objwin/crafting.o
g++ -g -O3 -c ranged.cpp -o objwin/ranged.o
g++ -g -O3 -c monitemsdef.cpp -o objwin/monitemsdef.o
g++ -g -O3 -c itypedef.cpp -o objwin/itypedef.o
g++ -g -O3 -c mapgen.cpp -o objwin/mapgen.o
g++ -g -O3 -c monattack.cpp -o objwin/monattack.o
g++ -g -O3 -c veh_typedef.cpp -o objwin/veh_typedef.o
g++ -g -O3 -c iuse.cpp -o objwin/iuse.o
g++ -g -O3 -c map.cpp -o objwin/map.o
g++ -g -O3 -c mutation.cpp -o objwin/mutation.o
g++ -g -O3 -c computer.cpp -o objwin/computer.o
g++ -g -O3 -c trapfunc.cpp -o objwin/trapfunc.o
g++ -g -O3 -c action.cpp -o objwin/action.o
g++ -g -O3 -c inventory_ui.cpp -o objwin/inventory_ui.o
g++ -g -O3 -c mondeath.cpp -o objwin/mondeath.o
g++ -g -O3 -c lightmap.cpp -o objwin/lightmap.o
g++ -g -O3 -c field.cpp -o objwin/field.o
g++ -g -O3 -c weather.cpp -o objwin/weather.o
g++ -g -O3 -c graffiti.cpp -o objwin/graffiti.o
g++ -g -O3 -c wish.cpp -o objwin/wish.o
g++ -g -O3 -c vehicle.cpp -o objwin/vehicle.o
g++ -Wl,-stack,12000000,-subsystem,windows -o cataclysm.exe -g -O3 objwin/mapbuffer.o objwin/defense.o objwin/skill.o objwin/item.o objwin/mtypedef.o objwin/posix_time.o objwin/texthash.o objwin/tutorial.o objwin/bionics.o objwin/monmove.o objwin/help.o objwin/calendar.o objwin/settlement.o objwin/name.o objwin/mission_place.o objwin/missiondef.o objwin/setvector.o objwin/basecamp.o objwin/player.o objwin/overmap.o objwin/mission_start.o objwin/mutation_data.o objwin/keypress.o objwin/mission_end.o objwin/mapitemsdef.o objwin/construction.o objwin/npcmove.o objwin/mongroupdef.o objwin/event.o objwin/monster.o objwin/newcharacter.o objwin/veh_interact.o objwin/color.o objwin/input.o objwin/mission_fail.o objwin/line.o objwin/melee.o objwin/iexamine.o objwin/debug.o objwin/main_menu.o objwin/disease.o objwin/inventory.o objwin/gamemode.o objwin/options.o objwin/mission.o objwin/trapdef.o objwin/artifact.o objwin/main.o objwin/catacurse.o objwin/bodypart.o objwin/npc.o objwin/game.o objwin/rng.o objwin/output.o objwin/tileray.o objwin/mapdata.o objwin/faction.o objwin/npctalk.o objwin/crafting.o objwin/ranged.o objwin/monitemsdef.o objwin/itypedef.o objwin/mapgen.o objwin/monattack.o objwin/veh_typedef.o objwin/iuse.o objwin/map.o objwin/mutation.o objwin/computer.o objwin/trapfunc.o objwin/action.o objwin/inventory_ui.o objwin/mondeath.o objwin/lightmap.o objwin/field.o objwin/weather.o objwin/graffiti.o objwin/wish.o objwin/vehicle.o -static -lgdi32
Process terminated with status 0 (4 minutes, 33 seconds)
0 errors, 3 warnings (4 minutes, 33 seconds)

Here's the debugger tab output:

Building to ensure sources are up-to-date
Selecting target:
Release
Adding source dir: C:\Users\Matt\Documents\GitHub\Cataclysm-DDA\
Adding source dir: C:\Users\Matt\Documents\GitHub\Cataclysm-DDA\
Adding file: C:\Users\Matt\Documents\GitHub\Cataclysm-DDA\Cataclysm.exe
Changing directory to: C:/Users/Matt/Documents/GitHub/Cataclysm-DDA/.
Set variable: PATH= *a million entries*
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/Matt/Documents/GitHub/Cataclysm-DDA/Cataclysm.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.4
Child process PID: 1264
[Inferior 1 (process 1264) exited normally]
No stack.
No stack.
No stack.
Failure finding "Stack level "
Failure matching reg_output
Debugger finished with status 0

Why isn't debugging working for this project?

4

1 回答 1

0

Joachim was right - I forgot that the debugging windows don't get populated with info until a break in the code (it has been awhile since I last did this). I put in a breakpoint, the code stopped executing, and the call stack was displayed.

于 2013-03-27T16:32:48.837 回答