<s> """<STR_LIT>""" <EOL> import lldb <EOL> import ctypes <EOL> import lldb . runtime . objc . objc_runtime <EOL> import lldb . formatters . metrics <EOL> import lldb . formatters . Logger <EOL> statistics = lldb . formatters . metrics . Metrics ( ) <EOL> statistics . add_metric ( '<STR_LIT>' ) <EOL> statistics . add_metric ( '<STR_LIT>' ) <EOL> statistics . add_metric ( '<STR_LIT>' ) <EOL> statistics . add_metric ( '<STR_LIT>' ) <EOL> class NSMachPortKnown_SummaryProvider : <EOL> def adjust_for_architecture ( self ) : <EOL> pass <EOL> def __init__ ( self , valobj , params ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> self . valobj = valobj ; <EOL> self . sys_params = params <EOL> if not ( self . sys_params . types_cache . NSUInteger ) : <EOL> if self . sys_params . is_64_bit : <EOL> self . sys_params . types_cache . NSUInteger = self . valobj . GetType ( ) . GetBasicType ( lldb . eBasicTypeUnsignedLong ) <EOL> else : <EOL> self . sys_params . types_cache . NSUInteger = self . valobj . GetType ( ) . GetBasicType ( lldb . eBasicTypeUnsignedInt ) <EOL> self . update ( ) ; <EOL> def update ( self ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> self . adjust_for_architecture ( ) ; <EOL> def offset ( self ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> if self . sys_params . is_64_bit : <EOL> return <NUM_LIT:20> <EOL> else : <EOL> return <NUM_LIT:12> <EOL> def port ( self ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> vport = self . valobj . CreateChildAtOffset ( "<STR_LIT:port>" , <EOL> self . offset ( ) , <EOL> self . sys_params . types_cache . NSUInteger ) <EOL> return vport . GetValueAsUnsigned ( <NUM_LIT:0> ) <EOL> class NSMachPortUnknown_SummaryProvider : <EOL> def adjust_for_architecture ( self ) : <EOL> pass <EOL> def __init__ ( self , valobj , params ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> self . valobj = valobj ; <EOL> self . sys_params = params <EOL> self . update ( ) ; <EOL> def update ( self ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> self . adjust_for_architecture ( ) ; <EOL> def port ( self ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> stream = lldb . SBStream ( ) <EOL> self . valobj . GetExpressionPath ( stream ) <EOL> num_children_vo = self . valobj . CreateValueFromExpression ( "<STR_LIT:port>" , "<STR_LIT>" + stream . GetData ( ) + "<STR_LIT>" ) <EOL> if num_children_vo . IsValid ( ) : <EOL> return num_children_vo . GetValueAsUnsigned ( <NUM_LIT:0> ) <EOL> return '<STR_LIT>' <EOL> def GetSummary_Impl ( valobj ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> global statistics <EOL> class_data , wrapper = lldb . runtime . objc . objc_runtime . Utilities . prepare_class_detection ( valobj , statistics ) <EOL> if wrapper : <EOL> return wrapper <EOL> name_string = class_data . class_name ( ) <EOL> logger >> "<STR_LIT>" + str ( name_string ) <EOL> if name_string == '<STR_LIT>' : <EOL> wrapper = NSMachPortKnown_SummaryProvider ( valobj , class_data . sys_params ) <EOL> statistics . metric_hit ( '<STR_LIT>' , valobj ) <EOL> else : <EOL> wrapper = NSMachPortUnknown_SummaryProvider ( valobj , class_data . sys_params ) <EOL> statistics . metric_hit ( '<STR_LIT>' , valobj . GetName ( ) + "<STR_LIT>" + name_string ) <EOL> return wrapper ; <EOL> def NSMachPort_SummaryProvider ( valobj , dict ) : <EOL> logger = lldb . formatters . Logger . Logger ( ) <EOL> provider = GetSummary_Impl ( valobj ) ; <EOL> if provider != None : <EOL> if isinstance ( provider , lldb . runtime . objc . objc_runtime . SpecialSituation_Description ) : <EOL> return provider . message ( ) <EOL> try : <EOL> summary = provider . port ( ) ; <EOL> except : <EOL> summary = None <EOL> logger >> "<STR_LIT>" + str ( summary ) <EOL> if summary == None : <EOL> summary = '<STR_LIT>' <EOL> if isinstance ( summary , basestring ) : <EOL> return summay <EOL> return '<STR_LIT>' + str ( summary ) <EOL> return '<STR_LIT>' <EOL> def __lldb_init_module ( debugger , dict ) : <EOL> debugger . HandleCommand ( "<STR_LIT>" ) </s>
