Diego Novillo has asked to find where the execution of two inferiors (with two different executables) starts to differ - to find the exact regression point in the code.
Currently I use reverse execution to iterate down throught the code where the behavior still does / does not differ.
The problem with the automatic way may be to properly differentiate ignorable vs. significant execution differences.
A while ago someone posted <http://comments.gmane.org/gmane.comp.gdb.devel/27441>
showing an approach for this use case that builds on top of gdb, rather than built in:
"(...) which was written to run two gdb's debugging a stage1 and
stage2 generation of a compiler and single step until a line number differs.
It is written in Python and uses pexpect"
From tgdb-0.1.tar.gz's README.
"TwinGDB is a front end to GDB which runs two instances of gdb on two
executables and will automatically single step them until a deviation
(seen by line number) occurs. Typically this is useful if you are
developing a program for a different archicture or if you are in
compiler development where a second generation build fails to behave
in exactly the same way as the first generation. It can also be used
to explore when a particular command line option takes effect. There
are probably more uses as well..
This program is in a pre alpha state, nevetheless, the author uses
it to debug GNU Modula-2.
As single stepping gdb is not exactly fast, the program can be
configured to skip functions, skip source files which reside in
particular directories, start stepping at a particular function and
finish at another etc."
Copied from 13207 for reference sake:
Such a script feels like more of a contrib-like patch, than part of gdb proper,
but it still feels like something gdb could/should provide.
When it works, it's a real timesaver, and the basic infrastructure shouldn't be
that hard to write in python (and if it is then we've found good places where
python needs to be extended).
*** Bug 13207 has been marked as a duplicate of this bug. ***