Bay 12 Games Forum

Other Projects => Curses => Topic started by: SlatersQuest on February 28, 2014, 07:58:11 pm

Title: Debugging LCS in Mac/Unix
Post by: SlatersQuest on February 28, 2014, 07:58:11 pm
Hi!

I've been trying to debug certain functions in LCS for my upcoming mod, but I've run into a stumbling block: I don't have a working debugger.

I have ddd, but ddd doesn't seem to take or wait for normal input, which means I never know what's going on in the game while ddd is running with it. Does anybody know of a Mac/Unix debugger that I could use to debug new LCS code?
Title: Re: Debugging LCS in Mac/Unix
Post by: Carlos Gustavos on March 02, 2014, 09:35:37 am
I use gdb in Linux. From what I find it appears available on Mac too.
Title: Re: Debugging LCS in Mac/Unix
Post by: SlatersQuest on March 02, 2014, 02:05:43 pm
Well, huh - I know that ddd uses gdb as its engine. How do you run/what command do you use to make gdb let you see the LCS interface while debugging?
Title: Re: Debugging LCS in Mac/Unix
Post by: Carlos Gustavos on March 03, 2014, 07:26:55 am
To not have gdb's output over LCS's interface you can run gdb in another terminal and attach it to crimesquad's process. The command in gdb is:

attach <crimesquad's pid>

Although I have to sudo gdb to make that work.
Title: Re: Debugging LCS in Mac/Unix
Post by: SlatersQuest on March 05, 2014, 08:36:50 pm
And I assume that "pid" stands for process identification number? That I can find out easily enough!

Thank you very much! :)
Title: Re: Debugging LCS in Mac/Unix
Post by: SlatersQuest on March 06, 2014, 11:35:22 am
Aha, found the solution!

When running ddd, there is a View menu, and one of the options is Execution Window. This will display the LCS console and allow play.

:)