From 05d98101be018dfc4c431c90fceedda934f94255 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 30 May 2013 21:10:11 -0400 Subject: [PATCH] DebuggerInterface: reset port IDs on Close()... ...and add accessor to detect whether we currently have a valid connection or not. --- src/apps/debugger/debugger_interface/DebuggerInterface.cpp | 3 +++ src/apps/debugger/debugger_interface/DebuggerInterface.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index 49a1a02abf..d641f2435b 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -316,6 +316,9 @@ DebuggerInterface::Close(bool killTeam) if (fDebuggerPort >= 0) delete_port(fDebuggerPort); + + fNubPort = -1; + fDebuggerPort = -1; } diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.h b/src/apps/debugger/debugger_interface/DebuggerInterface.h index b4b32841ff..def878efff 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.h @@ -38,6 +38,9 @@ public: status_t Init(); void Close(bool killTeam); + bool Connected() const + { return fNubPort >= 0; } + Architecture* GetArchitecture() const { return fArchitecture; }