summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-08-05 08:02:46 -0400
committerMason Reed <mason@vector35.com>2024-08-05 08:03:01 -0400
commitec1e1ef3b2355b7ccdb6b86448bb4608d89f3b5a (patch)
treea50984d7d06fb3ceb48e31b821316429e41c8611 /python
parent1dfe04d552dd8ff377abc2bdba7f16742bcd7bd9 (diff)
Add example to demangle_llvm python docs (skip-note, skip-ci)
Diffstat (limited to 'python')
-rw-r--r--python/demangle.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/demangle.py b/python/demangle.py
index 98513b9b..abc7ebf9 100644
--- a/python/demangle.py
+++ b/python/demangle.py
@@ -48,13 +48,18 @@ def get_qualified_name(names: Iterable[str]):
def demangle_llvm(mangled_name: str, options: Optional[Union[bool, binaryview.BinaryView]] = None) -> Optional[List[str]]:
"""
- ``demangle_llvm`` demangles a mangled name to a Type object.
+ ``demangle_llvm`` demangles a mangled name using the LLVM demangler.
:param str mangled_name: a mangled (msvc/itanium/rust/dlang) name
: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
:type options: Optional[Union[bool, BinaryView]]
:return: returns demangled name or None on error
:rtype: Optional[List[str]]
+ :Example:
+
+ >>> demangle_llvm("?testf@Foobar@@SA?AW4foo@1@W421@@Z")
+ ['public: static enum Foobar::foo __cdecl Foobar::testf(enum Foobar::foo)']
+ >>>
"""
outName = ctypes.POINTER(ctypes.c_char_p)()
outSize = ctypes.c_ulonglong()