Skip to content

Select parse-live's events in one place for this Mac and pymobiledevice3 - #53

Merged
doronz88 merged 2 commits into
mainfrom
parse-live-selection
Oct 20, 2026
Merged

doronz88 merged 2 commits into
mainfrom
parse-live-selection

Conversation

@doronz88

Copy link
Copy Markdown
Collaborator

Makes this Mac's parse-live and pymobiledevice3's parse-live (a device) select events with one implementation, so the two can't drift apart. They already had: 1.7.0's --fs lacked the guarded opens pymobiledevice3 prints, and it had no --xpc/--dispatch/--runloop and a different events.

pykdebugparser.selection (moved from pymobiledevice3):

  • parse_live_selection(bsc=, class_filters=, subclass_filters=, syscalls=, events=, groups=, dyld=) returns the classes, subclasses and ids the options select. Everything adds up.
  • captured_events(selection) returns the names parse-live prints for a selection: the ones selected by id, plus the decoded events of the selected classes and subclasses.
  • GROUPS and GROUP_HELP hold every group and its option help.

trace_codes:

  • --fs gains guarded_open_np and guarded_open_dprotected_np, which SQLite opens its databases, journals and shared memory with.
  • New: EVENT_GROUP_PREFIXES, group_events and parsed_events.

CLI: parse-live gains --xpc, --dispatch and --runloop, and its selection options and help match pymobiledevice3's. events [TEXT] now takes the same options and lists what parse-live prints with them, replacing syscalls --group the same way pymobiledevice3 did:

$ pykdebugparser events --fs guarded
BSC_guarded_open_dprotected_np
BSC_guarded_open_np
$ pykdebugparser events --xpc send_message
XPC_connection_send_message
XPC_connection_send_message_with_reply
XPC_connection_send_message_with_reply_sync

Checked:

  • Across 20 option sets (every group alone, all groups together, --bsc, --dyld, -s, -e, -cf 0x29, -sf 0x40c, and a mix), this selection and pymobiledevice3's current one give identical classes, subclasses, ids and captured_events.
  • Live on this Mac, parse-live --xpc prints libxpc events (XPC_connection_send_message, ...).
  • Tests: 246 pass on 3.9, 3.14 and 3.15, and each commit passes on its own.

pymobiledevice3 will import all of this once it's released.

Move pymobiledevice3's parse-live selection here, so this Mac's parse-live and a device's select the same events the same way: `parse_live_selection` (the classes, subclasses and ids its options select, adding up), `captured_events` (the names it prints for them), the user space event groups (`--xpc`, `--dispatch`, `--runloop`, by trace code name prefix), and the help of each group. `--fs` gains the guarded opens (guarded_open_np, guarded_open_dprotected_np), which SQLite opens its databases, journals and shared memory with, as pymobiledevice3's already does.
…ce3's

parse-live gains --xpc, --dispatch and --runloop, and its selection options and their help are pymobiledevice3's. `events` takes the same options and lists the events parse-live prints with them (`events --fs`, `events -s open`), or finds a name (`events dlsym`), replacing `syscalls --group`, as pymobiledevice3 did.
@doronz88
doronz88 merged commit b199635 into main Oct 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant