[Lldb-commits] [PATCH] D70458: [NFC] Refactor and improve comments in CommandObjectTarget

Adrian McCarthy via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 20 11:46:59 PST 2019

amccarth marked 2 inline comments as done.
amccarth added inline comments.

Comment at: lldb/source/Commands/CommandObjectTarget.cpp:4059
       if (!module_spec.GetFileSpec() && !module_spec.GetPlatformFileSpec())
-          module_spec.GetFileSpec().GetFilename() = symbol_fspec.GetFilename();
+        module_spec.GetFileSpec() = symbol_fspec;
labath wrote:
> This does change behavior because previously the symbol file directory wasn't being copied. I think that was intentional because the comment on line 4112 says "match up the file by basename" (and it also makes sense because if you're adding symbols in an external file, then the main module file cannot be the exact same path as the symbol file).
Oops.  Thanks for catching that.

ModuleSpec seems weird:  It exposes an internal members to be tweaked in arbitrary ways.  I would have expected that it would have to react to certain kinds of changes to keep itself consistent.  If it has no invariants to enforce, it could have been a plain struct with a bunch of public member variables.



More information about the lldb-commits mailing list