Debugger: Step 1: Edit variable, Step 2: ..., Step 3: Profit! | Haiku Project

In a previous blog post, I had described the newly added ability to edit raw memory. While this makes a number of things possible that otherwise wouldn’t be, it generally isn’t the most convenient approach for the more general case one runs into over the course of debugging. As of hrev49449, some new enhancements have been introduced that should make life much simpler in many cases. Suppose the debugger is stopped in a particular function containing a for loop, where a breakpoint is set allowing each pass of it to be run. Suddenly, after running a pass, the results yield unexpected values and/or behavior that needs to be analyzed, but the only way to do so would be to repeat that pass. Normally, this would require restarting the program or otherwise exiting the function and re-entering it via some triggered way, which depending on circumstances may not easily be possible. It would be nice if, alternatively, one could simply edit the value of the loop counter to repeat said pass. This can now be done by either double clicking the variable in question, or right clicking it and choosing “Edit”. Doing so for an integer will bring up a window like the following:

This is a companion discussion topic for the original entry at