xref: /llvm-project/lldb/examples/summaries/cocoa/Class.py (revision 247bd419ce4aaacec52220a5c8234456e069470c)
1"""
2LLDB AppKit formatters
3
4part of The LLVM Compiler Infrastructure
5This file is distributed under the University of Illinois Open Source
6License. See LICENSE.TXT for details.
7"""
8import lldb
9import objc_runtime
10import Logger
11
12def Class_Summary(valobj,dict):
13	logger = Logger.Logger()
14	runtime = objc_runtime.ObjCRuntime.runtime_from_isa(valobj)
15	if runtime == None or not runtime.is_valid():
16		return '<error: unknown Class>'
17	class_data = runtime.read_class_data()
18	if class_data == None or not class_data.is_valid():
19		return '<error: unknown Class>'
20	return class_data.class_name()
21
22