diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2015-12-16 22:03:21 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2015-12-16 22:03:21 +0000 |
| commit | e5fa5a3c295d33f33805e6ef8d111162bb4813e8 (patch) | |
| tree | 50a1fb6a2635212ecd61b6f69485167cc4590ee3 /lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | |
| parent | 48dd080c77c6a6398906b6db73d015fee15d8591 (diff) | |
| download | bcm5719-llvm-e5fa5a3c295d33f33805e6ef8d111162bb4813e8.tar.gz bcm5719-llvm-e5fa5a3c295d33f33805e6ef8d111162bb4813e8.zip | |
Add more debugging output to MachO lld. NFC.
In debug builds there's now a dump method on Section and improved
printing of atoms.
llvm-svn: 255826
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 7ed79555722..1c4bb1d4f6a 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -27,13 +27,17 @@ #include "MachONormalizedFileBinaryUtils.h" #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Format.h" #include "llvm/Support/MachO.h" #include "llvm/Support/LEB128.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm::MachO; using namespace lld::mach_o::normalized; +#define DEBUG_TYPE "normalized-file-to-atoms" + namespace lld { namespace mach_o { @@ -892,10 +896,13 @@ std::error_code normalizedObjectToAtoms(MachOFile *file, const NormalizedFile &normalizedFile, bool copyRefs) { + DEBUG(llvm::dbgs() << "******** Normalizing file to atoms: " + << file->path() << "\n"); bool scatterable = ((normalizedFile.flags & MH_SUBSECTIONS_VIA_SYMBOLS) != 0); // Create atoms from each section. for (auto § : normalizedFile.sections) { + DEBUG(llvm::dbgs() << "Creating atoms: "; sect.dump()); if (isDebugInfoSection(sect)) continue; bool customSectionName; @@ -1061,6 +1068,14 @@ normalizedToAtoms(const NormalizedFile &normalizedFile, StringRef path, } } +#ifndef NDEBUG +void Section::dump(llvm::raw_ostream &OS) const { + OS << "Section (\"" << segmentName << ", " << sectionName << "\""; + OS << ", addr: " << llvm::format_hex(address, 16, true); + OS << ", size: " << llvm::format_hex(content.size(), 8, true) << ")\n"; +} +#endif + } // namespace normalized } // namespace mach_o } // namespace lld |

