4 ms·
Try stepping through the code in an interactive debugger. I typically run a gdb-style debugger under Emacs, but anything which lets you step through code and in
by gcv 18y ago
Try stepping through the code in an interactive debugger. I typically run a gdb-style debugger under Emacs, but anything which lets you step through code and inspect data works well.
Some people really loathe these tools, but I think they're invaluable when someone drops a pile of spaghetti code in your lap and tells you to support it. Figure out the entry point to the code, set a breakpoint in main() or something like that, and start stepping. After ploughing through a few of the code's basic transactions, you should have a sense for the data structures and abstractions it relies on, if any. Then, you should be able to read individual functions and such to get the gritty details. The use of threads substantially complicates the picture, of course.