[Lldb-commits] [PATCH] D78421: Fix out of sync source code/executable when debugging
Martin Schmidt via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 26 05:54:47 PDT 2020
n1tram1 added a comment.
Passing a simple `Module &` sounds like an easy but I would also have to make `SourceManager::GetFile` take a `Module &`.
There is one corner case, let's say file.c is being used by //Module A// and //Module B// (which are both shared libraries). If //file.c// is modified and //Module B// recompile and reloaded, well will want to see the updated //file.c// when stepping through //Module B// but we will want the old //file.c// when stepping through //Module B//.
My issue is that the `SourceCacheManager` use only the `FileSpec` as a key to the cache, therefore it might fetch the wrong `File` (gets the //file.c// corresponding to //Module A// when we wanted the //file.c// corresponding to //Module B//).
For the same reason I can't just modify `ModuleList::FindSourceFile` to have it return a `ModuleSP` because it might either //Module A// or //Module B//.
I feel like there is a lot to be done for such a simple bug. I don't know it it's worth it...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78421/new/
https://reviews.llvm.org/D78421
More information about the lldb-commits
mailing list