How to debug

Share and discuss strategies for playing the game, and get help and tips from other players.

Moderators: Forum Moderators, Developers

Post Reply
Posts: 1200
Joined: November 17th, 2003, 4:26 am
Location: Right behind Gwiti, coding

How to debug

Post by Circon » December 16th, 2003, 6:36 pm

methinks wrote:

There is certainly "WIN" button missing, we should add it to next version. No, seriously!

Run the game from the command line with the --debug option. Then right click on a tile next to enemy leader. Select option "Create Unit (debug)". Select Great Mage. Use Great Mage to fry enemy leader. Done.
What is this command line? I've tried editing the properties of the shortcut, but it demands a proper path.
Can somebody tell me how to debug? Of course, I could temp-edit my scenarios with a line to create a great mage next to the enemy...[/quote]

Posts: 96
Joined: October 5th, 2003, 10:04 pm
Location: Barcelona

Post by yawningdog » December 16th, 2003, 6:50 pm

"What is this command line"

Look at what windows has done, hehe. People no longer now what a command line is. :S Well, don't worry, you are not alone there, there are millions who don't even know it.

I think on windows if you want to pass options to an executable you must enclose the full path and switches within quotes (on your shortcut):

Example: "C:\Program Files\Wesnoth\wesnoth.exe --debug"

Though it's been long since I last used windows on a regular basis, hehe.


Post by Pushnell » December 16th, 2003, 11:34 pm

Actually, it's usually:

"C:\Path\To\The program\program.exe" --option

At least, that's what I've always used & it's worked fine.

Posts: 277
Joined: November 17th, 2003, 4:25 pm
Location: Malmö, Sweden

Post by KK_r » December 17th, 2003, 9:35 am

I'm sure C:\Path\To\The program\program.exe --option works at least sometimes, but hey we're talking about windows we should be glad everytime the computer boots without a BSOD

Posts: 123
Joined: October 6th, 2003, 9:21 pm

Post by Dobob » December 17th, 2003, 2:03 pm

Or, if some command line action doesn't affray you, just do Start->Run. Then do "cmd" (without the quote). Then you just have to cd yourself to the good directory and do the command you want to.

Bob Morane

Post by Bob Morane » January 19th, 2004, 8:29 am

OK, so can someone help me to start in debug mode on a mac.
I'm using the binary distribution (i don't find all the required dev lib on SDL page, so i couldn't even compile it myself), this means the binary is embedded along with the libraries in a .app "application/folder" (not sure how i must call this thing :shock: )
I have this :

Battle For Wesnoth (Embedded).app
---------Battle For Wesnoth (the binary)
---------(The libraries)
------(All the data folders)

I tried to start in debug mode (i wanted to test some to-hit statistics concerning mages attacking ogres on mountains), but nothing worked.

I tried (from my terminal)
  • cd to the wesnoth directory
    open -a "Battle For Wesnoth (Embedded).app" --debug

    -> No such file: /Jeux/Wesnoth/--debug
  • cd to wesnoth directory
    open -a "Battle For Wesnoth (Embedded).app --debug"

    -> Couldn't launch application: Battle For Wesnoth (embedded) --debug
  • cd to the macos directory (inside the .app)
    ./"Battle For Wesnoth" --debug (trying to launch directly the binary)

    -> ## Component Manager: attempting to find symbols in a component alias of type (regR/carP/x!bt)
    Initialized true type fonts
    BEGIN: preprocessing file...
Does somebody know how i could do this. Or is thre no way i can start a .app with command line options (it would be quite silly but who knows what sillyness apple may have introduced to have a "user friendly" OS :?

Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)

Post by Sithrandel » January 19th, 2004, 10:00 am

Re command lines in general...

The original 1984 Mac OS never had a command line, nor did any Mac OS up until Mac OS X. Command lines in principle only really have a benefit in certain circumstances. Often they are used to cover imperfections in other aspects of a gui-based system. There are of course some critical uses (e.g. batch processing with regular expressions).

Debugging can come under both. Many of the switch options (e.g. end of turn confirmation, speeding up movement, etc) should really be useable via the gui. In Wesnoth, as a work in progress and non-profitmaking to boot, coding the gui for all such possible changes would be a true waste of resource. Of course, adding the gui options for proven switches is important from the end user perspective.

Re SDL development libs:

All the development libraries are available from just search for the relevant library... e.g. sdl_image, etc. Or start from and just change the end directory :-)

Re Apple and command lines:

To their credit Apple have removed none of the power of the command line from under OS X. To start there were features missing from the gui, but that is mostly gone (still need it for renice though ;-) )

Your problem is that you need to re-specify the data path as the app must be run from the Mac OS folder so invalidating the hard-coded data path. Do a cd to the Mac OS directory, then type:

Code: Select all

./Battle\ For\ Wesnoth\ \(Embedded\) --debug ../
That should run fine (or at least it does on my machine...).

Good luck :D

Posts: 1200
Joined: November 17th, 2003, 4:26 am
Location: Right behind Gwiti, coding


Post by Circon » January 19th, 2004, 1:52 pm

Make a sticky on how to debug for all machine types.

Post Reply