Skip to content

Commit ec1e1ef

Browse files
committed
Add example to demangle_llvm python docs (skip-note, skip-ci)
1 parent 1dfe04d commit ec1e1ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/demangle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ def get_qualified_name(names: Iterable[str]):
4848

4949
def demangle_llvm(mangled_name: str, options: Optional[Union[bool, binaryview.BinaryView]] = None) -> Optional[List[str]]:
5050
"""
51-
``demangle_llvm`` demangles a mangled name to a Type object.
51+
``demangle_llvm`` demangles a mangled name using the LLVM demangler.
5252
5353
:param str mangled_name: a mangled (msvc/itanium/rust/dlang) name
5454
:param options: (optional) Whether to simplify demangled names : None falls back to user settings, a BinaryView uses that BinaryView's settings, or a boolean to set it directly
5555
:type options: Optional[Union[bool, BinaryView]]
5656
:return: returns demangled name or None on error
5757
:rtype: Optional[List[str]]
58+
:Example:
59+
60+
>>> demangle_llvm("?testf@Foobar@@SA?AW4foo@1@W421@@Z")
61+
['public: static enum Foobar::foo __cdecl Foobar::testf(enum Foobar::foo)']
62+
>>>
5863
"""
5964
outName = ctypes.POINTER(ctypes.c_char_p)()
6065
outSize = ctypes.c_ulonglong()

0 commit comments

Comments
 (0)