| 1 |
""" |
| 2 |
LLDB AppKit formatters |
| 3 |
|
| 4 |
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 |
See https://llvm.org/LICENSE.txt for license information. |
| 6 |
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 |
""" |
| 8 |
import lldb |
| 9 |
import lldb.runtime.objc.objc_runtime |
| 10 |
import lldb.formatters.Logger |
| 11 |
|
| 12 |
|
| 13 |
def Class_Summary(valobj, dict): |
| 14 |
logger = lldb.formatters.Logger.Logger() |
| 15 |
runtime = lldb.runtime.objc.objc_runtime.ObjCRuntime.runtime_from_isa( |
| 16 |
valobj) |
| 17 |
if runtime is None or not runtime.is_valid(): |
| 18 |
return '<error: unknown Class>' |
| 19 |
class_data = runtime.read_class_data() |
| 20 |
if class_data is None or not class_data.is_valid(): |
| 21 |
return '<error: unknown Class>' |
| 22 |
return class_data.class_name() |