I'm considering how to do automatic bug tracking and as part of that I'm wondering what is available to match source code line numbers (or more accurate numbers mapped from instruction pointers via something like [`addr2line`](http://sourceware.org/binutils/docs/binutils/addr2line.html)) in one version of a program to the same line in another. (Assume everything is in some kind of source control and is available to my code)

The simplest approach would be to use a diff tool/lib on the files and do some math on the line number spans, however this has some limitations:

* It doesn't handle cross file motion.
* It might not play well with lines that get changed
* It doesn't look at the information available in the intermediate versions.
* It provides no way to manually patch up lines when the diff tool gets things wrong.
* It's kinda clunky

Before I start diving into developing something better:

* *What already exists to do this?*
* *What features do similar system have that I've not thought of?*