New debug function wait_for_debugger(). Useful when creating teams to be debugged via fork().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11634 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,6 +27,7 @@ extern status_t install_default_debugger(port_id debuggerPort);
|
|||||||
extern port_id install_team_debugger(team_id team, port_id debuggerPort);
|
extern port_id install_team_debugger(team_id team, port_id debuggerPort);
|
||||||
extern status_t remove_team_debugger(team_id team);
|
extern status_t remove_team_debugger(team_id team);
|
||||||
extern status_t debug_thread(thread_id thread);
|
extern status_t debug_thread(thread_id thread);
|
||||||
|
extern void wait_for_debugger(void);
|
||||||
|
|
||||||
// team debugging flags
|
// team debugging flags
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -54,6 +54,22 @@ debug_thread(thread_id thread)
|
|||||||
return _kern_debug_thread(thread);
|
return _kern_debug_thread(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Suspends the thread until a debugger has been installed for this
|
||||||
|
* team.
|
||||||
|
*
|
||||||
|
* As soon as this happens (immediately, if a debugger is already installed)
|
||||||
|
* the thread stops for debugging. This is desirable for debuggers that spawn
|
||||||
|
* their debugged teams via fork() and want the child to wait till they have
|
||||||
|
* installed themselves as team debugger before continuing with exec*().
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
wait_for_debugger(void)
|
||||||
|
{
|
||||||
|
_kern_wait_for_debugger();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static const char *const sDebugWhyStrings[] = {
|
static const char *const sDebugWhyStrings[] = {
|
||||||
"Thread not running", // B_THREAD_NOT_RUNNING
|
"Thread not running", // B_THREAD_NOT_RUNNING
|
||||||
"Signal received", // B_SIGNAL_RECEIVED
|
"Signal received", // B_SIGNAL_RECEIVED
|
||||||
|
|||||||
Reference in New Issue
Block a user