SA-MP Forums Archive
sa-mp debugger - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: sa-mp debugger (/showthread.php?tid=443933)



sa-mp debugger - zgintasz - 14.06.2013

One of my favourite things when programming is the debugger. That one, where you set breakpoints, code execution stops at this point and you can inspect various variables. You can ****** more about it, it's very awesome. Well, when coding for sa-mp, you have to use these ugly print messages...
Is it theorically possible to use a debugger when coding for sa-mp? Maybe anyone tried something? Because afaik the code isn't executed directly from compiled .amx file. Any thoughts about it?


Re: sa-mp debugger - Vince - 14.06.2013

It would be impractical. The debugger follows the logical flow of code. If an if-statement returns false then that block is skipped. Therefor you would need to simulate players somehow.


Re: sa-mp debugger - zgintasz - 14.06.2013

Yeah, but you could somehow be that one player on whose debugger is working(maybe with client-side plugin help). So it should be teorically possible to somehow use a debugger.


Re: sa-mp debugger - maddinat0r - 15.06.2013

One could program an IDE and integrate the AMX machine into it, then compile the script with debug symbols. Break points could be implemented like that: you set a break point in the IDE and when compiling, the IDE adds a special native at that line. When code gets executed and the code executes the native, the native pauses the pawn thread. Only problem is reading data from stack, I don't have enough experience to tell if this is possible. Also if some runtime error happens it should be no problem to pause the pawn thread at the line of code where that error happened.
Almost everything is possible in theory


Re: sa-mp debugger - JoBullet - 15.06.2013

It already exists and you can compile it, though it's command-line based.


Re: sa-mp debugger - zgintasz - 15.06.2013

Quote:
Originally Posted by JoBullet
Посмотреть сообщение
It already exists and you can compile it, though it's command-line based.
can you give us more information about it?