* team::args is now correctly filled in.
* the member will now also be shown when dumping a team. * minor cleanup: moved fill_team_info() into the private functions part of the file. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19551 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+50
-32
@@ -84,6 +84,7 @@ _dump_team_info(struct team *team)
|
|||||||
kprintf("TEAM: %p\n", team);
|
kprintf("TEAM: %p\n", team);
|
||||||
kprintf("id: 0x%lx\n", team->id);
|
kprintf("id: 0x%lx\n", team->id);
|
||||||
kprintf("name: '%s'\n", team->name);
|
kprintf("name: '%s'\n", team->name);
|
||||||
|
kprintf("args: '%s'\n", team->args);
|
||||||
kprintf("next: %p\n", team->next);
|
kprintf("next: %p\n", team->next);
|
||||||
kprintf("parent: %p", team->parent);
|
kprintf("parent: %p", team->parent);
|
||||||
if (team->parent != NULL) {
|
if (team->parent != NULL) {
|
||||||
@@ -781,8 +782,25 @@ team_create_thread_start(void *args)
|
|||||||
|
|
||||||
TRACE(("team_create_thread_start: loading elf binary '%s'\n", path));
|
TRACE(("team_create_thread_start: loading elf binary '%s'\n", path));
|
||||||
|
|
||||||
// TODO: add args
|
// add args to info member
|
||||||
strlcpy(team->args, path, sizeof(team->args));
|
sizeLeft = strlcpy(team->args, path, sizeof(team->args));
|
||||||
|
udest = team->args + sizeLeft;
|
||||||
|
sizeLeft = sizeof(team->args) - sizeLeft;
|
||||||
|
|
||||||
|
for (i = 1; i < argCount && sizeLeft > 2; i++) {
|
||||||
|
size_t length;
|
||||||
|
|
||||||
|
udest[0] = ' ';
|
||||||
|
udest++;
|
||||||
|
sizeLeft--;
|
||||||
|
|
||||||
|
length = strlcpy(udest, teamArgs->args[i], sizeLeft);
|
||||||
|
if (length >= sizeLeft)
|
||||||
|
break;
|
||||||
|
|
||||||
|
sizeLeft -= length;
|
||||||
|
udest += length;
|
||||||
|
}
|
||||||
|
|
||||||
free_team_arg(teamArgs);
|
free_team_arg(teamArgs);
|
||||||
// the arguments are already on the user stack, we no longer need them in this form
|
// the arguments are already on the user stack, we no longer need them in this form
|
||||||
@@ -1456,6 +1474,36 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Fills the team_info structure with information from the specified
|
||||||
|
* team.
|
||||||
|
* The team lock must be held when called.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
fill_team_info(struct team *team, team_info *info, size_t size)
|
||||||
|
{
|
||||||
|
if (size != sizeof(team_info))
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
// ToDo: Set more informations for team_info
|
||||||
|
memset(info, 0, size);
|
||||||
|
|
||||||
|
info->team = team->id;
|
||||||
|
info->thread_count = team->num_threads;
|
||||||
|
info->image_count = count_images(team);
|
||||||
|
//info->area_count =
|
||||||
|
info->debugger_nub_thread = team->debug_info.nub_thread;
|
||||||
|
info->debugger_nub_port = team->debug_info.nub_port;
|
||||||
|
//info->uid =
|
||||||
|
//info->gid =
|
||||||
|
|
||||||
|
strlcpy(info->args, team->args, sizeof(info->args));
|
||||||
|
info->argc = 1;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Private kernel API
|
// #pragma mark - Private kernel API
|
||||||
|
|
||||||
|
|
||||||
@@ -1959,36 +2007,6 @@ kill_team(team_id id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Fills the team_info structure with information from the specified
|
|
||||||
* team.
|
|
||||||
* The team lock must be held when called.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static status_t
|
|
||||||
fill_team_info(struct team *team, team_info *info, size_t size)
|
|
||||||
{
|
|
||||||
if (size != sizeof(team_info))
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
|
|
||||||
// ToDo: Set more informations for team_info
|
|
||||||
memset(info, 0, size);
|
|
||||||
|
|
||||||
info->team = team->id;
|
|
||||||
info->thread_count = team->num_threads;
|
|
||||||
info->image_count = count_images(team);
|
|
||||||
//info->area_count =
|
|
||||||
info->debugger_nub_thread = team->debug_info.nub_thread;
|
|
||||||
info->debugger_nub_port = team->debug_info.nub_port;
|
|
||||||
//info->uid =
|
|
||||||
//info->gid =
|
|
||||||
|
|
||||||
strlcpy(info->args, team->args, sizeof(info->args));
|
|
||||||
info->argc = 1;
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
_get_team_info(team_id id, team_info *info, size_t size)
|
_get_team_info(team_id id, team_info *info, size_t size)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user