diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2016-01-05 01:56:59 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2016-01-05 01:56:59 +0000 |
| commit | 52db793d3386a227d8cecbf410996882074cfa17 (patch) | |
| tree | a5832be9eca34b8261742eb607abd5f86dddda25 /lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp | |
| parent | 54fc6575c5db9bb12c566c433cdc877fbdf20974 (diff) | |
| download | bcm5719-llvm-52db793d3386a227d8cecbf410996882074cfa17.tar.gz bcm5719-llvm-52db793d3386a227d8cecbf410996882074cfa17.zip | |
Improved debugging printing. NFC
llvm-svn: 256805
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp index 2448ea06ca1..e830db9fcc7 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp @@ -625,19 +625,47 @@ void Util::buildAtomToAddressMap() { _entryAtom = info.atom; } DEBUG_WITH_TYPE("WriterMachO-address", llvm::dbgs() - << " address=" - << llvm::format("0x%016X", _atomToAddress[info.atom]) - << " atom=" << info.atom - << " name=" << info.atom->name() << "\n"); + << " address=" + << llvm::format("0x%016X", _atomToAddress[info.atom]) + << llvm::format(" 0x%09lX", info.atom) + << ", file=#" + << info.atom->file().ordinal() + << ", atom=#" + << info.atom->ordinal() + << ", name=" + << info.atom->name() + << ", type=" + << info.atom->contentType() + << "\n"); } } + DEBUG_WITH_TYPE("WriterMachO-address", llvm::dbgs() + << "assign header alias atom addresses:\n"); for (const Atom *atom : _machHeaderAliasAtoms) { _atomToAddress[atom] = _ctx.baseAddress(); - DEBUG_WITH_TYPE("WriterMachO-address", llvm::dbgs() - << " address=" - << llvm::format("0x%016X", _atomToAddress[atom]) - << " atom=" << atom - << " name=" << atom->name() << "\n"); +#ifndef NDEBUG + if (auto *definedAtom = dyn_cast<DefinedAtom>(atom)) { + DEBUG_WITH_TYPE("WriterMachO-address", llvm::dbgs() + << " address=" + << llvm::format("0x%016X", _atomToAddress[atom]) + << llvm::format(" 0x%09lX", atom) + << ", file=#" + << definedAtom->file().ordinal() + << ", atom=#" + << definedAtom->ordinal() + << ", name=" + << definedAtom->name() + << ", type=" + << definedAtom->contentType() + << "\n"); + } else { + DEBUG_WITH_TYPE("WriterMachO-address", llvm::dbgs() + << " address=" + << llvm::format("0x%016X", _atomToAddress[atom]) + << " atom=" << atom + << " name=" << atom->name() << "\n"); + } +#endif } } |

