Skip to content

Commit

Permalink
Merge pull request #69 from doronz88/feature/symbolicate
Browse files Browse the repository at this point in the history
symbol: add `name` property
  • Loading branch information
doronz88 authored Jul 10, 2024
2 parents 2f379b9 + d15d6b0 commit 17cf2a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hilda/hilda_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,11 @@ def _monitor_format_value(self, fmt, value):
else:
return f'{value:x} (unsupported format)'

@cached_property
def _object_identifier(self) -> Symbol:
return self.symbols.objc_getClass('VMUObjectIdentifier').objc_call('alloc').objc_call(
'initWithTask:', self.symbols.mach_task_self())

@cached_property
def _ks(self) -> Optional['Ks']:
if not lldb.KEYSTONE_SUPPORT:
Expand Down
7 changes: 7 additions & 0 deletions hilda/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ def cf_description(self) -> str:
"""
return self._client.symbols.CFCopyDescription(self).po()

@property
def name(self) -> str:
symbol_info = int(self._client.po(f'[{self._client._object_identifier} symbolForAddress:{self}]', '__int128'))
arg1 = symbol_info & 0xffffffffffffffff
arg2 = symbol_info >> 64
return self._client.symbols.CSSymbolGetName(arg1, arg2).peek_str()

@contextmanager
def change_item_size(self, new_item_size: int) -> None:
"""
Expand Down

0 comments on commit 17cf2a2

Please sign in to comment.