Page 1 of 1

Debugging

Posted: Fri Nov 07, 2014 5:16 pm
by Hedgehog
How to debug Source.Python plugin?

Posted: Fri Nov 07, 2014 5:58 pm
by Ayuto
You can add debug messages in your plugin. For example with "print", "SayText2" or the loggers module.

That's a common strategy to debug programs.

Posted: Fri Nov 07, 2014 6:09 pm
by Hedgehog
I'm tired from this... For what is debug build for? I thought it was created to something with breakpoints and steps.

Posted: Fri Nov 07, 2014 6:35 pm
by Ayuto
The debugging build only uses different compiler settings. E.g. code optimization is disabled and the binaries contain more symbols. Also, our thirdparty libraries might do some more error checking. However, our binaries don't do more error checking. So, the debugging build is only useful if you want to debug Source.Python's core and not if you want to debug your own plugin.

Posted: Sat Nov 08, 2014 3:22 am
by Hedgehog
:(

[10 symbols]

Posted: Sat Nov 08, 2014 1:39 pm
by satoon101
I am really not sure what you expect. Our debug build is broken currently, and that is something we do need to fix. However, since most functionality we expose is simply directly exposing engine functionality, there is nothing to debug. We cannot provide debugging for the SDK. We can only provide it for functionality directly written into our plugin, and any third party libraries we have direct access to the code for.

Is there anything specific that you are trying to debug? Maybe we can help you out with that.

Posted: Sat Nov 08, 2014 5:42 pm
by Hedgehog
I was talking about debugging of Source.Python's plugins. For example you can setup some breakpoint and server pauses on it (I thought there can be a chance of doing this...), then you can run your plugin by steps.

Thanks, but I just got tired from using print and loggers :)

Posted: Sun Nov 09, 2014 2:00 am
by Doldol
I don't see what's wrong with examining logs? And isn't what you're suggesting already implemented? If my plugin contains an error it'll run until it encounters the spot of the error (your breakpoint) and throw an exception and logs it to where you specified (server console if you want).

It even keeps doing this and doesn't crash the server if you're not messing with the memory or doing other stuff Valve never intended you to do. You can go to the spot of your error fix it, sp reload and you're back up and running, and sp will tell you where you made your next mistake if any!

Personally I couldn't ask for more!
Edit: well an AI fixing my code would be nice, but would also make me obsolete, and that's also no fun! :(