Added new debugger message B_DEBUGGER_MESSAGE_TEAM_EXEC, sent when

exec*() has been called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27650 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-09-20 13:59:41 +00:00
parent 78b13af677
commit 4ed8088f9a
4 changed files with 31 additions and 0 deletions
+8
View File
@@ -166,6 +166,7 @@ typedef enum {
B_DEBUGGER_MESSAGE_TEAM_CREATED, // the debugged team created a new
// one
B_DEBUGGER_MESSAGE_TEAM_DELETED, // the debugged team is gone
B_DEBUGGER_MESSAGE_TEAM_EXEC, // the debugged team executes exec()
B_DEBUGGER_MESSAGE_THREAD_CREATED, // a thread has been created
B_DEBUGGER_MESSAGE_THREAD_DELETED, // a thread has been deleted
B_DEBUGGER_MESSAGE_IMAGE_CREATED, // an image has been created
@@ -510,6 +511,12 @@ typedef struct {
// (asynchronous message)
} debug_team_deleted;
// B_DEBUGGER_MESSAGE_TEAM_EXEC
typedef struct {
debug_origin origin;
} debug_team_exec;
// B_DEBUGGER_MESSAGE_THREAD_CREATED
typedef struct {
@@ -575,6 +582,7 @@ typedef union {
debug_exception_occurred exception_occurred;
debug_team_created team_created;
debug_team_deleted team_deleted;
debug_team_exec team_exec;
debug_thread_created thread_created;
debug_thread_deleted thread_deleted;
debug_image_created image_created;
+1
View File
@@ -195,6 +195,7 @@ bool user_debug_handle_signal(int signal, struct sigaction *handler,
void user_debug_stop_thread();
void user_debug_team_created(team_id teamID);
void user_debug_team_deleted(team_id teamID, port_id debuggerPort);
void user_debug_team_exec();
void user_debug_update_new_thread_flags(thread_id threadID);
void user_debug_thread_created(thread_id threadID);
void user_debug_thread_deleted(team_id teamID, thread_id threadID);
+20
View File
@@ -884,6 +884,26 @@ user_debug_team_deleted(team_id teamID, port_id debuggerPort)
}
void
user_debug_team_exec()
{
// check, if a debugger is installed and is interested in team creation
// events
struct thread *thread = thread_get_current_thread();
int32 teamDebugFlags = atomic_get(&thread->team->debug_info.flags);
if (~teamDebugFlags
& (B_TEAM_DEBUG_DEBUGGER_INSTALLED | B_TEAM_DEBUG_TEAM_CREATION)) {
return;
}
// prepare the message
debug_team_created message;
thread_hit_debug_event(B_DEBUGGER_MESSAGE_TEAM_EXEC, &message,
sizeof(message), true);
}
void
user_debug_update_new_thread_flags(thread_id threadID)
{
+2
View File
@@ -1363,6 +1363,8 @@ exec_team(const char *path, char**& _flatArgs, size_t flatArgsSize,
// permission.
update_set_id_user_and_group(team, path);
user_debug_team_exec();
status = team_create_thread_start(teamArgs);
// this one usually doesn't return...