From: Justin Bogner Date: Wed, 28 May 2014 05:45:17 +0000 (+0000) Subject: utils: Teach lldbDataFormatters to load automatically X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc30fbf7b6c45715e2b78be6f30455813ca9c075;p=platform%2Fupstream%2Fllvm.git utils: Teach lldbDataFormatters to load automatically Add an __lldb_init_module function so that importing the lldbDataFormatters script automatically adds the formatters. llvm-svn: 209712 --- diff --git a/llvm/utils/lldbDataFormatters.py b/llvm/utils/lldbDataFormatters.py index 1baf398..352448d 100644 --- a/llvm/utils/lldbDataFormatters.py +++ b/llvm/utils/lldbDataFormatters.py @@ -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):