Zeex / samp-plugin-crashdetect

Crash/error reporting plugin for SA-MP server
http://forum.sa-mp.com/showthread.php?t=262796
BSD 2-Clause "Simplified" License
116 stars 23 forks source link

Trace with params #51

Open Dayvison opened 8 years ago

Dayvison commented 8 years ago

Its possible add params to trace functions? If yes is a good enchantment

-Sorry bad english, if you not understand a example should be like this:

[trace] native IsPlayerConnected ( param[0] = 0)
[trace] native GetPlayerName ( param[0] = 0, param[1] = address, param[2] = 25)
[trace] native format ( param[0] = addr, param[1] = 128, param[2] = "Hello World")
Zeex commented 8 years ago

That seems like a useful feature indeed, perhaps I'll add it the next version. I thought about adding something like this but wasn't quite sure it would be worth the effort.

In the meantime, you can use a script I wrote a while ago for tracing natives' parameters: https://github.com/Zeex/samp-plugin-crashdetect/blob/master/tools/wrap_natives.py

It generates an include file with wrappers for native functions, which allows you to see their arguments in traces. You execute it like this:

python wrap_natives.py a_samp.inc a_players.inc > native_wrappers.inc

where native_wrappers.inc is the name of your output file (could be anything).

Dayvison commented 8 years ago

Ok, thanks