[Haiku-commits] r31107 - in haiku/trunk/src/apps/debugger: . debugger_interface gui/team_window

bonefish at BerliOS bonefish at mail.berlios.de
Thu Jun 18 23:45:15 CEST 2009


Author: bonefish
Date: 2009-06-18 23:45:14 +0200 (Thu, 18 Jun 2009)
New Revision: 31107
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31107&view=rev

Modified:
   haiku/trunk/src/apps/debugger/MessageCodes.h
   haiku/trunk/src/apps/debugger/Team.cpp
   haiku/trunk/src/apps/debugger/Team.h
   haiku/trunk/src/apps/debugger/TeamDebugger.cpp
   haiku/trunk/src/apps/debugger/TeamDebugger.h
   haiku/trunk/src/apps/debugger/Thread.cpp
   haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
   haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.h
   haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
   haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h
Log:
* Added notifications for thread state/CPU state/stack trace changes. The team
  window listens for those and updates the buttons correctly.
* Added basic handling for the thread stopping debug events in the team
  debugger.
* Forward the thread run/stop/step requests to the team debugger and actually
  run/stop/step the thread. Running/stopping works, all three stepping actions
  just step by a single instruction ATM, though.


Modified: haiku/trunk/src/apps/debugger/MessageCodes.h
===================================================================
--- haiku/trunk/src/apps/debugger/MessageCodes.h	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/MessageCodes.h	2009-06-18 21:45:14 UTC (rev 31107)
@@ -7,10 +7,15 @@
 
 
 enum {
-	MSG_THREAD_RUN			= 'run_',
-	MSG_THREAD_STEP_OVER	= 'stov',
-	MSG_THREAD_STEP_INTO	= 'stin',
-	MSG_THREAD_STEP_OUT		= 'stou'
+	MSG_THREAD_RUN					= 'run_',
+	MSG_THREAD_STOP					= 'stop',
+	MSG_THREAD_STEP_OVER			= 'stov',
+	MSG_THREAD_STEP_INTO			= 'stin',
+	MSG_THREAD_STEP_OUT				= 'stou',
+
+	MSG_THREAD_STATE_CHANGED		= 'tsch',
+	MSG_THREAD_CPU_STATE_CHANGED	= 'tcsc',
+	MSG_THREAD_STACK_TRACE_CHANGED	= 'tstc'
 };
 
 

Modified: haiku/trunk/src/apps/debugger/Team.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/Team.cpp	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/Team.cpp	2009-06-18 21:45:14 UTC (rev 31107)
@@ -205,6 +205,39 @@
 
 
 void
+Team::NotifyThreadStateChanged(Thread* thread)
+{
+	for (ListenerList::Iterator it = fListeners.GetIterator();
+			Listener* listener = it.Next();) {
+		listener->ThreadStateChanged(
+			ThreadEvent(TEAM_EVENT_THREAD_STATE_CHANGED, thread));
+	}
+}
+
+
+void
+Team::NotifyThreadCpuStateChanged(Thread* thread)
+{
+	for (ListenerList::Iterator it = fListeners.GetIterator();
+			Listener* listener = it.Next();) {
+		listener->ThreadCpuStateChanged(
+			ThreadEvent(TEAM_EVENT_THREAD_CPU_STATE_CHANGED, thread));
+	}
+}
+
+
+void
+Team::NotifyThreadStackTraceChanged(Thread* thread)
+{
+	for (ListenerList::Iterator it = fListeners.GetIterator();
+			Listener* listener = it.Next();) {
+		listener->ThreadStackTraceChanged(
+			ThreadEvent(TEAM_EVENT_THREAD_STACK_TRACE_CHANGED, thread));
+	}
+}
+
+
+void
 Team::_NotifyThreadAdded(Thread* thread)
 {
 	for (ListenerList::Iterator it = fListeners.GetIterator();
@@ -307,3 +340,21 @@
 Team::Listener::ImageRemoved(const Team::ImageEvent& event)
 {
 }
+
+
+void
+Team::Listener::ThreadStateChanged(const Team::ThreadEvent& event)
+{
+}
+
+
+void
+Team::Listener::ThreadCpuStateChanged(const Team::ThreadEvent& event)
+{
+}
+
+
+void
+Team::Listener::ThreadStackTraceChanged(const Team::ThreadEvent& event)
+{
+}

Modified: haiku/trunk/src/apps/debugger/Team.h
===================================================================
--- haiku/trunk/src/apps/debugger/Team.h	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/Team.h	2009-06-18 21:45:14 UTC (rev 31107)
@@ -18,7 +18,11 @@
 	TEAM_EVENT_THREAD_ADDED,
 	TEAM_EVENT_THREAD_REMOVED,
 	TEAM_EVENT_IMAGE_ADDED,
-	TEAM_EVENT_IMAGE_REMOVED
+	TEAM_EVENT_IMAGE_REMOVED,
+
+	TEAM_EVENT_THREAD_STATE_CHANGED,
+	TEAM_EVENT_THREAD_CPU_STATE_CHANGED,
+	TEAM_EVENT_THREAD_STACK_TRACE_CHANGED
 };
 
 
@@ -59,6 +63,11 @@
 			void				AddListener(Listener* listener);
 			void				RemoveListener(Listener* listener);
 
+			// service methods for Thread
+			void				NotifyThreadStateChanged(Thread* thread);
+			void				NotifyThreadCpuStateChanged(Thread* thread);
+			void				NotifyThreadStackTraceChanged(Thread* thread);
+
 private:
 			typedef DoublyLinkedList<Listener> ListenerList;
 
@@ -121,6 +130,13 @@
 
 	virtual	void				ImageAdded(const Team::ImageEvent& event);
 	virtual	void				ImageRemoved(const Team::ImageEvent& event);
+
+	virtual	void				ThreadStateChanged(
+									const Team::ThreadEvent& event);
+	virtual	void				ThreadCpuStateChanged(
+									const Team::ThreadEvent& event);
+	virtual	void				ThreadStackTraceChanged(
+									const Team::ThreadEvent& event);
 };
 
 

Modified: haiku/trunk/src/apps/debugger/TeamDebugger.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/TeamDebugger.cpp	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/TeamDebugger.cpp	2009-06-18 21:45:14 UTC (rev 31107)
@@ -17,6 +17,7 @@
 
 #include "CpuState.h"
 #include "DebuggerInterface.h"
+#include "MessageCodes.h"
 #include "Team.h"
 #include "TeamDebugModel.h"
 
@@ -168,6 +169,19 @@
 TeamDebugger::MessageReceived(BMessage* message)
 {
 	switch (message->what) {
+		case MSG_THREAD_RUN:
+		case MSG_THREAD_STOP:
+		case MSG_THREAD_STEP_OVER:
+		case MSG_THREAD_STEP_INTO:
+		case MSG_THREAD_STEP_OUT:
+		{
+			int32 threadID;
+			if (message->FindInt32("thread", &threadID) != B_OK)
+				break;
+
+			_HandleThreadAction(threadID, message->what);
+			break;
+		}
 		default:
 			BLooper::MessageReceived(message);
 			break;
@@ -175,6 +189,24 @@
 }
 
 
+void
+TeamDebugger::ThreadActionRequested(TeamWindow* window, thread_id threadID,
+	uint32 action)
+{
+	BMessage message(action);
+	message.AddInt32("thread", threadID);
+	PostMessage(&message);
+}
+
+
+bool
+TeamDebugger::TeamWindowQuitRequested(TeamWindow* window)
+{
+	// TODO:...
+	return true;
+}
+
+
 /*static*/ status_t
 TeamDebugger::_DebugEventListenerEntry(void* data)
 {
@@ -222,30 +254,43 @@
 	switch (event->EventType()) {
 		case B_DEBUGGER_MESSAGE_THREAD_DEBUGGED:
 printf("B_DEBUGGER_MESSAGE_THREAD_DEBUGGED: thread: %ld\n", event->Thread());
+			handled = _HandleThreadDebugged(
+				dynamic_cast<ThreadDebuggedEvent*>(event));
 			break;
 		case B_DEBUGGER_MESSAGE_DEBUGGER_CALL:
 printf("B_DEBUGGER_MESSAGE_DEBUGGER_CALL: thread: %ld\n", event->Thread());
+			handled = _HandleDebuggerCall(
+				dynamic_cast<DebuggerCallEvent*>(event));
 			break;
 		case B_DEBUGGER_MESSAGE_BREAKPOINT_HIT:
 printf("B_DEBUGGER_MESSAGE_BREAKPOINT_HIT: thread: %ld\n", event->Thread());
+			handled = _HandleBreakpointHit(
+				dynamic_cast<BreakpointHitEvent*>(event));
 			break;
 		case B_DEBUGGER_MESSAGE_WATCHPOINT_HIT:
 printf("B_DEBUGGER_MESSAGE_WATCHPOINT_HIT: thread: %ld\n", event->Thread());
+			handled = _HandleWatchpointHit(
+				dynamic_cast<WatchpointHitEvent*>(event));
 			break;
 		case B_DEBUGGER_MESSAGE_SINGLE_STEP:
 printf("B_DEBUGGER_MESSAGE_SINGLE_STEP: thread: %ld\n", event->Thread());
+			handled = _HandleSingleStep(dynamic_cast<SingleStepEvent*>(event));
 			break;
 		case B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED:
 printf("B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED: thread: %ld\n", event->Thread());
+			handled = _HandleExceptionOccurred(
+				dynamic_cast<ExceptionOccurredEvent*>(event));
 			break;
 //		case B_DEBUGGER_MESSAGE_TEAM_CREATED:
 //printf("B_DEBUGGER_MESSAGE_TEAM_CREATED: team: %ld\n", message.team_created.new_team);
 //			break;
 		case B_DEBUGGER_MESSAGE_TEAM_DELETED:
+			// TODO: Handle!
 printf("B_DEBUGGER_MESSAGE_TEAM_DELETED: team: %ld\n", event->Team());
 			break;
 		case B_DEBUGGER_MESSAGE_TEAM_EXEC:
 printf("B_DEBUGGER_MESSAGE_TEAM_EXEC: team: %ld\n", event->Team());
+			// TODO: Handle!
 			break;
 		case B_DEBUGGER_MESSAGE_THREAD_CREATED:
 			handled = _HandleThreadCreated(
@@ -282,6 +327,70 @@
 
 
 bool
+TeamDebugger::_HandleThreadStopped(thread_id threadID, CpuState* cpuState)
+{
+	// get the thread
+	AutoLocker< ::Team> locker(fTeam);
+	::Thread* thread = fTeam->ThreadByID(threadID);
+	if (thread == NULL)
+		return false;
+
+	// update the thread state
+	thread->SetState(THREAD_STATE_STOPPED);
+
+	if (cpuState != NULL) {
+		thread->SetCpuState(cpuState);
+	} else {
+		// TODO: Trigger updating the CPU state!
+	}
+
+	return true;
+}
+
+
+bool
+TeamDebugger::_HandleThreadDebugged(ThreadDebuggedEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), NULL);
+}
+
+
+bool
+TeamDebugger::_HandleDebuggerCall(DebuggerCallEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), NULL);
+}
+
+
+bool
+TeamDebugger::_HandleBreakpointHit(BreakpointHitEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), event->GetCpuState());
+}
+
+
+bool
+TeamDebugger::_HandleWatchpointHit(WatchpointHitEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), event->GetCpuState());
+}
+
+
+bool
+TeamDebugger::_HandleSingleStep(SingleStepEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), event->GetCpuState());
+}
+
+
+bool
+TeamDebugger::_HandleExceptionOccurred(ExceptionOccurredEvent* event)
+{
+	return _HandleThreadStopped(event->Thread(), NULL);
+}
+
+
+bool
 TeamDebugger::_HandleThreadCreated(ThreadCreatedEvent* event)
 {
 	AutoLocker< ::Team> locker(fTeam);
@@ -339,3 +448,53 @@
 	thread->SetState(newState);
 	thread->SetCpuState(state);
 }
+
+
+void
+TeamDebugger::_HandleThreadAction(thread_id threadID, uint32 action)
+{
+	AutoLocker< ::Team> locker(fTeam);
+
+	::Thread* thread = fTeam->ThreadByID(threadID);
+	if (thread == NULL || thread->State() == THREAD_STATE_UNKNOWN)
+		return;
+
+	// When stop is requested, thread must be running, otherwise stopped.
+	if (action == MSG_THREAD_STOP
+			? thread->State() != THREAD_STATE_RUNNING
+			: thread->State() != THREAD_STATE_STOPPED) {
+		return;
+	}
+
+	// When continuing the thread update thread state before actually issuing
+	// the command, since we need to unlock.
+	if (action != MSG_THREAD_STOP)
+		thread->SetState(THREAD_STATE_RUNNING);
+
+	locker.Unlock();
+
+	switch (action) {
+		case MSG_THREAD_RUN:
+printf("MSG_THREAD_RUN\n");
+			fDebuggerInterface->ContinueThread(threadID);
+			break;
+		case MSG_THREAD_STOP:
+printf("MSG_THREAD_STOP\n");
+			fDebuggerInterface->StopThread(threadID);
+			break;
+		case MSG_THREAD_STEP_OVER:
+printf("MSG_THREAD_STEP_OVER\n");
+			fDebuggerInterface->SingleStepThread(threadID);
+			break;
+		case MSG_THREAD_STEP_INTO:
+printf("MSG_THREAD_STEP_INTO\n");
+			fDebuggerInterface->SingleStepThread(threadID);
+			break;
+		case MSG_THREAD_STEP_OUT:
+printf("MSG_THREAD_STEP_OUT\n");
+			fDebuggerInterface->SingleStepThread(threadID);
+			break;
+
+// TODO: Handle stepping correctly!
+	}
+}

Modified: haiku/trunk/src/apps/debugger/TeamDebugger.h
===================================================================
--- haiku/trunk/src/apps/debugger/TeamDebugger.h	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/TeamDebugger.h	2009-06-18 21:45:14 UTC (rev 31107)
@@ -34,12 +34,32 @@
 private:
 	virtual	void				MessageReceived(BMessage* message);
 
+	// TeamWindow::Listener
+	virtual	void				ThreadActionRequested(TeamWindow* window,
+									thread_id threadID, uint32 action);
+	virtual	bool				TeamWindowQuitRequested(TeamWindow* window);
+
 private:
 	static	status_t			_DebugEventListenerEntry(void* data);
 			status_t			_DebugEventListener();
 
 			void				_HandleDebuggerMessage(DebugEvent* event);
 
+			bool				_HandleThreadStopped(thread_id threadID,
+									CpuState* cpuState);
+
+			bool				_HandleThreadDebugged(
+									ThreadDebuggedEvent* event);
+			bool				_HandleDebuggerCall(
+									DebuggerCallEvent* event);
+			bool				_HandleBreakpointHit(
+									BreakpointHitEvent* event);
+			bool				_HandleWatchpointHit(
+									WatchpointHitEvent* event);
+			bool				_HandleSingleStep(
+									SingleStepEvent* event);
+			bool				_HandleExceptionOccurred(
+									ExceptionOccurredEvent* event);
 			bool				_HandleThreadCreated(
 									ThreadCreatedEvent* event);
 			bool				_HandleThreadDeleted(
@@ -51,6 +71,9 @@
 
 			void				_UpdateThreadState(::Thread* thread);
 
+			void				_HandleThreadAction(thread_id threadID,
+									uint32 action);
+
 private:
 			::Team*				fTeam;
 			TeamDebugModel*		fDebugModel;

Modified: haiku/trunk/src/apps/debugger/Thread.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/Thread.cpp	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/Thread.cpp	2009-06-18 21:45:14 UTC (rev 31107)
@@ -7,6 +7,7 @@
 
 #include "CpuState.h"
 #include "StackTrace.h"
+#include "Team.h"
 
 
 Thread::Thread(Team* team, thread_id threadID)
@@ -56,6 +57,8 @@
 		SetCpuState(NULL);
 		SetStackTrace(NULL);
 	}
+
+	fTeam->NotifyThreadStateChanged(this);
 }
 
 
@@ -72,8 +75,11 @@
 
 	if (fCpuState != NULL)
 		fCpuState->AddReference();
+
+	fTeam->NotifyThreadCpuStateChanged(this);
 }
 
+
 void
 Thread::SetStackTrace(StackTrace* trace)
 {
@@ -87,4 +93,6 @@
 
 	if (fStackTrace != NULL)
 		fStackTrace->AddReference();
+
+	fTeam->NotifyThreadStackTraceChanged(this);
 }

Modified: haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.cpp	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.cpp	2009-06-18 21:45:14 UTC (rev 31107)
@@ -132,6 +132,26 @@
 
 
 status_t
+DebuggerInterface::StopThread(thread_id thread)
+{
+	return debug_thread(thread);
+}
+
+
+status_t
+DebuggerInterface::SingleStepThread(thread_id thread)
+{
+	debug_nub_continue_thread continueMessage;
+	continueMessage.thread = thread;
+	continueMessage.handle_event = B_THREAD_DEBUG_HANDLE_EVENT;
+	continueMessage.single_step = true;
+
+	return write_port(fNubPort, B_DEBUG_MESSAGE_CONTINUE_THREAD,
+		&continueMessage, sizeof(continueMessage));
+}
+
+
+status_t
 DebuggerInterface::GetThreadInfos(BObjectList<ThreadInfo>& infos)
 {
 	thread_info threadInfo;

Modified: haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.h
===================================================================
--- haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.h	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/debugger_interface/DebuggerInterface.h	2009-06-18 21:45:14 UTC (rev 31107)
@@ -34,6 +34,8 @@
 	virtual	status_t			SetTeamDebuggingFlags(uint32 flags);
 
 	virtual	status_t			ContinueThread(thread_id thread);
+	virtual	status_t			StopThread(thread_id thread);
+	virtual	status_t			SingleStepThread(thread_id thread);
 
 	virtual	status_t			GetThreadInfos(BObjectList<ThreadInfo>& infos);
 	virtual	status_t			GetImageInfos(BObjectList<ImageInfo>& infos);

Modified: haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp	2009-06-18 21:45:14 UTC (rev 31107)
@@ -14,6 +14,8 @@
 #include <SplitView.h>
 #include <TextView.h>
 
+#include <AutoLocker.h>
+
 #include "ImageListView.h"
 #include "MessageCodes.h"
 #include "TeamDebugModel.h"
@@ -42,11 +44,14 @@
 	if (team->ID() >= 0)
 		name << " (" << team->ID() << ")";
 	SetTitle(name.String());
+
+	team->AddListener(this);
 }
 
 
 TeamWindow::~TeamWindow()
 {
+	fDebugModel->GetTeam()->RemoveListener(this);
 }
 
 
@@ -71,17 +76,28 @@
 {
 	switch (message->what) {
 		case MSG_THREAD_RUN:
-printf("MSG_THREAD_RUN\n");
-			break;
+		case MSG_THREAD_STOP:
 		case MSG_THREAD_STEP_OVER:
-printf("MSG_THREAD_STEP_OVER\n");
-			break;
 		case MSG_THREAD_STEP_INTO:
-printf("MSG_THREAD_STEP_INTO\n");
-			break;
 		case MSG_THREAD_STEP_OUT:
-printf("MSG_THREAD_STEP_OUT\n");
+			if (fActiveThread != NULL) {
+				fListener->ThreadActionRequested(this, fActiveThread->ID(),
+					message->what);
+			}
 			break;
+
+		case MSG_THREAD_STATE_CHANGED:
+		{
+			int32 threadID;
+			if (message->FindInt32("thread", &threadID) != B_OK)
+				break;
+
+			_HandleThreadStateChanged(threadID);
+			break;
+		}
+//		case MSG_THREAD_CPU_STATE_CHANGED:
+//		case MSG_THREAD_STACK_TRACE_CHANGED:
+
 		default:
 			BWindow::MessageReceived(message);
 			break;
@@ -104,6 +120,33 @@
 
 
 void
+TeamWindow::ThreadStateChanged(const Team::ThreadEvent& event)
+{
+	BMessage message(MSG_THREAD_STATE_CHANGED);
+	message.AddInt32("thread", event.GetThread()->ID());
+	PostMessage(&message);
+}
+
+
+void
+TeamWindow::ThreadCpuStateChanged(const Team::ThreadEvent& event)
+{
+//	BMessage message(MSG_THREAD_CPU_STATE_CHANGED);
+//	message.AddInt32("thread", event.GetThread()->ID());
+//	PostMessage(&message);
+}
+
+
+void
+TeamWindow::ThreadStackTraceChanged(const Team::ThreadEvent& event)
+{
+//	BMessage message(MSG_THREAD_STACK_TRACE_CHANGED);
+//	message.AddInt32("thread", event.GetThread()->ID());
+//	PostMessage(&message);
+}
+
+
+void
 TeamWindow::_Init()
 {
 	BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
@@ -155,6 +198,7 @@
 	fRunButton->SetTarget(this);
 	fStepOutButton->SetTarget(this);
 
+	AutoLocker<TeamDebugModel> locker(fDebugModel);
 	_UpdateRunButtons();
 }
 
@@ -167,6 +211,7 @@
 
 	fActiveThread = thread;
 
+	AutoLocker<TeamDebugModel> locker(fDebugModel);
 	_UpdateRunButtons();
 }
 
@@ -186,6 +231,7 @@
 			break;
 		case THREAD_STATE_RUNNING:
 			fRunButton->SetLabel("Stop");
+			fRunButton->SetMessage(new BMessage(MSG_THREAD_STOP));
 			fRunButton->SetEnabled(true);
 			fStepOverButton->SetEnabled(false);
 			fStepIntoButton->SetEnabled(false);
@@ -193,6 +239,7 @@
 			break;
 		case THREAD_STATE_STOPPED:
 			fRunButton->SetLabel("Run");
+			fRunButton->SetMessage(new BMessage(MSG_THREAD_RUN));
 			fRunButton->SetEnabled(true);
 			fStepOverButton->SetEnabled(true);
 			fStepIntoButton->SetEnabled(true);
@@ -202,16 +249,21 @@
 }
 
 
+void
+TeamWindow::_HandleThreadStateChanged(thread_id threadID)
+{
+	// ATM we're only interested in the currently selected thread
+	if (fActiveThread == NULL || threadID != fActiveThread->ID())
+		return;
+
+	AutoLocker<TeamDebugModel> locker(fDebugModel);
+	_UpdateRunButtons();
+}
+
+
 // #pragma mark - Listener
 
 
 TeamWindow::Listener::~Listener()
 {
 }
-
-
-bool
-TeamWindow::Listener::TeamWindowQuitRequested(TeamWindow* window)
-{
-	return true;
-}

Modified: haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h	2009-06-18 20:58:42 UTC (rev 31106)
+++ haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h	2009-06-18 21:45:14 UTC (rev 31107)
@@ -8,17 +8,18 @@
 #include <String.h>
 #include <Window.h>
 
+#include "Team.h"
 #include "ThreadListView.h"
 
 
 class BButton;
 class BTabView;
 class ImageListView;
-class Team;
 class TeamDebugModel;
 
 
-class TeamWindow : public BWindow, private ThreadListView::Listener {
+class TeamWindow : public BWindow, private ThreadListView::Listener,
+	Team::Listener {
 public:
 	class Listener;
 
@@ -38,11 +39,21 @@
 	// ThreadListView::Listener
 	virtual	void				ThreadSelectionChanged(::Thread* thread);
 
+	// Team::Listener
+	virtual	void				ThreadStateChanged(
+									const Team::ThreadEvent& event);
+	virtual	void				ThreadCpuStateChanged(
+									const Team::ThreadEvent& event);
+	virtual	void				ThreadStackTraceChanged(
+									const Team::ThreadEvent& event);
+
 			void				_Init();
 
 			void				_SetActiveThread(::Thread* thread);
 			void				_UpdateRunButtons();
 
+			void				_HandleThreadStateChanged(thread_id threadID);
+
 private:
 			TeamDebugModel*		fDebugModel;
 			::Thread*			fActiveThread;
@@ -61,7 +72,9 @@
 public:
 	virtual						~Listener();
 
-	virtual	bool				TeamWindowQuitRequested(TeamWindow* window);
+	virtual	void				ThreadActionRequested(TeamWindow* window,
+									thread_id threadID, uint32 action) = 0;
+	virtual	bool				TeamWindowQuitRequested(TeamWindow* window) = 0;
 };
 
 




More information about the Haiku-commits mailing list