[Lldb-commits] [PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.

Philip Pfaffe via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 1 04:27:09 PDT 2021

pfaffe added a comment.

In D97786#2974879 <https://reviews.llvm.org/D97786#2974879>, @dblaikie wrote:

> Not fixable? Not sure I follow. In the case of cwd-relative (old behavior) you can fix the behavior by changing where you invoke the debugger from, and in the case of exe-relative you can fix the behavior by moving the executable? (once both source and dwo lookup is implemented consistently, at least)

Thanks, I totally missed the fact that the patch intended to keep cwd-relative lookup working! Kudos for that! I overlooked it being mentioned in the discussion, and it's not in the commit message and the implementation is quite subtle. That eliminates most of my concerns!

That being said the implementation looks like it only does this partially. If I understand this correctly, the cwd-relative check happens in line 1646, but that only checks if the `dwo_name` exists. Below, `comp_dir/dwo_name` is however not checked against cwd. That means that we only get the old behavior if comp_dir happens to be `.`; any non-trivial relative comp_dir will behave differently, in that I need to cd into the comp_dir manually first to make things work. That's much better than I originally feared (chromium, e.g., uses `.`, so they're fine), but I still think we should retain the old behavior for non-trivial comp_dirs as well.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list