Debugger: Fix handling of team_id clashes.

TeamDebugger:
- Add accessor to query whether the debugger's interface is a post mortem core
  rather than a live team.

TargetHostInterface:
- When asked to locate a team debugger by team_id, as is done for attach
  requests to determine if we already have an existing instance attached, skip
  over post mortems. This takes care of the potential problem of detecting a
  core instance with the same team_id as a live team, and consequently refusing
  the attach request.
- When a team debugger quits, use its actual pointer to look it up rather than its
  team ID, as we could otherwise potentially remove the wrong one in the case of a
  clash.
This commit is contained in:
Rene Gollent
2016-04-25 21:49:46 -04:00
parent 2c4195e840
commit 61f0bf59fb
4 changed files with 18 additions and 19 deletions
@@ -218,6 +218,7 @@ TeamDebugger::TeamDebugger(Listener* listener, UserInterface* userInterface,
fSettingsManager(settingsManager),
fTeam(NULL),
fTeamID(-1),
fIsPostMortem(false),
fImageHandlers(NULL),
fImageInfoPendingThreads(NULL),
fDebuggerInterface(NULL),
@@ -337,6 +338,7 @@ TeamDebugger::Init(DebuggerInterface* interface, thread_id threadID, int argc,
fDebuggerInterface = interface;
fDebuggerInterface->AcquireReference();
fTeamID = interface->TeamID();
fIsPostMortem = interface->IsPostMortem();
// create file manager