[Lldb-commits] [PATCH] D73594: Refactor CommandObjectTargetSymbolsAdd::AddModuleSymbols

Adrian McCarthy via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 28 17:01:57 PST 2020


amccarth created this revision.
amccarth added reviewers: clayborg, jasonmolenda.

- [NFC] Renamed local `matching_module_list` to `matching_modules` for conciseness.

- [NFC] Eliminated redundant local variable `num_matches` to reduce the risk that changes get it out of sync with `matching_modules.GetSize()`.

- Used an early return from case where the symbol file specified matches multiple modules.  This is a slight behavior change, but it's an improvement: It didn't make sense to tell the user that the symbol file simultaneously matched multiple modules and no modules.

- [NFC] Used an early return from the case where no matches are found, to better align with LLVM coding style.

- [NFC] Simplified call of `AppendWarningWithFormat("%s", stuff)` to `AppendWarning(stuff)`.  I don't think this adds any copies.  It does construct a StringRef, but it was going to have to scan the string for the length anyway.

- [NFC] Removed unnecessary comments and reworded others for clarity.

- Used an early return if the symbol file could not be loaded.  This is a behavior change because previously it could fail silently.

- Used an early return if the object file could not be retrieved from the symbol file.  Again, this is a change because now there's an error message.

- If we successfully load a symbol file that seems to match, but then detect a file name mismatch, now we only issue a warning.  We've already determined they match, so it seems pointless to change our minds.

- [NFC] Eliminated a namespace alias that wasn't particularly helpful.


https://reviews.llvm.org/D73594

Files:
  lldb/source/Commands/CommandObjectTarget.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73594.241024.patch
Type: text/x-patch
Size: 10854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200129/bbae5adf/attachment.bin>


More information about the lldb-commits mailing list