diff --git a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp index 9c23dfdc8a..8c632529ec 100644 --- a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp +++ b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp @@ -201,6 +201,21 @@ TeamRow::TeamRow(team_id team) } +status_t +TeamRow::UpdateInfo(team_info& info) +{ + // Check if we need to rebuilt the row's fields because the team critical + // info (basically, app image running under that team ID) has changed + + if (info.argc != fTeamInfo.argc + || strncmp(info.args, fTeamInfo.args, sizeof(fTeamInfo.args)) != 0) { + return _SetTo(info); + } + + return B_OK; +} + + status_t TeamRow::_SetTo(team_info& info) { @@ -427,7 +442,10 @@ TeamsListView::_UpdateList() row = dynamic_cast(RowAt(index)); } - if (row == NULL || tmi.team != row->TeamID()) { + if (row != NULL && tmi.team == row->TeamID()) { + // The team image app could have change due after an exec*() call, + row->UpdateInfo(tmi); + } else if (row == NULL || tmi.team != row->TeamID()) { // Team not found in previously known teams list: insert a new row TeamRow* newRow = new(std::nothrow) TeamRow(tmi); if (newRow != NULL) { diff --git a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h index aca92ea107..3d715589b7 100644 --- a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h +++ b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h @@ -63,17 +63,19 @@ private: class TeamRow : public BRow { typedef BRow Inherited; public: - TeamRow(team_info & teamInfo); + TeamRow(team_info& teamInfo); TeamRow(team_id teamId); public: team_id TeamID() const { return fTeamInfo.team; } + status_t UpdateInfo(team_info& info); + virtual void SetEnabled(bool enabled) { fEnabled = enabled; } bool IsEnabled() const { return fEnabled; } private: - status_t _SetTo(team_info & info); + status_t _SetTo(team_info& info); private: bool fEnabled;