From 54154f3bf1ae3d2dfd68cc9474cad061b3338a40 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Thu, 6 Jun 2013 17:20:50 +0000 Subject: Teach llvm-objdump with the -macho parser how to use the data in code table from the LC_DATA_IN_CODE load command. And when disassembling print the data in code formatted for the kind of data it and not disassemble those bytes. I added the format specific functionality to the derived class MachOObjectFile since these tables only appears in Mach-O object files. This is my first attempt to modify the libObject stuff so if folks have better suggestions how to fit this in or suggestions on the implementation please let me know. rdar://11791371 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183424 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/macho-dump/macho-dump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/macho-dump') diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp index 88fd4529ab..897a785f41 100644 --- a/tools/macho-dump/macho-dump.cpp +++ b/tools/macho-dump/macho-dump.cpp @@ -292,7 +292,7 @@ DumpDataInCodeDataCommand(const MachOObjectFile &Obj, << " ('datasize', " << LLC.DataSize << ")\n" << " ('_data_regions', [\n"; - unsigned NumRegions = LLC.DataSize / 8; + unsigned NumRegions = LLC.DataSize / sizeof(macho::DataInCodeTableEntry); for (unsigned i = 0; i < NumRegions; ++i) { macho::DataInCodeTableEntry DICE = Obj.getDataInCodeTableEntry(LLC.DataOffset, i); -- cgit v1.2.3