xref: /llvm-project/lldb/examples/summaries/cocoa/Selector.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2LLDB AppKit formatters
3
4Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5See https://llvm.org/LICENSE.txt for license information.
6SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7"""
8import lldb
9
10
11def SEL_Summary(valobj, dict):
12    return valobj.Cast(
13        valobj.GetType().GetBasicType(lldb.eBasicTypeChar).GetPointerType()
14    ).GetSummary()
15
16
17def SELPointer_Summary(valobj, dict):
18    return (
19        valobj.CreateValueFromAddress(
20            "text",
21            valobj.GetValueAsUnsigned(0),
22            valobj.GetType().GetBasicType(lldb.eBasicTypeChar),
23        )
24        .AddressOf()
25        .GetSummary()
26    )
27