Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Debugging LCS in Mac/Unix  (Read 1347 times)

SlatersQuest

  • Bay Watcher
    • View Profile
Debugging LCS in Mac/Unix
« 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?
Logged

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: Debugging LCS in Mac/Unix
« Reply #1 on: March 02, 2014, 09:35:37 am »

I use gdb in Linux. From what I find it appears available on Mac too.
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Debugging LCS in Mac/Unix
« Reply #2 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?
Logged

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: Debugging LCS in Mac/Unix
« Reply #3 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.
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Debugging LCS in Mac/Unix
« Reply #4 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! :)
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Debugging LCS in Mac/Unix
« Reply #5 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.

:)
Logged