diff options
author | Zachary Turner <zturner@google.com> | 2015-01-27 22:40:14 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-01-27 22:40:14 +0000 |
commit | 7058dfc6cca6436774b464cdeffe5f6235ea6e7a (patch) | |
tree | 9994f9fbd5bc6c6199192ca9ad8e51fa617adb0c /llvm/tools/llvm-pdbdump/COMExtras.h | |
parent | b1ca4e48d4e84243017c9df9dfac89a995ce000f (diff) | |
download | bcm5719-llvm-7058dfc6cca6436774b464cdeffe5f6235ea6e7a.tar.gz bcm5719-llvm-7058dfc6cca6436774b464cdeffe5f6235ea6e7a.zip |
Add support for dumping debug tables to llvm-pdbdump.
PDB stores some of its data in streams and some in tables.
This patch teaches llvm-pdbdump to dump basic summary data
for the debug tables.
In support of this, this patch also adds some DIA helper
classes, such as a wrapper around an IDiaSymbol interface,
as well as helpers for outputting various enumerations to
a raw_ostream.
llvm-svn: 227257
Diffstat (limited to 'llvm/tools/llvm-pdbdump/COMExtras.h')
-rw-r--r-- | llvm/tools/llvm-pdbdump/COMExtras.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbdump/COMExtras.h b/llvm/tools/llvm-pdbdump/COMExtras.h index 7a48ee5887d..913d179ce41 100644 --- a/llvm/tools/llvm-pdbdump/COMExtras.h +++ b/llvm/tools/llvm-pdbdump/COMExtras.h @@ -12,6 +12,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/ConvertUTF.h" #include <tuple> @@ -279,6 +280,14 @@ make_com_data_record_enumerator(CComPtr<EnumeratorType> Enumerator) { return com_data_record_enumerator<EnumeratorType>(Enumerator); } +inline bool BSTRToUTF8(BSTR String16, std::string &String8) { + UINT ByteLength = ::SysStringByteLen(String16); + char *Bytes = reinterpret_cast<char *>(String16); + String8.clear(); + return llvm::convertUTF16ToUTF8String(ArrayRef<char>(Bytes, ByteLength), + String8); +} + } // namespace windows } // namespace sys } // namespace llvm |