[Lldb-commits] [lldb] [lldb] Fallback to comparing modules by their canonical paths (PR #210041)
Charles Zablit via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 17 09:07:03 PDT 2026
charles-zablit wrote:
> You have to be careful never to change the way the user spelled the module for the main binary, since some tricky Unix programs work by symlinking a bunch of executables to the same one and switching the behavior off the value of argv[0].
>
> With your change, if you have a binary called `foo` and a symlink to it called `bar` and we first made a target with `foo`, then made a new target with `bar` - the second target will now reuse the Module we read in for `foo`. But we still have to ensure that when the second target is run, we pass argv0 of `bar` not `foo`. I can't tell whether this change will cause us to make that mistake, but it opens the window for it so we should test that that still works if we don't already.
This did introduce a regression. I added a test to catch it. The fix was to resolve the path the user used in Target.cpp and preserve it, but I don't think that's a strong solution and could break elsewhere.
https://github.com/llvm/llvm-project/pull/210041
More information about the lldb-commits
mailing list