macho-dump: Add support for dumping segment load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2010-11-27 08:22:29 +00:00
parent 35bf4d6d80
commit 4ba1f5e001
4 changed files with 168 additions and 3 deletions

View File

@@ -11,6 +11,7 @@
#define LLVM_OBJECT_MACHOOBJECT_H
#include <string>
#include "llvm/ADT/InMemoryStruct.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Object/MachOFormat.h"
@@ -88,6 +89,7 @@ public:
/// @{
bool isLittleEndian() const { return IsLittleEndian; }
bool isSwappedEndian() const { return IsSwappedEndian; }
bool is64Bit() const { return Is64Bit; }
unsigned getHeaderSize() const {
@@ -111,6 +113,13 @@ public:
/// \brief Retrieve the information for the given load command.
const LoadCommandInfo &getLoadCommandInfo(unsigned Index) const;
void ReadSegmentLoadCommand(
const LoadCommandInfo &LCI,
InMemoryStruct<macho::SegmentLoadCommand> &Res) const;
void ReadSegment64LoadCommand(
const LoadCommandInfo &LCI,
InMemoryStruct<macho::Segment64LoadCommand> &Res) const;
/// @}
};