This is an archive of the discontinued LLVM Phabricator instance.

Add reverse file remapping for breakpoint set
ClosedPublic

Authored by tberghammer on Mar 3 2016, 5:56 AM.

Details

Summary

Add reverse file remapping for breakpoint set

LLDB can remap a source file to a new directory based on the
"target.sorce-map" to handle the usecase when the source code moved
between the compilation and the debugging. Previously the remapping
was only used to display the content of the file. This CL fixes the
scenario when a breakpoint is set based on the new an absolute path
with adding an inverse remapping step before looking up the breakpoint
location.

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer updated this revision to Diff 49732.Mar 3 2016, 5:56 AM
tberghammer retitled this revision from to Add reverse file remapping for breakpoint set.
tberghammer updated this object.
tberghammer added reviewers: labath, clayborg.
tberghammer added a subscriber: lldb-commits.

This looks fine to me.

At some point we should deal with the loss of information when we resolve re-mapped paths. For instance, here I set a breakpoint by the moved source location's full path, and that gets remapped to the build location. That's lovely since it makes the breakpoint take, but then if I do "break list" I'll see something I didn't enter, which is a little surprising. That happens in a few other places, so I don't think you need to deal with it here (and I don't think we want to burden FileSpec with the responsibility of keeping both paths) but just something to keep in the back of our minds...

It is a good point. I don't think displaying incorrect path for a breakpoint is a big issue so I don't plan to address it now but we should do it at some point.

This revision was automatically updated to reflect the committed changes.