Tools - brown-cs1690/handout GitHub Wiki
Tools for Working in a Large Codebase
Taking notes
At risk of seeming low-tech, using code tags such as TODO
, XXX
, and
FIXME
(or even your cs login) with helpful notes about what you were thinking when you noticed
something was broken or unfinished will be incredibly useful. This also
allows you to search for remaining tasks by using grep
(or, if you’re
using Git) git grep
.
Even simpler than that, taking notes about the code you’re developing or drawing call trees to visualize the expected call stacks can be incredibly helpful for learning your way around a new codebase.
Text Editors and IDEs
Because the fights between text editors are near-religious in severity, we won’t recommend a particular code editor here, but we do recommend that you find a “serious” text editor with some built-in niceness to work in while you code. These include Vim and Emacs (which typically run at the command line and can run commands without leaving the editor), VSCode, and CLion. (Many TAs have used VSCode in the past and can offer tips and suggestions for how to navigate the Weenix codebase, please reach out to your mentor if you would like any pointers on how to use VSCode most effectively.)
cscope
Integration with Basically every major text editor has a cscope
extension or bundle
which allows you to do forward (“Where is this function defined?”) and
reverse (“Where is this function called?”) searches, automatic text
completion for function and variable names, etc. If you choose to use a
text editor without these functions built-in, we highly recommend using
cscope
to make your job easier. Note that there is a cscope
build
target which will automatically update the cscope
index every time you
recompile (or you can also re-run it manually), so you just need to set
up your editor to use the generated index file.
To learn how to use Cscope, we recommend reading this (short) guide. There are also (even shorter) guides on how to use Cscope in Vim, Emacs, and Sublime Text.
gdb
Debugging with If you have never used a debugger before, we highly recommend you learn to use one, either through a graphical interface like the one in many IDEs, or from the command line. This will be a development tool you will not want to live without once you learn to use it.
gdb
is the most widely used debugger for C code, with support for
kernel development using many virtual machines. There are many wonderful
reasons to use gdb
to debug Weenix in particular, so please read the
appendix on debugging for more information.