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:
Jim Ingham
2011-03-11 03:53:59 +00:00
parent f17b0031f3
commit 9575d8446c
9 changed files with 1379 additions and 25 deletions

View File

@@ -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);
}
}
}