Tuesday, March 5, 2013

Twin debugging

Are debuggers programmable?

From time to time, I run two instances of the debugger. I want to step through two instances of a program, feeding each program slightly different data. I want to identify the point at which the code execution differs between the two sets of input data.

Each instance of the debugger has a copy of a program under development. I feed the two instances of the debugged program the two sets of data, and slowly work my way though the code.

Being non-programmable, I must perform every operation manually. I must step through the code on each debugger, often alternating between the two. Sometimes I can place breakpoints at strategic points in the code -- often guesses. The operation is mind-numbing. Sometimes it is so mind-numbing that I miss the important point of the execution: when the code sequences differ.

What I want is a tandem debugger, kind of like a tandem bicycle. I want a mega-debugger that can load two instances of a program, allow me to start both instances and feed them data, and monitor the execution of the program. When the code sequence differs, I want the mega-debugger to stop and inform me.

I call this "twin debugging", or "dual debugging". I find that I need this often, especially when debugging the data for programs or when exploring unknown code.

The problem is that the debugger is not, generally, a programmable thing. All too often, debuggers are enclosed by the IDE.

A quick search of the internet shows that there are some programmable debuggers, but no one seems to be using two instances of the same program. (Or two slightly different versions of the same program, which is a slightly trickier challenge.)

No comments: