[PATCH] D74883: Add a llvm-gsymutil tool that can convert object files to GSYM and perform lookups.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 14:01:57 PST 2020
aprantl added a comment.
Couple of coding style issues inline.
================
Comment at: llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp:36
+ StringRef SectName;
+ if (Expected<StringRef> SectNameOrErr = Sect.getName()) {
+ SectName = *SectNameOrErr;
----------------
Generally, for readability it might be better to write these checks as
```
Expected<StringRef> SectNameOrErr = Sect.getName();
if (! SectNameOrErr) {
consumeError(SectNameOrErr.takeError());
continue;
}
SectName = *SectNameOrErr;
```
================
Comment at: llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp:95
+ if (!Name)
+ logAllUnhandledErrors(Name.takeError(), Log, "ObjectFileTransformer: ");
+ else {
----------------
```
if (!Name) {
logAllUnhandledError
break;
}
```
================
Comment at: llvm/tools/llvm-gsym/llvm-gsymutil.cpp:145
+ if (sys::fs::is_directory(BundlePath) &&
+ sys::path::extension(BundlePath) == ".dSYM") {
+ std::error_code EC;
----------------
```
if (!...)
return {};
```
================
Comment at: llvm/tools/llvm-gsym/llvm-gsymutil.cpp:363
+ for (auto &ObjForArch : Fat->objects()) {
+ if (auto MachOOrErr = ObjForArch.getAsObjectFile()) {
+ auto &Obj = **MachOOrErr;
----------------
if (!...) break
================
Comment at: llvm/tools/llvm-gsym/llvm-gsymutil.cpp:497
+ }
+ } else {
+ Gsym->dump(outs());
----------------
These deeply nested loops are very hard to follow.
```
if (LookupAddresses.empty())) {
Gsym->dump(outs());
continue;
}
// Lookup an address in a GSYM file and print any matches.
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74883/new/
https://reviews.llvm.org/D74883
More information about the llvm-commits
mailing list