Understanding Large and Unfamiliar Codebases
summary
Large legacy repo (examples: over 1,000,000 lines overall, OpenTTD ~300k C/C++ lines) gets explored by running and attaching debuggers, sampling profilers and generated docs to find real entry points, hotspots and data flows. Practical tactics include using grep to find mains and entry points, compiling with debug symbols and attaching GDB/LLDB, recording execution and using time-travel debugging with reverse step and watchpoints to locate who mutates a value (example: watchpoint on train profit), plus Perf/Valgrind/kcachegrind and Doxygen for visualization.
AI-written summary · about
chapters (19)
- 0:00Understanding large codebases
- 3:56Challenges of large codebases
- 12:50Key categories for understanding code
- 13:10Open Transport Tycoon case study
- 16:43Finding entry points in code
- 20:38Debug symbols for exploration
- 22:25Debuggers for code flow
- 27:19Reverse debugging with time travel
- 35:50Coding journal for investigations
- 36:32Profiling to find hotspots
- 38:18Visualizing code flow
- 41:27Debugging third-party libraries
- 42:09Breaking down complexity
- 42:30Tools for visual management
- 44:59Documentation from source
- 47:25Software visualization patterns
- 48:47Human factors in code
- 51:56AI tools for exploration
- 56:52Summary
related talks
59mI Just Inherited 50,000 Lines of Code! What Now? — A Practical Guide
01h 31mClean(er) Code for Large Scale Legacy Applications
58m10 Techniques to Understand Existing Code
49mFinding Your Codebases C++ Roots
57mLessons from 20 years of Debugging C++ Code
44mA Guide to Debugging C++ Code: Practical and Interactive Examples
37mBehind Enemy Lines - Reverse Engineering C++ in Modern Ages
57mModern Linux C++ debugging tools - under the covers
