Skip to content

Commit

Permalink
DarwinProcess: fix backtraces
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Oct 23, 2023
1 parent 1ee193a commit d431b00
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rpcclient/rpcclient/darwin/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ class Backtrace:

def __init__(self, vmu_backtrace: DarwinSymbol):
backtrace = vmu_backtrace.objc_call('description').py()
match = re.match(r'VMUBacktrace \(Flavor: (?P<flavor>.+?) Simple Time: (?P<time_start>.+?) - (?P<time_end>.+?) '
match = re.match(r'VMUBacktrace \(Flavor: (?P<flavor>.+?) Simple Time: (?P<time>.+?) '
r'Process: (?P<pid>\d+) Thread: (?P<thread_id>.+?) Dispatch queue serial num: '
r'(?P<dispatch_queue_serial_num>\d+)\)', backtrace)
self.flavor = match.group('flavor')
self.time_start = float(match.group('time_start'))
self.time_end = float(match.group('time_end'))
self.pid = int(match.group('pid'))
self.thread_id = int(match.group('thread_id'), 16)
self.dispatch_queue_serial_num = int(match.group('dispatch_queue_serial_num'))
Expand Down Expand Up @@ -547,7 +545,9 @@ def task_all_info(self):
@property
def backtraces(self) -> List[Backtrace]:
result = []
for bt in self._client.symbols.objc_getClass('VMUSampler').objc_call('sampleAllThreadsOfTask:', self.task).py():
backtraces = self._client.symbols.objc_getClass('VMUSampler').objc_call('sampleAllThreadsOfTask:', self.task)
for i in range(backtraces.objc_call('count')):
bt = backtraces.objc_call('objectAtIndex:', i)
result.append(Backtrace(bt))
return result

Expand Down

0 comments on commit d431b00

Please sign in to comment.