[llvm] r209712 - utils: Teach lldbDataFormatters to load automatically
Justin Bogner
mail at justinbogner.com
Tue May 27 22:45:17 PDT 2014
Author: bogner
Date: Wed May 28 00:45:17 2014
New Revision: 209712
URL: http://llvm.org/viewvc/llvm-project?rev=209712&view=rev
Log:
utils: Teach lldbDataFormatters to load automatically
Add an __lldb_init_module function so that importing the
lldbDataFormatters script automatically adds the formatters.
Modified:
llvm/trunk/utils/lldbDataFormatters.py
Modified: llvm/trunk/utils/lldbDataFormatters.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lldbDataFormatters.py?rev=209712&r1=209711&r2=209712&view=diff
==============================================================================
--- llvm/trunk/utils/lldbDataFormatters.py (original)
+++ llvm/trunk/utils/lldbDataFormatters.py Wed May 28 00:45:17 2014
@@ -1,10 +1,18 @@
"""
-Load into LLDB with:
-script import lldbDataFormatters
-type synthetic add -x "^llvm::SmallVectorImpl<.+>$" -l lldbDataFormatters.SmallVectorSynthProvider
-type synthetic add -x "^llvm::SmallVector<.+,.+>$" -l lldbDataFormatters.SmallVectorSynthProvider
+LLDB Formatters for LLVM data types.
+
+Load into LLDB with 'command script import /path/to/lldbDataFormatters.py'
"""
+def __lldb_init_module(debugger, internal_dict):
+ debugger.HandleCommand('type category define -e llvm -l c++')
+ debugger.HandleCommand('type synthetic add -w llvm '
+ '-l lldbDataFormatters.SmallVectorSynthProvider '
+ '-x "^llvm::SmallVectorImpl<.+>$"')
+ debugger.HandleCommand('type synthetic add -w llvm '
+ '-l lldbDataFormatters.SmallVectorSynthProvider '
+ '-x "^llvm::SmallVector<.+,.+>$"')
+
# Pretty printer for llvm::SmallVector/llvm::SmallVectorImpl
class SmallVectorSynthProvider:
def __init__(self, valobj, dict):
More information about the llvm-commits
mailing list