From: terencehill Date: Sat, 11 May 2019 15:02:04 +0000 (+0000) Subject: Add Cscope section X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.wiki.git;a=commitdiff_plain;h=3405b4630b6d1bec07c7999fca88c89e3f305ec3 Add Cscope section --- diff --git a/Programming-Tips.md b/Programming-Tips.md index 6bb78ba..2e4f2d8 100644 --- a/Programming-Tips.md +++ b/Programming-Tips.md @@ -53,3 +53,20 @@ prvm_breakpoint server prvm_globalwatchpoint server prvm_edictwatchpoint server ``` +### Tool to find C symbols, functions, declarations and definitions inside source code + +For this purpose it's possible to use a text-based tool called [Cscope](https://en.wikipedia.org/wiki/Cscope) together with a GUI (it can be either an application or a plugin for a text editor). + +#### Download / Installation + +* Download and install cscope with `pacman -S cscope` +Windows users must download the Windows version of cscope from https://code.google.com/archive/p/cscope-win32/downloads since the mingw version generates broken indices. + +* Download and install a cscope GUI or a plugin for your text editor / IDE. For example for jEdit there is a plugin called [CscopeFinder](http://plugins.jedit.org/plugins/?CscopeFinder). + +* Copy [cscope_createindex.sh](uploads/17c725e19be8f4935c30c2506e168405/cscope_createindex.sh) into the main xonotic repo directory. + +#### Usage + +* Run `cscope_createindex.sh` to build cscope indices for both game (QC code) and Darkplaces (C code). This step must be repeated every time you do some code changes. +The indices can now be used to browse code confortably with the cscope GUI of your choice. \ No newline at end of file