This plugin helps you debug runtime errors and server crashes. When something goes wrong you see a more or less detailed error message that contains a description of the error and a stack trace.
- Download a compiled plugin form the Releases page on Github or build it yourself from source code (see below).
- Extract/copy
crashdetect.so
orcrashdetect.dll
to<sever>/plugins/
. - Add
crashdetect
(Windows) orcrashdetect.so
(Linux) to theplugins
line of your server.cfg.
Install gcc and g++, make and cmake. On Ubuntu you would do that with:
sudo apt-get install gcc g++ make cmake
If you're building on a 64-bit system you'll need multilib packages for gcc and g++:
sudo apt-get install gcc-multilib g++-multilib
If you're building on CentOS, install the following packages:
yum install gcc gcc-c++ cmake28 make
Now you're ready to build CrashDetect:
cd crashdetect
mkdir build && cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
make
You'll need to install CMake and Visual Studio (Express edition will suffice). After that, either run cmake from the command line:
cd crashdetect
mkdir build && cd build
path/to/cmake.exe ../ -DBUILD_TESTING=OFF
or do the same from cmake-gui. This will generate a Visual Studio project in the build folder.
To build the project:
path/to/cmake.exe --build . --config Release
You can also build it from within Visual Studio: open build/crashdetect.sln and go to menu -> Build -> Build Solution (or just press F7).
CrashDetect reads settings from server.cfg, the server configuration file. Below is the list of available settings along with some examples.
-
trace <flags>
Enables function call tracing.
If enabled, CrashDetect will show information about every function call in all running scripts, such as the name of the function being called and the values of its parameters.
flags
may be one or combination of the following:n
- trace native functionsp
- trace public functionsf
- trace normal functions (i.e. all non-public functions)
For example,
trace pn
will trace both public and native calls, andtrace pfn
will trace all functions. -
trace_filter <regexp>
Filters
trace
output based on a regular expression.Examples:
trace_filter Player
- output functions whose name containsPlayer
trace_filter playerid=0
- show functions whoseplayerid
parameter is 0
To get as much useful information as possible in crash and runtime error reports during debugging compile your script(s) with debug info.
Licensed under the 2-clause BSD license. See the LICENSE.txt file.