Debugger as REPL: IntelliJ IDEA's Run to Cursor and Quick Evaluate Expression
2025-03-28
Tired of traditional debuggers, especially gdb and lldb's limitations with native code, the author discovered a powerful workflow in IntelliJ IDEA. Combining "Run to Cursor" and "Quick Evaluate Expression" transforms the debugger into a REPL. "Run to Cursor" executes the program to the cursor's position, while "Quick Evaluate Expression" lets you evaluate expressions (even newly typed code!) within the current stack frame. This approach replaces the line-by-line stepping with a more experimental, two-dimensional interaction within the editor, leveraging code completion and offering a significantly more efficient debugging experience.
Development