hilda 3.2.2__py3-none-any.whl → 3.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hilda/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '3.2.2'
32
- __version_tuple__ = version_tuple = (3, 2, 2)
31
+ __version__ = version = '3.4.0'
32
+ __version_tuple__ = version_tuple = (3, 4, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
hilda/launch_lldb.py CHANGED
@@ -61,14 +61,6 @@ class LLDBListenerThread(Thread, ABC):
61
61
  sys.stderr.write(stderr)
62
62
  stderr = self.process.GetSTDERR(1024)
63
63
 
64
- def _process_potential_watchpoint_event(self) -> None:
65
- stopped_threads = self._get_stopped_threads(lldb.eStopReasonWatchpoint)
66
- for thread in stopped_threads:
67
- watchpoint_id = thread.GetStopReasonDataAtIndex(0)
68
- frame = thread.GetFrameAtIndex(0)
69
- if lldb.hilda_client is not None:
70
- lldb.hilda_client.watchpoints._dispatch_watchpoint_callback(watchpoint_id, thread, frame)
71
-
72
64
  def _get_stopped_threads(self, reason: Optional[int] = None) -> list[lldb.SBThread]:
73
65
  if reason is None:
74
66
  stop_reasons = [
@@ -115,7 +107,6 @@ class LLDBListenerThread(Thread, ABC):
115
107
  elif state == lldb.eStateStopped and last_state == lldb.eStateRunning:
116
108
  logger.debug('Process Stopped')
117
109
  self._set_selected_thread_to_stopped_thread()
118
- self._process_potential_watchpoint_event()
119
110
 
120
111
  last_state = state
121
112
 
@@ -3,6 +3,7 @@ import time
3
3
  from collections import UserList, namedtuple
4
4
  from dataclasses import dataclass, field
5
5
  from functools import partial
6
+ from pathlib import Path
6
7
  from typing import Any, Optional
7
8
 
8
9
  from objc_types_decoder.decode import decode as decode_type
@@ -296,6 +297,11 @@ class Class:
296
297
  yield sup
297
298
  sup = sup.super
298
299
 
300
+ @property
301
+ def bundle_path(self) -> Path:
302
+ return Path(self._client.symbols.objc_getClass('NSBundle')
303
+ .objc_call('bundleForClass:', self._class_object).objc_call('bundlePath').py())
304
+
299
305
  def _load_class_data(self, data: dict):
300
306
  self._class_object = self._client.symbol(data['address'])
301
307
  self.super = Class(self._client, data['super']) if data['super'] else None
@@ -6,7 +6,9 @@ from hilda.snippets.macho.apple_version import version_t
6
6
  from hilda.symbol import SymbolFormatField
7
7
 
8
8
  # See: https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/mach-o/loader.h
9
+ # And: https://github.com/blacktop/go-macho/blob/master/types/commands.go
9
10
  LC_REQ_DYLD = 0x80000000
11
+ LC_SEP = 0x8000000
10
12
 
11
13
  LOAD_COMMAND_TYPE = Enum(Int32ul,
12
14
  LC_SEGMENT=0x1,
@@ -62,7 +64,12 @@ LOAD_COMMAND_TYPE = Enum(Int32ul,
62
64
  LC_BUILD_VERSION=0x32,
63
65
  LC_DYLD_EXPORTS_TRIE=(0x33 | LC_REQ_DYLD),
64
66
  LC_DYLD_CHAINED_FIXUPS=(0x34 | LC_REQ_DYLD),
65
- LC_FILESET_ENTRY=(0x35 | LC_REQ_DYLD)
67
+ LC_FILESET_ENTRY=(0x35 | LC_REQ_DYLD),
68
+ LC_ATOM_INFO=0x36,
69
+ LC_FUNCTION_VARIANTS=0x37,
70
+ LC_FUNCTION_VARIANT_FIXUPS=0x38,
71
+ LC_TARGET_TRIPLE=0x39,
72
+ LC_SEP_CACHE_SLIDE=(0x1 | LC_SEP)
66
73
  )
67
74
 
68
75
 
hilda/symbols.py CHANGED
@@ -277,12 +277,6 @@ class SymbolList:
277
277
  -> Optional[Tuple[lldb.SBSymbol, lldb.SBAddress, str, int, int]]:
278
278
  lldb_symbol_context_list = list(self._hilda.target.FindSymbols(name))
279
279
 
280
- for lldb_symbol_context in list(lldb_symbol_context_list):
281
- # Verify because FindSymbols finds `_Z3foov` when looking for `foo`
282
- if lldb_symbol_context.symbol.name != name:
283
- lldb_symbol_context_list.remove(lldb_symbol_context)
284
- self._hilda.log_debug(f'Ignoring symbol {lldb_symbol_context.symbol.name} (similar to {name})')
285
-
286
280
  if address is not None:
287
281
  for lldb_symbol_context in list(lldb_symbol_context_list):
288
282
  lldb_symbol_context_address = lldb_symbol_context.symbol.GetStartAddress().GetLoadAddress(
hilda/watchpoints.py CHANGED
@@ -51,6 +51,9 @@ class HildaWatchpoint:
51
51
  @callback.setter
52
52
  def callback(self, callback: Optional[Callable]) -> None:
53
53
  self._callback = callback
54
+ # TODO: Figure out a way to add set this callback programmatically
55
+ self._hilda.lldb_handle_command(f'watchpoint command add -F '
56
+ f'lldb.hilda_client.watchpoints._dispatch_watchpoint_callback {self.id}')
54
57
 
55
58
  @property
56
59
  def condition(self) -> Optional[str]:
@@ -256,10 +259,11 @@ class WatchpointList:
256
259
  """
257
260
  return (wp for wp in self)
258
261
 
259
- def _dispatch_watchpoint_callback(self, watchpoint_id: int, _, frame) -> None:
262
+ def _dispatch_watchpoint_callback(self, frame, wp, internal_dict) -> None:
260
263
  """
261
264
  Route the watchpoint callback the specific watchpoint callback.
262
265
  """
266
+ watchpoint_id = wp.GetID()
263
267
  self._hilda._bp_frame = frame
264
268
  try:
265
269
  callback = self[watchpoint_id].callback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hilda
3
- Version: 3.2.2
3
+ Version: 3.4.0
4
4
  Summary: LLDB wrapped and empowered by iPython's features
5
5
  Author-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>, netanel cohen <netanelc305@protonmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>, netanel cohen <netanelc305@protonmail.com>
@@ -3,22 +3,22 @@ gifs/ui.png,sha256=iaRwNZ9qVWUkUe2TJb_6VPsTu--7HrElA2duWiyZ-Oc,131
3
3
  gifs/xpc_print_message.gif,sha256=i5S8Y9bJm9n-NtOipFTAC8_jUR4uZCM4sOap_ccJX0k,939935
4
4
  hilda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  hilda/__main__.py,sha256=KWRqvukK4wraxCMtvH5nO25mFXLO5aWXa7z_VfAtbO8,90
6
- hilda/_version.py,sha256=QIEiYXjgAlMLkUBimfbmVOGJ1FhUIx7TOOWw24foJoc,704
6
+ hilda/_version.py,sha256=iSsABihaAQ9Jm5ICyagHKs2lYXoXgqxui0O-1H1RMZ8,704
7
7
  hilda/breakpoints.py,sha256=EVeY589ZIz1DwW3kGn-MpvjVrma1ANAjWz4DdRW8T4c,20025
8
8
  hilda/cli.py,sha256=PCjrI7GrERIrZCODJYmPt6eyl-nPYZviTS8fBG3oIjM,3618
9
9
  hilda/common.py,sha256=El-ih7cvCv9PJ5OWb1jkCbh4GuaRD6gqlrFC5gyY-TE,498
10
10
  hilda/decorators.py,sha256=uD8amDLgOpNLF90KhRVd1OkssYqh1UR7e0zemyIKcqc,963
11
11
  hilda/exceptions.py,sha256=GMJVc_zbzqVyieL45GJNJ-SutoTJefvNX2UInM8OgqE,1882
12
12
  hilda/hilda_client.py,sha256=TZCUGCATh8x8yDROke2Yr3Xx7OqfzsyWrDH6EkmLyfk,37169
13
- hilda/launch_lldb.py,sha256=-lmxif-w53oeTCea6ZHLiYHChkMpdDDO_zgTFWpAU6E,8597
13
+ hilda/launch_lldb.py,sha256=n9q_o70Nd04d8CNY4xUw8QDXNpsjX6tIwx1V7FWPkAs,8098
14
14
  hilda/lldb_entrypoint.py,sha256=vTiClzfiTtjorlxEfIsI-W657KEGobx74qDhaZ8nPhM,1007
15
15
  hilda/lldb_importer.py,sha256=TCGpAWwiBuyNRsbgcYawiqm35t8XQLCJwoOfEqyBeik,526
16
- hilda/objective_c_class.py,sha256=RCxvLSE8lzj94EYjGCd1gZsy8d23w7rT1RH-Kw4ftGc,13363
16
+ hilda/objective_c_class.py,sha256=t4Nb1VZGVpdqU_oaYtiNdTvwILmdt_CHjrMWTQiP0sA,13605
17
17
  hilda/objective_c_symbol.py,sha256=vPzRP8pucjsgJIj39CaM5ybf10nOqHV2E9hFMDTb6pc,8030
18
18
  hilda/registers.py,sha256=-9kk1MuKnWlJ0Z8zZ2RPV9nGRDtX1GXhCSkEvfnCktA,848
19
19
  hilda/symbol.py,sha256=QZilOrnc7TdexrZKZamY-9PKxt_G2dKEEFtQTBrUjMs,8859
20
- hilda/symbols.py,sha256=TE3VgLYeAvDguAosT3C2YUl1H5t2FpfMWhr6YpuXfPA,23335
21
- hilda/watchpoints.py,sha256=aYa0zpz8N718sOsTS4FFoSRcsHdjkzIqo5flej96R24,9009
20
+ hilda/symbols.py,sha256=JHMq994RiVlJZSiv4wB4bFKYvGaOGq9XsjgUB0vQQcI,22950
21
+ hilda/watchpoints.py,sha256=kicuGT2RhJ_PfV9obl3Ov534rvMZQcoHLsT8YnmP_XU,9299
22
22
  hilda/ipython_extensions/events.py,sha256=zJvPsdFT3th4BwG9xm0u7GRnDOXpVbF6n9IC2ixv86k,1682
23
23
  hilda/ipython_extensions/keybindings.py,sha256=W_Cnh8lG5yVdK5x0A-4UeyBsoJBufbYl54Mqrbo8OwM,1922
24
24
  hilda/ipython_extensions/magics.py,sha256=ULb63-OyIaWwvSfwRvEG_65ibaI2RTxeX8yPJK8pbc0,1300
@@ -45,13 +45,13 @@ hilda/snippets/macho/all_image_infos.py,sha256=dwuf4vhewP1EvtcCa65IIVqWyDeFYxoBc
45
45
  hilda/snippets/macho/apple_version.py,sha256=TTaqZKMviXJoU1o3OYeUskmxSkhVhh3UG1VbdJ6N-LE,148
46
46
  hilda/snippets/macho/image_info.py,sha256=Onu6u61TwFOwAfENpZIQA9N-Ba3b_M0gr8r6THNdIR4,1605
47
47
  hilda/snippets/macho/macho.py,sha256=X4NQZkO7VCcIMNuPs25ukiBrHM5Kj3UPMJzzeILfuyg,839
48
- hilda/snippets/macho/macho_load_commands.py,sha256=vUWfFM2H6o8dMglXV7rHgh-EMTzS0IgbjO8v8_5o8Mw,10624
48
+ hilda/snippets/macho/macho_load_commands.py,sha256=rlYHiPGUMpjpTkhI89twarufx7W880CYwWiYadGwb6w,10979
49
49
  hilda/ui/colors.json,sha256=f-ITquY3IInQreviTy23JfmxfJrGM1_MivACf1GKGqM,262
50
50
  hilda/ui/ui_manager.py,sha256=BmzI1sBx0PYCQDlB9Al7wsTEAMJxaJ7NW0DS4C7g5-0,2265
51
51
  hilda/ui/views.py,sha256=bzClOgKirKYs6nhsNRXpkGNIg3oIOmFb659GLWrlTdo,7792
52
- hilda-3.2.2.dist-info/licenses/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
53
- hilda-3.2.2.dist-info/METADATA,sha256=W-4rck5saeKhd1se_u46DubCVqVt9NkKFA5DiUTKF_0,21695
54
- hilda-3.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- hilda-3.2.2.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
56
- hilda-3.2.2.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
57
- hilda-3.2.2.dist-info/RECORD,,
52
+ hilda-3.4.0.dist-info/licenses/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
53
+ hilda-3.4.0.dist-info/METADATA,sha256=0B0vtMTePDPCyrPjXQIez3xVHP_i2xTfbbQMVEi0rIc,21695
54
+ hilda-3.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
+ hilda-3.4.0.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
56
+ hilda-3.4.0.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
57
+ hilda-3.4.0.dist-info/RECORD,,
File without changes