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

2021-09-05 Thread David Blaikie via Phabricator via lldb-commits
dblaikie added a comment. In D97786#2976549 , @pfaffe wrote: > In D97786#2974879 , @dblaikie wrote: > >> Not fixable? Not sure I follow. In the case of cwd-relative (old behavior) >> you can fix the behavior by

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

2021-09-05 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe added a comment. In 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

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

2021-09-05 Thread David Blaikie via Phabricator via lldb-commits
dblaikie added a comment. In D97786#2974202 , @pfaffe wrote: > In D97786#2973868 , @dblaikie wrote: > >> This doesn't solve all use cases/it's not a terribly general purpose >> situation - using

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

2021-09-05 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe added a comment. In D97786#2973868 , @dblaikie wrote: > This doesn't solve all use cases/it's not a terribly general purpose > situation - using -fdebug-prefix-map/-fdebug-compilation-dir requires > knowledge of these limitations/how to use these

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

2021-08-30 Thread David Blaikie via Phabricator via lldb-commits
dblaikie added a comment. In D97786#2972153 , @pfaffe wrote: > This change breaks all existing uses of relative comp_dirs that don't > accidentally make all of them relative to the executable's directory already. > > It's easy to construct broken use

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

2021-08-30 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe added a comment. This change breaks all existing uses of relative comp_dirs that don't accidentally make all of them relative to the executable's directory already. It's easy to construct broken use cases: Consider compiling your program like `clang -g ./src/src.c -gsplit-dwarf -o

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

2021-04-23 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment. Since you just mainly want to run this past the bots again, probably best to just resubmit. You could update the patch here or not at your convenience, but I don't see it would serve any purpose to wait on approval. Sorry for not noticing it was a shell test, BTW...

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

2021-04-23 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. Pavel's test case passed on my local machine (x86_64 linux workstation). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 ___ lldb-commits

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

2021-04-23 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. Hi Pavel, Thank you for both the detailed explanation and the updated test case (and thank you Jim for your recommendations as well!). I'm testing the updated test case now. Assuming the tests pass, is it ok for me to re-land this CL using the updated test case? and

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

2021-04-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. It looks like you've managed to find a bug in lldb. Congratulations. ;) I don't yet fully understand what's going on, but the rough idea is this: Lldb relies heavily on knowing the boundaries of every function. For this reason, our ELF code contains logic to parse the

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

2021-04-23 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added a comment. In D97786#2693410 , @jingham wrote: > In D97786#2693381 , @cmtice wrote: > >> I had to revert this change because the test case broke the windows builder. >> What's the right way to

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

2021-04-15 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment. In D97786#2693381 , @cmtice wrote: > I had to revert this change because the test case broke the windows builder. > What's the right way to update/mark the test case so that it is only run on > appropriate architectures &

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

2021-04-15 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. I had to revert this change because the test case broke the windows builder. What's the right way to update/mark the test case so that it is only run on appropriate architectures & operating systems? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2021-04-15 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment. This broke the windows LLDB bot. Please fix it soon or revert. https://lab.llvm.org/buildbot/#/builders/83/builds/5685 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786

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

2021-04-15 Thread Caroline Tice via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb241f3cb292d: [LLDB] Use path relative to binary for finding .dwo files. (authored by cmtice). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2021-04-15 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. Yes, thanks for bearing with me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 ___

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

2021-04-14 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. I did leave 'main' in the .s file, but it's not very big. Is this ok now? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 ___ lldb-commits mailing list

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

2021-04-14 Thread Caroline Tice via Phabricator via lldb-commits
cmtice updated this revision to Diff 337622. cmtice added a comment. Update test case to use lldb on .o file and not run the inferior. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 Files:

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

2021-04-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D97786#2685814 , @cmtice wrote: > Pavel, your last comment lost me completely. How can I test the code I added > to lldb if I don't run lldb? I am a complete newbie at writing test cases so > there's probably something basic

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

2021-04-13 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. Pavel, your last comment lost me completely. How can I test the code I added to lldb if I don't run lldb? I am a complete newbie at writing test cases so there's probably something basic I'm missing? How would I observe the value of the variable without running lldb?

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

2021-04-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. One more thing I forgot to mention: In the all-paths-are-relative scenario, lldb will need some help with finding the source files. I believe that currently these will still be resolved relative to CWD, and that's something you may not want (?) Unlike dwos, this can be

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

2021-04-08 Thread Caroline Tice via Phabricator via lldb-commits
cmtice updated this revision to Diff 336276. cmtice added a comment. Herald added a reviewer: alexshap. Add a test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 Files: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

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

2021-04-08 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. If gdb does it, then I don't have any issues with this functionality. It could use a test case though. You can try rewriting that gdb test case for lldb -- we don't have fancy dwarf assemblers (cool stuff, btw), we just use asm (you could look at

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

2021-04-07 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. It has taken a bit of time to get through the GDB reviews, but the change to GDB was accepted and committed: https://sourceware.org/pipermail/gdb-cvs/2021-April/050267.html May I commit this change to LLDB now? CHANGES SINCE LAST ACTION

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

2021-03-08 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment. I bet gdb uses the debugger's CWD because that's the practice working ON gdb (at least back in the day when I worked on it). You built gdb, cd'ed into the gdb build directory and ran the debugger on it from there. gdb's build also produced a debugging-gdb specific

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

2021-03-07 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. In D97786#2607275 , @labath wrote: > In D97786#2603656 , @cmtice wrote: > >> I'm not sure about using target.debug-file-search-paths, and what the >> changes Pavel is suggesting would

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

2021-03-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D97786#2603656 , @cmtice wrote: > I'm not sure about using target.debug-file-search-paths, and what the changes > Pavel is suggesting would entail. I imagine it would involve calling Symbols::LocateExecutableSymbolFile to

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

2021-03-04 Thread Caroline Tice via Phabricator via lldb-commits
cmtice updated this revision to Diff 328191. cmtice added a comment. Update to incorporate Pavel's suggested simplification. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 Files: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

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

2021-03-04 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. I'm not sure about using target.debug-file-search-paths, and what the changes Pavel is suggesting would entail. But the real question I am trying to resolve here is not "what are all the places we should be searching for the .dwo files?" but "When we're given a

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

2021-03-04 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Having a setting for this would not be unreasonable. But what about reusing an existing setting for this purpose? I thinking of the (global) `target.debug-file-search-paths` setting and the associated logic (`Symbols::LocateExecutableSymbolFile` and friends). If we used

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

2021-03-03 Thread Caroline Tice via lldb-commits
Something went very wrong on the patch upload. This does NOT look like the patch I intended! DO NOT REVIEW THIS UNTIL I CAN UPLOAD THE RIGHT PATCH! -- Caroline cmt...@google.com On Tue, Mar 2, 2021 at 10:53 AM Shoaib Meenai via Phabricator < revi...@reviews.llvm.org> wrote: > smeenai added a

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

2021-03-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment. While next to the binary seems like a better guess than the cwd, it does seem awkward that if the binary & dwo's aren't in the same place, you have to move files to get that heuristic to work, whereas you could just "cd" into wherever the dwo's got dumped to make the

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

2021-03-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D97786#2598100 , @cmtice wrote: > re "GDB does it this way" -- I am also writing/submitting a patch to get GDB > to change this behavior. Ah, I see. That changes the picture, I'd say. If gdb folks go along with that, then I

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

2021-03-02 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment. It is true that the compiler will not know where the final executable will be placed, and if the executable gets moved then debugging with .dwo files will probably not work anyway, However as it is currently written, LLDB will fail to find the .dwo files, *even when

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

2021-03-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a subscriber: thakis. labath added a comment. Also, cc @thakis, who floated the idea of using a special path token (`$ORIGIN`) to achieve the same thing. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786

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

2021-03-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In general, a compiler also does not know where the final executable will be placed -- this can be only (maybe) be said for a sufficiently strict build system (like the one at google). I wouldn't say that searching relative to the cwd is really that much better, but at

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

2021-03-02 Thread Caroline Tice via Phabricator via lldb-commits
cmtice updated this revision to Diff 327523. cmtice added a comment. Upload the correct patch this time. (sorry!) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 Files: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Index:

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

2021-03-02 Thread Shoaib Meenai via Phabricator via lldb-commits
smeenai added a comment. Is this rebased on main? The LLD for Mach-O changes look like they belong to a different diff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786

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

2021-03-02 Thread Caroline Tice via Phabricator via lldb-commits
cmtice created this revision. cmtice added a reviewer: jingham. Herald added subscribers: cishida, hiraditya. Herald added a reviewer: int3. Herald added a project: lld-macho. Herald added a reviewer: lld-macho. cmtice requested review of this revision. Herald added a reviewer: jdoerfert. Herald