aboutsummaryrefslogtreecommitdiffstats
path: root/tools/macho-dump
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-27 13:46:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-27 13:46:11 +0000
commitf2e2a5ff04e13720cec0c130c1d88d81d0ae6007 (patch)
treed8a06360956446e828600dd653fd69aa5ecdddc4 /tools/macho-dump
parent90e3e3a429e75a7d3671afcc30ed376b6186fd58 (diff)
downloadexternal_llvm-f2e2a5ff04e13720cec0c130c1d88d81d0ae6007.zip
external_llvm-f2e2a5ff04e13720cec0c130c1d88d81d0ae6007.tar.gz
external_llvm-f2e2a5ff04e13720cec0c130c1d88d81d0ae6007.tar.bz2
macho-dump: Add support for dumping string table data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/macho-dump')
-rw-r--r--tools/macho-dump/macho-dump.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp
index 274c41b..e2a8ef1 100644
--- a/tools/macho-dump/macho-dump.cpp
+++ b/tools/macho-dump/macho-dump.cpp
@@ -213,6 +213,14 @@ static int DumpSymtabCommand(MachOObject &Obj,
outs() << " ('stroff', " << SLC->StringTableOffset << ")\n";
outs() << " ('strsize', " << SLC->StringTableSize << ")\n";
+ // Cache the string table data.
+ Obj.RegisterStringTable(*SLC);
+
+ // Dump the string data.
+ outs() << " ('_string_data', '";
+ outs().write_escaped(Obj.getStringTableData(),
+ /*UseHexEscapes=*/true) << "')\n";
+
return 0;
}