Debugging

All other Source.Python topics and issues.
Hedgehog
Member
Posts: 62
Joined: Sun Nov 03, 2013 8:54 pm

Debugging

Postby Hedgehog » Fri Nov 07, 2014 5:16 pm

How to debug Source.Python plugin?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Nov 07, 2014 5:58 pm

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.
Hedgehog
Member
Posts: 62
Joined: Sun Nov 03, 2013 8:54 pm

Postby Hedgehog » Fri Nov 07, 2014 6:09 pm

I'm tired from this... For what is debug build for? I thought it was created to something with breakpoints and steps.
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Nov 07, 2014 6:35 pm

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.
Hedgehog
Member
Posts: 62
Joined: Sun Nov 03, 2013 8:54 pm

Postby Hedgehog » Sat Nov 08, 2014 3:22 am

:(

[10 symbols]
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sat Nov 08, 2014 1:39 pm

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.
Image
Hedgehog
Member
Posts: 62
Joined: Sun Nov 03, 2013 8:54 pm

Postby Hedgehog » Sat Nov 08, 2014 5:42 pm

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 :)
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Postby Doldol » Sun Nov 09, 2014 2:00 am

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! :(

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 11 guests