Bug 12938 - RFE: Find the regression point in the code
Summary: RFE: Find the regression point in the code
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: archer
: 13207 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-27 16:41 UTC by Jan Kratochvil
Modified: 2013-03-04 18:08 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2011-06-27 16:41:56 UTC
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.
Comment 1 Pedro Alves 2011-06-28 10:02:58 UTC
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."
Comment 2 dje 2011-09-20 22:13:25 UTC
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).
Comment 3 dje 2011-09-20 22:15:12 UTC
*** Bug 13207 has been marked as a duplicate of this bug. ***