Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Handle debugger stop event with SoftDebuggerSession.TargetEvent #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akihikodaki
Copy link
Contributor

The debugger does not listen to some events fired by SoftDebuggerSession, and may miss a stop event, which resumes command line processing, and lead to hangup.

SoftDebuggerSession.TargetEvent handles all events and eliminates possibility to introduce a hangup also in the future.

@alexrp
Copy link
Contributor

alexrp commented Oct 1, 2019

Just out of curiosity, which exact event(s) were we missing?

@akihikodaki
Copy link
Contributor Author

TargetSignaled is a stop event but was not listened by sdb.

@alexrp
Copy link
Contributor

alexrp commented Oct 10, 2019

Hmm. It seems to me that we would want to let the user know if such an event occurred, similar to how we say Inferior process suspended, Inferior process interrupted, etc. So I would suggest attaching an event to TargetSignaled (assuming that's exposed in the API) like so:

                _session.TargetSignaled += (sender, e) =>
                {
                    // maybe log the signal name/id as well, if available through the API on `e`?
                    Log.Notice("Inferior process '{0}' ('{1}') signaled",
                               ActiveProcess.Id, StringizeTarget());
                };

src/Debugger.cs Outdated Show resolved Hide resolved
The debugger does not listen to some events fired by SoftDebuggerSession,
and may miss a stop event, which resumes command line processing, and lead
to hangup.

SoftDebuggerSession.TargetEvent handles all events and eliminates
possibility to introduce a hangup also in the future.
@akihikodaki
Copy link
Contributor Author

Hmm. It seems to me that we would want to let the user know if such an event occurred, similar to how we say Inferior process suspended, Inferior process interrupted, etc. So I would suggest attaching an event to TargetSignaled (assuming that's exposed in the API) like so:

                _session.TargetSignaled += (sender, e) =>
                {
                    // maybe log the signal name/id as well, if available through the API on `e`?
                    Log.Notice("Inferior process '{0}' ('{1}') signaled",
                               ActiveProcess.Id, StringizeTarget());
                };

I think that would be nice. I suppose it requires another pull request.

Base automatically changed from master to main March 1, 2021 15:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants