Raised This Month: $51 Target: $400
 12% 

How to debug plugins most easily?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-18-2018 , 14:09   How to debug plugins most easily?
Reply With Quote #1

Hi,

so, you faced with a bug, next you fixed it and would like to test plugin again.

-> compile -> replace on server...

What is a fastest way to check everything okay?

1) E.g., are there a command to force reloading all plugins without server full restart?

2) How do you place "assert-s". Are you placing something like "PrintChatAll" at some key places in plugin code to see in-game that every variable works fine? What is a most convenient way?

3) Is there special IDE for SourcePawn?

Another tips...

P.S. I worked on L4d1 plugins 2 years ago. Just trying to refresh memories and improve knowledges.

Thanks,
Alex.

Last edited by Dragokas; 02-18-2018 at 14:12.
Dragokas is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-18-2018 , 15:33   Re: How to debug plugins most easily?
Reply With Quote #2

Quote:
Originally Posted by Dragokas View Post
1) E.g., are there a command to force reloading all plugins without server full restart?
`sm plugins refresh` will reload all plugins that have been modified.

Quote:
Originally Posted by Dragokas View Post
2) How do you place "assert-s". Are you placing something like "PrintChatAll" at some key places in plugin code to see in-game that every variable works fine? What is a most convenient way?
Pretty much, yes.

Quote:
Originally Posted by Dragokas View Post
3) Is there special IDE for SourcePawn?
Yes, Pawn Studio, but it is old and clunky, there is also SPEdit - neither are really recommend and it is almost certainly better to use your favourite editor whatever that is (and if it isn't Notepad, it probably has a plugin/extension out there for a) SourcePawn syntax highlighting and b) the ability to run build commands)
__________________
asherkin is offline
kot4404
Senior Member
Join Date: Mar 2013
Old 02-18-2018 , 15:36   Re: How to debug plugins most easily?
Reply With Quote #3

1. sm plugins reload x, sm plugins refresh
2. if it isn't that complicated add +1 to the int for every passed check, at the end of the function print the message with int value
3. https://forums.alliedmods.net/showthread.php?t=259917
kot4404 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-18-2018 , 16:01   Re: How to debug plugins most easily?
Reply With Quote #4

Thanks.

3) I'm using AkelPad + plugins + (Ctrl + F5 for build) together with reg. tweak:
compile


Glad to see there is IDE with Intellisense.
Dragokas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode