mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Add a first pass at a "stop hook" mechanism. This allows you to add commands that get run every time the debugger stops, whether due to a breakpoint, the end of a step, interrupt, etc. You can also specify in which context you want the stop hook to run, for instance only on a particular thread, or only in a particular shared library, function, file, line range within a file.
Still need to add "in methods of a class" to the specifiers, and the ability to write the stop hooks in the Scripting language as well as in the Command Language. llvm-svn: 127457
This commit is contained in:
@@ -2256,11 +2256,12 @@ Process::HandlePrivateEvent (EventSP &event_sp)
|
||||
StateAsCString (GetState ()),
|
||||
IsHijackedForEvent(eBroadcastBitStateChanged) ? "hijacked" : "public");
|
||||
}
|
||||
Process::ProcessEventData::SetUpdateStateOnRemoval(event_sp.get());
|
||||
if (StateIsRunningState (new_state))
|
||||
PushProcessInputReader ();
|
||||
else
|
||||
PopProcessInputReader ();
|
||||
Process::ProcessEventData::SetUpdateStateOnRemoval(event_sp.get());
|
||||
|
||||
BroadcastEvent (event_sp);
|
||||
}
|
||||
else
|
||||
@@ -2431,6 +2432,15 @@ Process::ProcessEventData::DoOnRemoval (Event *event_ptr)
|
||||
|
||||
if (m_process_sp->GetPrivateState() == eStateRunning)
|
||||
SetRestarted(true);
|
||||
else
|
||||
{
|
||||
// Finally, if we didn't restart, run the Stop Hooks here:
|
||||
// They might also restart the target, so watch for that.
|
||||
m_process_sp->GetTarget().RunStopHooks();
|
||||
if (m_process_sp->GetPrivateState() == eStateRunning)
|
||||
SetRestarted(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user