How to register for events in lldb-21
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Prior to lldb-21, I was able to register for events for the target process prior to launch via the python API using `proc.GetBroadcaster().AddListener(listener, ALL_EVENTS)` where `proc = lldb.SBDebugger.FindDebuggerWithID(1).GetTargetAtIndex(0).GetProcess()`. With the advent of 21, `GetProcess()` now returns a pseudo-process with pid==0. The events returned to the listener include only module load events, and the `lldb.SBProcess.GetProcessFromEvent` from these events appears to be invalid.
I would re-register my listener when the process stops, but, given the above, I have no real event to trigger on. Is there a new way to register for these events? Also, I'd be very interested in the motivation behind the change.
Contributor guide
Research direction
Start with the LLDB Python API entry points named in the report—GetProcess(), GetBroadcaster().AddListener(), and SBProcess.GetProcessFromEvent—and compare their behavior before and in lldb-21. Determine the intended pre-launch event-registration path and document a reproducible answer and the motivation for the change; no file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100