hilda 2.0.8__py3-none-any.whl → 2.0.10__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 +2 -2
- hilda/cli.py +1 -1
- hilda/hilda_client.py +8 -1
- hilda/ipython_extensions/keybindings.py +1 -0
- hilda/launch_lldb.py +22 -0
- hilda/symbols_jar.py +4 -4
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/METADATA +1 -1
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/RECORD +12 -12
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/WHEEL +1 -1
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/LICENSE +0 -0
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/entry_points.txt +0 -0
- {hilda-2.0.8.dist-info → hilda-2.0.10.dist-info}/top_level.txt +0 -0
hilda/_version.py
CHANGED
hilda/cli.py
CHANGED
|
@@ -53,7 +53,7 @@ def attach(name: Optional[str], pid: Optional[int], startup_files: List[str]) ->
|
|
|
53
53
|
if name is not None:
|
|
54
54
|
hilda_client = create_hilda_client_using_attach_by_name(name)
|
|
55
55
|
elif pid is not None:
|
|
56
|
-
hilda_client = create_hilda_client_using_attach_by_pid(
|
|
56
|
+
hilda_client = create_hilda_client_using_attach_by_pid(pid)
|
|
57
57
|
else:
|
|
58
58
|
raise click.UsageError('You must specify a process name or pid')
|
|
59
59
|
hilda_client.interact(startup_files=startup_files)
|
hilda/hilda_client.py
CHANGED
|
@@ -58,7 +58,8 @@ GREETING = f"""
|
|
|
58
58
|
<b>Hilda has been successfully loaded! 😎
|
|
59
59
|
Usage:
|
|
60
60
|
<span style="color: magenta">p</span> Global to access all features.
|
|
61
|
-
<span style="color: magenta">F1</span> UI
|
|
61
|
+
<span style="color: magenta">F1</span> Show UI.
|
|
62
|
+
<span style="color: magenta">F2</span> Toggle enabling of stdout & stderr.
|
|
62
63
|
<span style="color: magenta">F7</span> Step Into.
|
|
63
64
|
<span style="color: magenta">F8</span> Step Over.
|
|
64
65
|
<span style="color: magenta">F9</span> Continue.
|
|
@@ -92,6 +93,8 @@ class Configs:
|
|
|
92
93
|
'doc': 'Whether to exclude NSObject during evaluation - reduce ipython autocomplete results.'})
|
|
93
94
|
objc_verbose_monitor: bool = field(default=False, metadata={
|
|
94
95
|
'doc': 'When set to True, using monitor() will automatically print objc methods arguments.'})
|
|
96
|
+
enable_stdout_stderr: bool = field(default=True, metadata={
|
|
97
|
+
'doc': 'When set to True, will enable process stdout and stderr.'})
|
|
95
98
|
|
|
96
99
|
def __repr__(self):
|
|
97
100
|
return self.__str__()
|
|
@@ -1089,6 +1092,10 @@ class HildaClient:
|
|
|
1089
1092
|
sys.argv = ['a']
|
|
1090
1093
|
IPython.start_ipython(config=ipython_config, user_ns=namespace)
|
|
1091
1094
|
|
|
1095
|
+
def toggle_enable_stdout_stderr(self, *args) -> None:
|
|
1096
|
+
self.configs.enable_stdout_stderr = not self.configs.enable_stdout_stderr
|
|
1097
|
+
self.logger.info(f'Changed stdout and stderr status to: {self.configs.enable_stdout_stderr}')
|
|
1098
|
+
|
|
1092
1099
|
def __enter__(self) -> 'HildaClient':
|
|
1093
1100
|
return self
|
|
1094
1101
|
|
|
@@ -7,6 +7,7 @@ def load_ipython_extension(ipython):
|
|
|
7
7
|
def register_keybindings():
|
|
8
8
|
hilda = ipython.user_ns['p']
|
|
9
9
|
keys_mapping = {Keys.F1: hilda.ui_manager.show,
|
|
10
|
+
Keys.F2: hilda.toggle_enable_stdout_stderr,
|
|
10
11
|
Keys.F7: hilda.step_into,
|
|
11
12
|
Keys.F8: hilda.step_over,
|
|
12
13
|
Keys.F9: lambda _: (hilda.log_info('Sending continue'), hilda.cont()),
|
hilda/launch_lldb.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
3
4
|
from abc import ABC, abstractmethod
|
|
4
5
|
from threading import Thread
|
|
5
6
|
from typing import List, Optional
|
|
@@ -46,6 +47,20 @@ class LLDBListenerThread(Thread, ABC):
|
|
|
46
47
|
return
|
|
47
48
|
raise LLDBError(self.error.description)
|
|
48
49
|
|
|
50
|
+
def _process_stdout(self) -> None:
|
|
51
|
+
stdout = self.process.GetSTDOUT(1024)
|
|
52
|
+
while stdout:
|
|
53
|
+
if lldb.hilda_client is not None and lldb.hilda_client.configs.enable_stdout_stderr:
|
|
54
|
+
sys.stdout.write(stdout)
|
|
55
|
+
stdout = self.process.GetSTDOUT(1024)
|
|
56
|
+
|
|
57
|
+
def _process_stderr(self) -> None:
|
|
58
|
+
stderr = self.process.GetSTDERR(1024)
|
|
59
|
+
while stderr:
|
|
60
|
+
if lldb.hilda_client is not None and lldb.hilda_client.configs.enable_stdout_stderr:
|
|
61
|
+
sys.stderr.write(stderr)
|
|
62
|
+
stderr = self.process.GetSTDERR(1024)
|
|
63
|
+
|
|
49
64
|
def run(self):
|
|
50
65
|
event = lldb.SBEvent()
|
|
51
66
|
last_state = lldb.eStateStopped
|
|
@@ -54,6 +69,13 @@ class LLDBListenerThread(Thread, ABC):
|
|
|
54
69
|
continue
|
|
55
70
|
if not lldb.SBProcess.EventIsProcessEvent(event):
|
|
56
71
|
continue
|
|
72
|
+
|
|
73
|
+
event_type = event.GetType()
|
|
74
|
+
if event_type & lldb.SBProcess.eBroadcastBitSTDOUT:
|
|
75
|
+
self._process_stdout()
|
|
76
|
+
if event_type & lldb.SBProcess.eBroadcastBitSTDERR:
|
|
77
|
+
self._process_stderr()
|
|
78
|
+
|
|
57
79
|
state = self.process.GetStateFromEvent(event)
|
|
58
80
|
if state == lldb.eStateDetached:
|
|
59
81
|
logger.debug('Process Detached')
|
hilda/symbols_jar.py
CHANGED
|
@@ -139,15 +139,15 @@ class SymbolsJar(dict):
|
|
|
139
139
|
:param args: given arguments for monitor command
|
|
140
140
|
"""
|
|
141
141
|
for name, address in self.items():
|
|
142
|
-
|
|
142
|
+
options = args.copy()
|
|
143
143
|
if name == '_client':
|
|
144
144
|
continue
|
|
145
145
|
if self.__dict__['_client'].configs.objc_verbose_monitor:
|
|
146
146
|
arg_count = name.count(':')
|
|
147
147
|
if arg_count > 0:
|
|
148
|
-
|
|
149
|
-
name =
|
|
150
|
-
address.monitor(name=name, **
|
|
148
|
+
options['expr'] = {f'$arg{i + 3}': 'po' for i in range(arg_count)}
|
|
149
|
+
name = options.get('name', name)
|
|
150
|
+
address.monitor(name=name, **options)
|
|
151
151
|
|
|
152
152
|
def startswith(self, exp, case_sensitive=True):
|
|
153
153
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hilda
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.10
|
|
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=
|
|
7
|
-
hilda/cli.py,sha256=
|
|
6
|
+
hilda/_version.py,sha256=XfZrt8N24KP9yItFv7wR2t90bVUZfPiQELu73iEDgLs,413
|
|
7
|
+
hilda/cli.py,sha256=1-COYHseHcWPhuNXaf-SbAOum_iW4WkAp3K_YGa2Ero,3624
|
|
8
8
|
hilda/common.py,sha256=VFtpOH9IRqbu6lONM6Hz-PxcdJfktgS3akJv5UCHO0s,523
|
|
9
9
|
hilda/exceptions.py,sha256=8L1OvOqns4O4ieiH4YlrMbZkk_PvuyCq4UyqFAodkF8,2042
|
|
10
10
|
hilda/hilda_ascii_art.html,sha256=-9YCjAKdGbjtdd6uoKrxkkcJq7j16r4dGka2bZ27b4o,120119
|
|
11
|
-
hilda/hilda_client.py,sha256=
|
|
12
|
-
hilda/launch_lldb.py,sha256=
|
|
11
|
+
hilda/hilda_client.py,sha256=q18etn3_zYbrCncZp60N2otQyb8mNOJ3fMxgGmeyIcQ,46902
|
|
12
|
+
hilda/launch_lldb.py,sha256=ziRQd1LUz8URcJdV1mjjUs09Uo6NeO4TZfENPhan-3g,8038
|
|
13
13
|
hilda/lldb_entrypoint.py,sha256=vTiClzfiTtjorlxEfIsI-W657KEGobx74qDhaZ8nPhM,1007
|
|
14
14
|
hilda/lldb_importer.py,sha256=LrIQnigDG3wgmIPXya67oBlWubkDgV-rEpzfWNEYCoc,553
|
|
15
15
|
hilda/objective_c_class.py,sha256=Xyw7FucNVcu8NqhB0Gy-OjaN_2DmCywn6pjUEwyd1Hk,11760
|
|
16
16
|
hilda/objective_c_symbol.py,sha256=VpNzVcfvbvZxX3x-7zh_20GZ_17akr1WsdpI4KRNgt4,8400
|
|
17
17
|
hilda/registers.py,sha256=moGS9MXrfm8vmnqDKWZSg4wmZNydGUadui9uwEwzhsI,856
|
|
18
18
|
hilda/symbol.py,sha256=_A-ivRttf7f1Fxclj23pC807r08GQ1KwHvEXnyw7FT4,7517
|
|
19
|
-
hilda/symbols_jar.py,sha256=
|
|
19
|
+
hilda/symbols_jar.py,sha256=0EmpqtdwNd8TsMolYBigtpVB7MEbKY4D9gnZLcWeytM,6454
|
|
20
20
|
hilda/ipython_extensions/events.py,sha256=w_4V8FoJJMarWArEE8uzb2UXk1mqfslmI7XCyVb_XuE,1976
|
|
21
|
-
hilda/ipython_extensions/keybindings.py,sha256=
|
|
21
|
+
hilda/ipython_extensions/keybindings.py,sha256=Ai9wHCla6HhgZGGxc0UEOCYODcavyef_zzUC9A9GcTE,1081
|
|
22
22
|
hilda/ipython_extensions/magics.py,sha256=ULb63-OyIaWwvSfwRvEG_65ibaI2RTxeX8yPJK8pbc0,1300
|
|
23
23
|
hilda/objective_c/from_ns_to_json.m,sha256=5Ddl0UJLQXlDYwR_yjE4yZk1aOsJGxoy1oRnhZHPrTw,2847
|
|
24
24
|
hilda/objective_c/get_objectivec_class_by_module.m,sha256=DC8S8XaWsQSOJZWVWhATr98SZQobA3MmclLsBJGZTcU,704
|
|
@@ -46,9 +46,9 @@ hilda/snippets/macho/macho_load_commands.py,sha256=OsajG2xWuRwhYhj9f-lnUiNe43Yum
|
|
|
46
46
|
hilda/ui/colors.json,sha256=f-ITquY3IInQreviTy23JfmxfJrGM1_MivACf1GKGqM,262
|
|
47
47
|
hilda/ui/ui_manager.py,sha256=BmzI1sBx0PYCQDlB9Al7wsTEAMJxaJ7NW0DS4C7g5-0,2265
|
|
48
48
|
hilda/ui/views.py,sha256=1u_eZzw7wAEP1bm_-9nkqgGhMSX__woiUuoBgnsAKVM,7843
|
|
49
|
-
hilda-2.0.
|
|
50
|
-
hilda-2.0.
|
|
51
|
-
hilda-2.0.
|
|
52
|
-
hilda-2.0.
|
|
53
|
-
hilda-2.0.
|
|
54
|
-
hilda-2.0.
|
|
49
|
+
hilda-2.0.10.dist-info/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
|
|
50
|
+
hilda-2.0.10.dist-info/METADATA,sha256=EJ3cjr6cGmjOeA9Gi8Cv4s6R0G3bslVtUBSll_YC1mw,23326
|
|
51
|
+
hilda-2.0.10.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
|
52
|
+
hilda-2.0.10.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
|
|
53
|
+
hilda-2.0.10.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
|
|
54
|
+
hilda-2.0.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|