[Lldb-commits] [PATCH] D18464: Implement `target modules dump headers`
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 4 13:37:53 PDT 2016
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
See inlined comments.
================
Comment at: source/Commands/CommandObjectTarget.cpp:1568
@@ +1567,3 @@
+ ObjectFile *objfile = module->GetObjectFile();
+ strm.Printf("'%s':\n", objfile->GetFileSpec().GetCString());
+ strm.IndentMore();
----------------
Actually looking at the ObjectFilePECOFF and ObjectFileMachO dump functions, they both do something like:
```
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
s->Printf("%p: ", static_cast<void*>(this));
s->Indent();
if (m_header.magic == MH_MAGIC_64 || m_header.magic == MH_CIGAM_64)
s->PutCString("ObjectFileMachO64");
else
s->PutCString("ObjectFileMachO32");
ArchSpec header_arch;
GetArchitecture(header_arch);
*s << ", file = '" << m_file << "', arch = " << header_arch.GetArchitectureName() << "\n";
```
We should update ObjectFileELF to do the same kind of thing and remove the filename from here.
================
Comment at: source/Commands/CommandObjectTarget.cpp:1569
@@ +1568,3 @@
+ strm.Printf("'%s':\n", objfile->GetFileSpec().GetCString());
+ strm.IndentMore();
+ objfile->Dump(&strm);
----------------
No need to indent more if we aren't printing anything.
================
Comment at: source/Commands/CommandObjectTarget.cpp:1571
@@ +1570,3 @@
+ objfile->Dump(&strm);
+ strm.IndentLess();
+ }
----------------
No need to indent less if we aren't printing anything.
http://reviews.llvm.org/D18464
More information about the lldb-commits
mailing list