1008dd426SIngo Weinhold/*
2008dd426SIngo Weinhold * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3fce4895dSRene Gollent * Copyright 2013-2016, Rene Gollent, rene@gollent.com.
4008dd426SIngo Weinhold * Distributed under the terms of the MIT License.
5008dd426SIngo Weinhold */
6008dd426SIngo Weinhold#ifndef TEAM_H
7008dd426SIngo Weinhold#define TEAM_H
8008dd426SIngo Weinhold
914a55dceSRene Gollent#include <map>
10a5e1e7ceSIngo Weinhold
11008dd426SIngo Weinhold#include <Locker.h>
12cae8421dSRene Gollent#include <StringList.h>
13008dd426SIngo Weinhold
14a5e1e7ceSIngo Weinhold#include <ObjectList.h>
15a5e1e7ceSIngo Weinhold
16008dd426SIngo Weinhold#include "Image.h"
17f208695cSIngo Weinhold#include "ImageInfo.h"
18a5e1e7ceSIngo Weinhold#include "TargetAddressRange.h"
19008dd426SIngo Weinhold#include "Thread.h"
20f208695cSIngo Weinhold#include "ThreadInfo.h"
212bf55b39SIngo Weinhold#include "UserBreakpoint.h"
224235cb3eSRene Gollent#include "Watchpoint.h"
23008dd426SIngo Weinhold
24008dd426SIngo Weinhold
25ae53f490SIngo Weinhold// team event types
26ae53f490SIngo Weinholdenum {
27754b42a5SRene Gollent	TEAM_EVENT_TEAM_RENAMED,
28754b42a5SRene Gollent
29ae53f490SIngo Weinhold	TEAM_EVENT_THREAD_ADDED,
30ae53f490SIngo Weinhold	TEAM_EVENT_THREAD_REMOVED,
31ae53f490SIngo Weinhold	TEAM_EVENT_IMAGE_ADDED,
32b6aff5aaSIngo Weinhold	TEAM_EVENT_IMAGE_REMOVED,
33b6aff5aaSIngo Weinhold
34b6aff5aaSIngo Weinhold	TEAM_EVENT_THREAD_STATE_CHANGED,
35b6aff5aaSIngo Weinhold	TEAM_EVENT_THREAD_CPU_STATE_CHANGED,
3693b64845SIngo Weinhold	TEAM_EVENT_THREAD_STACK_TRACE_CHANGED,
3793b64845SIngo Weinhold
38a5e1e7ceSIngo Weinhold	TEAM_EVENT_IMAGE_DEBUG_INFO_CHANGED,
39a5e1e7ceSIngo Weinhold
40cae8421dSRene Gollent	TEAM_EVENT_IMAGE_LOAD_SETTINGS_CHANGED,
41cae8421dSRene Gollent	TEAM_EVENT_IMAGE_LOAD_NAME_ADDED,
42cae8421dSRene Gollent	TEAM_EVENT_IMAGE_LOAD_NAME_REMOVED,
43cae8421dSRene Gollent
4414a55dceSRene Gollent	TEAM_EVENT_DEFAULT_SIGNAL_DISPOSITION_CHANGED,
4514a55dceSRene Gollent	TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_CHANGED,
4614a55dceSRene Gollent	TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_REMOVED,
4714a55dceSRene Gollent
48d692e338SRene Gollent	TEAM_EVENT_CONSOLE_OUTPUT_RECEIVED,
49d692e338SRene Gollent
50a5e1e7ceSIngo Weinhold	TEAM_EVENT_BREAKPOINT_ADDED,
51a5e1e7ceSIngo Weinhold	TEAM_EVENT_BREAKPOINT_REMOVED,
524235cb3eSRene Gollent	TEAM_EVENT_USER_BREAKPOINT_CHANGED,
534235cb3eSRene Gollent
544235cb3eSRene Gollent	TEAM_EVENT_WATCHPOINT_ADDED,
554235cb3eSRene Gollent	TEAM_EVENT_WATCHPOINT_REMOVED,
56248c2ff4SRene Gollent	TEAM_EVENT_WATCHPOINT_CHANGED,
57248c2ff4SRene Gollent
5868e78ff8SRene Gollent	TEAM_EVENT_DEBUG_REPORT_CHANGED,
5968e78ff8SRene Gollent
60e2d845a4SRene Gollent	TEAM_EVENT_CORE_FILE_CHANGED,
61e2d845a4SRene Gollent
6268e78ff8SRene Gollent	TEAM_EVENT_MEMORY_CHANGED
63ae53f490SIngo Weinhold};
64ae53f490SIngo Weinhold
65ae53f490SIngo Weinhold
66a5e1e7ceSIngo Weinholdclass Architecture;
67a5e1e7ceSIngo Weinholdclass Breakpoint;
68cae8421dSRene Gollentclass BStringList;
692bf55b39SIngo Weinholdclass Function;
70a5e1e7ceSIngo Weinholdclass FunctionID;
71f66bd625SIngo Weinholdclass FunctionInstance;
723c5dbb46SIngo Weinholdclass LocatableFile;
73a4b0c192SIngo Weinholdclass SourceCode;
74a4b0c192SIngo Weinholdclass SourceLocation;
75f66bd625SIngo Weinholdclass Statement;
76671ef9b0SIngo Weinholdclass TeamDebugInfo;
77a5e1e7ceSIngo Weinholdclass TeamMemory;
78698ad097SRene Gollentclass TeamTypeInformation;
790fc8a75cSIngo Weinholdclass UserBreakpoint;
802d5794a1SRene Gollentclass Value;
81671ef9b0SIngo Weinhold
82671ef9b0SIngo Weinhold
8314a55dceSRene Gollenttypedef std::map<int32, int32> SignalDispositionMappings;
8414a55dceSRene Gollent
8514a55dceSRene Gollent
86a5e1e7ceSIngo Weinholdclass Team {
87ac8b6713SIngo Weinholdpublic:
88ae53f490SIngo Weinhold			class Event;
89a5e1e7ceSIngo Weinhold			class BreakpointEvent;
90d692e338SRene Gollent			class ConsoleOutputEvent;
91248c2ff4SRene Gollent			class DebugReportEvent;
9268e78ff8SRene Gollent			class MemoryChangedEvent;
934235cb3eSRene Gollent			class ImageEvent;
94cae8421dSRene Gollent			class ImageLoadEvent;
95cae8421dSRene Gollent			class ImageLoadNameEvent;
9614a55dceSRene Gollent			class DefaultSignalDispositionEvent;
9714a55dceSRene Gollent			class CustomSignalDispositionEvent;
984235cb3eSRene Gollent			class ThreadEvent;
990fc8a75cSIngo Weinhold			class UserBreakpointEvent;
1004235cb3eSRene Gollent			class WatchpointEvent;
101e2d845a4SRene Gollent			class CoreFileChangedEvent;
102ac8b6713SIngo Weinhold			class Listener;
103ac8b6713SIngo Weinhold
104008dd426SIngo Weinholdpublic:
105a5e1e7ceSIngo Weinhold								Team(team_id teamID, TeamMemory* teamMemory,
106a5e1e7ceSIngo Weinhold									Architecture* architecture,
107698ad097SRene Gollent									TeamDebugInfo* debugInfo,
108698ad097SRene Gollent									TeamTypeInformation* typeInformation);
109008dd426SIngo Weinhold								~Team();
110008dd426SIngo Weinhold
111008dd426SIngo Weinhold			status_t			Init();
112008dd426SIngo Weinhold
113a5e1e7ceSIngo Weinhold			bool				Lock()		{ return fLock.Lock(); }
114a5e1e7ceSIngo Weinhold			void				Unlock()	{ fLock.Unlock(); }
115a5e1e7ceSIngo Weinhold
116671ef9b0SIngo Weinhold			team_id				ID() const			{ return fID; }
117a5e1e7ceSIngo Weinhold			TeamMemory*			GetTeamMemory() const
118a5e1e7ceSIngo Weinhold									{ return fTeamMemory; }
119a5e1e7ceSIngo Weinhold			Architecture*		GetArchitecture() const
120a5e1e7ceSIngo Weinhold									{ return fArchitecture; }
121671ef9b0SIngo Weinhold			TeamDebugInfo*		DebugInfo() const	{ return fDebugInfo; }
122698ad097SRene Gollent			TeamTypeInformation*
123698ad097SRene Gollent								GetTeamTypeInformation() const
124698ad097SRene Gollent									{ return fTypeInformation; }
125008dd426SIngo Weinhold
126008dd426SIngo Weinhold			const char*			Name() const	{ return fName.String(); }
127008dd426SIngo Weinhold			void				SetName(const BString& name);
128008dd426SIngo Weinhold
129fce4895dSRene Gollent			void				AddThread(::Thread* thread);
130f208695cSIngo Weinhold			status_t			AddThread(const ThreadInfo& threadInfo,
131fce4895dSRene Gollent									::Thread** _thread = NULL);
132fce4895dSRene Gollent			void				RemoveThread(::Thread* thread);
133008dd426SIngo Weinhold			bool				RemoveThread(thread_id threadID);
134fce4895dSRene Gollent			::Thread*			ThreadByID(thread_id threadID) const;
135ac8b6713SIngo Weinhold			const ThreadList&	Threads() const;
136008dd426SIngo Weinhold
137f208695cSIngo Weinhold			status_t			AddImage(const ImageInfo& imageInfo,
1383c5dbb46SIngo Weinhold									LocatableFile* imageFile,
139008dd426SIngo Weinhold									Image** _image = NULL);
140008dd426SIngo Weinhold			void				RemoveImage(Image* image);
141008dd426SIngo Weinhold			bool				RemoveImage(image_id imageID);
142008dd426SIngo Weinhold			Image*				ImageByID(image_id imageID) const;
1430b60fa86SIngo Weinhold			Image*				ImageByAddress(target_addr_t address) const;
144ac8b6713SIngo Weinhold			const ImageList&	Images() const;
1458f21b175SRene Gollent			void				ClearImages();
146ac8b6713SIngo Weinhold
147cae8421dSRene Gollent			bool				AddStopImageName(const BString& name);
148cae8421dSRene Gollent			void				RemoveStopImageName(const BString& name);
149cae8421dSRene Gollent			const BStringList&	StopImageNames() const;
150cae8421dSRene Gollent
151cae8421dSRene Gollent			void				SetStopOnImageLoad(bool enabled,
152cae8421dSRene Gollent									bool useImageNameList);
153cae8421dSRene Gollent			bool				StopOnImageLoad() const
154cae8421dSRene Gollent									{ return fStopOnImageLoad; }
155cae8421dSRene Gollent			bool				StopImageNameListEnabled() const
156cae8421dSRene Gollent									{ return fStopImageNameListEnabled; }
157cae8421dSRene Gollent
15814a55dceSRene Gollent			void				SetDefaultSignalDisposition(int32 disposition);
15914a55dceSRene Gollent			int32				DefaultSignalDisposition() const
16014a55dceSRene Gollent									{ return fDefaultSignalDisposition; }
16114a55dceSRene Gollent			bool				SetCustomSignalDisposition(int32 signal,
16214a55dceSRene Gollent									int32 disposition);
16314a55dceSRene Gollent			void				RemoveCustomSignalDisposition(int32 signal);
16414a55dceSRene Gollent			int32				SignalDispositionFor(int32 signal) const;
16514a55dceSRene Gollent									// if no custom disposition is found,
16614a55dceSRene Gollent									// returns default
16714a55dceSRene Gollent			const SignalDispositionMappings&
16814a55dceSRene Gollent								GetSignalDispositionMappings() const;
16914a55dceSRene Gollent
1708f21b175SRene Gollent			void				ClearSignalDispositionMappings();
1718f21b175SRene Gollent
172a5e1e7ceSIngo Weinhold			bool				AddBreakpoint(Breakpoint* breakpoint);
173a5e1e7ceSIngo Weinhold									// takes over reference (also on error)
174a5e1e7ceSIngo Weinhold			void				RemoveBreakpoint(Breakpoint* breakpoint);
175a5e1e7ceSIngo Weinhold									// releases its own reference
176a5e1e7ceSIngo Weinhold			int32				CountBreakpoints() const;
177a5e1e7ceSIngo Weinhold			Breakpoint*			BreakpointAt(int32 index) const;
178a5e1e7ceSIngo Weinhold			Breakpoint*			BreakpointAtAddress(
179a5e1e7ceSIngo Weinhold									target_addr_t address) const;
180a5e1e7ceSIngo Weinhold			void				GetBreakpointsInAddressRange(
181a5e1e7ceSIngo Weinhold									TargetAddressRange range,
182a5e1e7ceSIngo Weinhold									BObjectList<UserBreakpoint>& breakpoints)
183a5e1e7ceSIngo Weinhold										const;
184a5e1e7ceSIngo Weinhold			void				GetBreakpointsForSourceCode(
185a5e1e7ceSIngo Weinhold									SourceCode* sourceCode,
186a5e1e7ceSIngo Weinhold									BObjectList<UserBreakpoint>& breakpoints)
187a5e1e7ceSIngo Weinhold										const;
188a5e1e7ceSIngo Weinhold
1892bf55b39SIngo Weinhold			void				AddUserBreakpoint(
1902bf55b39SIngo Weinhold									UserBreakpoint* userBreakpoint);
1912bf55b39SIngo Weinhold			void				RemoveUserBreakpoint(
1922bf55b39SIngo Weinhold									UserBreakpoint* userBreakpoint);
1932bf55b39SIngo Weinhold			const UserBreakpointList& UserBreakpoints() const
1942bf55b39SIngo Weinhold									{ return fUserBreakpoints; }
1952bf55b39SIngo Weinhold
1964235cb3eSRene Gollent			bool				AddWatchpoint(Watchpoint* watchpoint);
1974235cb3eSRene Gollent									// takes over reference (also on error)
1984235cb3eSRene Gollent			void				RemoveWatchpoint(Watchpoint* watchpoint);
1994235cb3eSRene Gollent									// releases its own reference
2004235cb3eSRene Gollent			int32				CountWatchpoints() const;
2014235cb3eSRene Gollent			Watchpoint*			WatchpointAt(int32 index) const;
2024235cb3eSRene Gollent			Watchpoint*			WatchpointAtAddress(
2034235cb3eSRene Gollent									target_addr_t address) const;
2044235cb3eSRene Gollent			void				GetWatchpointsInAddressRange(
2054235cb3eSRene Gollent									TargetAddressRange range,
2064235cb3eSRene Gollent									BObjectList<Watchpoint>& watchpoints)
2074235cb3eSRene Gollent										const;
20812c53499SRene Gollent			const WatchpointList& Watchpoints() const
20912c53499SRene Gollent									{ return fWatchpoints; }
2104235cb3eSRene Gollent
211f66bd625SIngo Weinhold			status_t			GetStatementAtAddress(target_addr_t address,
212f66bd625SIngo Weinhold									FunctionInstance*& _function,
213f66bd625SIngo Weinhold									Statement*& _statement);
214f66bd625SIngo Weinhold									// returns a reference to the statement,
215f66bd625SIngo Weinhold									// not to the functions instance, though,
216f66bd625SIngo Weinhold									// caller must lock
217a4b0c192SIngo Weinhold			status_t			GetStatementAtSourceLocation(
218a4b0c192SIngo Weinhold									SourceCode* sourceCode,
219a4b0c192SIngo Weinhold									const SourceLocation& location,
220a4b0c192SIngo Weinhold									Statement*& _statement);
221a4b0c192SIngo Weinhold									// returns a reference to the statement
222a4b0c192SIngo Weinhold									// (any matching statement!),
223a4b0c192SIngo Weinhold									// caller must lock,
224f66bd625SIngo Weinhold
2252bf55b39SIngo Weinhold			Function*			FunctionByID(FunctionID* functionID) const;
2262bf55b39SIngo Weinhold
227ac8b6713SIngo Weinhold			void				AddListener(Listener* listener);
228ac8b6713SIngo Weinhold			void				RemoveListener(Listener* listener);
229ac8b6713SIngo Weinhold
230b6aff5aaSIngo Weinhold			// service methods for Thread
231fce4895dSRene Gollent			void				NotifyThreadStateChanged(::Thread* thread);
232fce4895dSRene Gollent			void				NotifyThreadCpuStateChanged(::Thread* thread);
233fce4895dSRene Gollent			void				NotifyThreadStackTraceChanged(
234fce4895dSRene Gollent									::Thread* thread);
235b6aff5aaSIngo Weinhold
23693b64845SIngo Weinhold			// service methods for Image
23793b64845SIngo Weinhold			void				NotifyImageDebugInfoChanged(Image* image);
23893b64845SIngo Weinhold
239cae8421dSRene Gollent			// service methods for Image load settings
240cae8421dSRene Gollent			void				NotifyStopOnImageLoadChanged(bool enabled,
241cae8421dSRene Gollent									bool useImageNameList);
242cae8421dSRene Gollent			void				NotifyStopImageNameAdded(const BString& name);
243cae8421dSRene Gollent			void				NotifyStopImageNameRemoved(
244cae8421dSRene Gollent									const BString& name);
245cae8421dSRene Gollent
24614a55dceSRene Gollent			// service methods for Signal Disposition settings
24714a55dceSRene Gollent			void				NotifyDefaultSignalDispositionChanged(
24814a55dceSRene Gollent									int32 newDisposition);
24914a55dceSRene Gollent			void				NotifyCustomSignalDispositionChanged(
25014a55dceSRene Gollent									int32 signal, int32 disposition);
25114a55dceSRene Gollent			void				NotifyCustomSignalDispositionRemoved(
25214a55dceSRene Gollent									int32 signal);
25314a55dceSRene Gollent
254d692e338SRene Gollent			// service methods for console output
255d692e338SRene Gollent			void				NotifyConsoleOutputReceived(
256d692e338SRene Gollent									int32 fd, const BString& output);
257d692e338SRene Gollent
258a5e1e7ceSIngo Weinhold			// breakpoint related service methods
259a5e1e7ceSIngo Weinhold			void				NotifyUserBreakpointChanged(
2600fc8a75cSIngo Weinhold									UserBreakpoint* breakpoint);
261a5e1e7ceSIngo Weinhold
2624235cb3eSRene Gollent			// watchpoint related service methods
2634235cb3eSRene Gollent			void				NotifyWatchpointChanged(
2644235cb3eSRene Gollent									Watchpoint* watchpoint);
2654235cb3eSRene Gollent
266248c2ff4SRene Gollent			// debug report related service methods
267248c2ff4SRene Gollent			void				NotifyDebugReportChanged(
2687bdeef54SRene Gollent									const char* reportPath, status_t result);
269248c2ff4SRene Gollent
270e2d845a4SRene Gollent			// core file related service methods
271e2d845a4SRene Gollent			void				NotifyCoreFileChanged(
272e2d845a4SRene Gollent									const char* targetPath);
273e2d845a4SRene Gollent
27468e78ff8SRene Gollent			// memory write related service methods
27568e78ff8SRene Gollent			void				NotifyMemoryChanged(target_addr_t address,
27668e78ff8SRene Gollent									target_size_t size);
27768e78ff8SRene Gollent
278ac8b6713SIngo Weinholdprivate:
279a5e1e7ceSIngo Weinhold			struct BreakpointByAddressPredicate;
2804235cb3eSRene Gollent			struct WatchpointByAddressPredicate;
281a5e1e7ceSIngo Weinhold
282a5e1e7ceSIngo Weinhold			typedef BObjectList<Breakpoint> BreakpointList;
283ac8b6713SIngo Weinhold			typedef DoublyLinkedList<Listener> ListenerList;
284ac8b6713SIngo Weinhold
285ac8b6713SIngo Weinholdprivate:
286754b42a5SRene Gollent			void				_NotifyTeamRenamed();
287fce4895dSRene Gollent			void				_NotifyThreadAdded(::Thread* thread);
288fce4895dSRene Gollent			void				_NotifyThreadRemoved(::Thread* thread);
289ac8b6713SIngo Weinhold			void				_NotifyImageAdded(Image* image);
290ac8b6713SIngo Weinhold			void				_NotifyImageRemoved(Image* image);
291008dd426SIngo Weinhold
292008dd426SIngo Weinholdprivate:
293a5e1e7ceSIngo Weinhold			BLocker				fLock;
294008dd426SIngo Weinhold			team_id				fID;
295a5e1e7ceSIngo Weinhold			TeamMemory*			fTeamMemory;
296698ad097SRene Gollent			TeamTypeInformation*
297698ad097SRene Gollent								fTypeInformation;
298a5e1e7ceSIngo Weinhold			Architecture*		fArchitecture;
299671ef9b0SIngo Weinhold			TeamDebugInfo*		fDebugInfo;
300008dd426SIngo Weinhold			BString				fName;
301008dd426SIngo Weinhold			ThreadList			fThreads;
302008dd426SIngo Weinhold			ImageList			fImages;
303cae8421dSRene Gollent			bool				fStopOnImageLoad;
304cae8421dSRene Gollent			bool				fStopImageNameListEnabled;
305cae8421dSRene Gollent			BStringList			fStopImageNames;
30614a55dceSRene Gollent			int32				fDefaultSignalDisposition;
30714a55dceSRene Gollent			SignalDispositionMappings
30814a55dceSRene Gollent								fCustomSignalDispositions;
309a5e1e7ceSIngo Weinhold			BreakpointList		fBreakpoints;
3104235cb3eSRene Gollent			WatchpointList		fWatchpoints;
3112bf55b39SIngo Weinhold			UserBreakpointList	fUserBreakpoints;
312ac8b6713SIngo Weinhold			ListenerList		fListeners;
313008dd426SIngo Weinhold};
314008dd426SIngo Weinhold
315ac8b6713SIngo Weinhold
316ae53f490SIngo Weinholdclass Team::Event {
317ae53f490SIngo Weinholdpublic:
318ae53f490SIngo Weinhold								Event(uint32 type, Team* team);
319ae53f490SIngo Weinhold
320ae53f490SIngo Weinhold			uint32				EventType() const	{ return fEventType; }
321ae53f490SIngo Weinhold			Team*				GetTeam() const		{ return fTeam; }
322ae53f490SIngo Weinhold
323ae53f490SIngo Weinholdprotected:
324ae53f490SIngo Weinhold			uint32				fEventType;
325ae53f490SIngo Weinhold			Team*				fTeam;
326ae53f490SIngo Weinhold};
327ae53f490SIngo Weinhold
328ae53f490SIngo Weinhold
329ae53f490SIngo Weinholdclass Team::ThreadEvent : public Event {
330ae53f490SIngo Weinholdpublic:
331fce4895dSRene Gollent								ThreadEvent(uint32 type, ::Thread* thread);
332ae53f490SIngo Weinhold
333fce4895dSRene Gollent			::Thread*			GetThread() const	{ return fThread; }
334ae53f490SIngo Weinhold
335ae53f490SIngo Weinholdprotected:
336fce4895dSRene Gollent			::Thread*			fThread;
337ae53f490SIngo Weinhold};
338ae53f490SIngo Weinhold
339ae53f490SIngo Weinhold
340ae53f490SIngo Weinholdclass Team::ImageEvent : public Event {
341ae53f490SIngo Weinholdpublic:
342ae53f490SIngo Weinhold								ImageEvent(uint32 type, Image* image);
343ae53f490SIngo Weinhold
344ae53f490SIngo Weinhold			Image*				GetImage() const	{ return fImage; }
345ae53f490SIngo Weinhold
346ae53f490SIngo Weinholdprotected:
347ae53f490SIngo Weinhold			Image*				fImage;
348ae53f490SIngo Weinhold};
349ae53f490SIngo Weinhold
350ae53f490SIngo Weinhold
351cae8421dSRene Gollentclass Team::ImageLoadEvent : public Event {
352cae8421dSRene Gollentpublic:
353cae8421dSRene Gollent								ImageLoadEvent(uint32 type, Team* team,
354cae8421dSRene Gollent									bool stopOnImageLoad,
355cae8421dSRene Gollent									bool stopImageNameListEnabled);
356cae8421dSRene Gollent
357cae8421dSRene Gollent			bool				StopOnImageLoad() const
358cae8421dSRene Gollent									{ return fStopOnImageLoad; }
359cae8421dSRene Gollent			bool				StopImageNameListEnabled() const
360cae8421dSRene Gollent									{ return fStopImageNameListEnabled; }
361cae8421dSRene Gollent
362cae8421dSRene Gollentprivate:
363cae8421dSRene Gollent			bool				fStopOnImageLoad;
364cae8421dSRene Gollent			bool				fStopImageNameListEnabled;
365cae8421dSRene Gollent};
366cae8421dSRene Gollent
367cae8421dSRene Gollent
368cae8421dSRene Gollentclass Team::ImageLoadNameEvent : public Event {
369cae8421dSRene Gollentpublic:
370cae8421dSRene Gollent								ImageLoadNameEvent(uint32 type, Team* team,
371cae8421dSRene Gollent									const BString& name);
372cae8421dSRene Gollent
373cae8421dSRene Gollent			const BString&		ImageName() const { return fImageName; }
374cae8421dSRene Gollent
375cae8421dSRene Gollentprivate:
376cae8421dSRene Gollent			BString				fImageName;
377cae8421dSRene Gollent};
378cae8421dSRene Gollent
379cae8421dSRene Gollent
38014a55dceSRene Gollentclass Team::DefaultSignalDispositionEvent : public Event {
38114a55dceSRene Gollentpublic:
38214a55dceSRene Gollent								DefaultSignalDispositionEvent(uint32 type,
38314a55dceSRene Gollent									Team* team, int32 disposition);
38414a55dceSRene Gollent
38514a55dceSRene Gollent			int32				DefaultDisposition() const
38614a55dceSRene Gollent									{ return fDefaultDisposition; }
38714a55dceSRene Gollent
38814a55dceSRene Gollentprivate:
38914a55dceSRene Gollent			int32				fDefaultDisposition;
39014a55dceSRene Gollent};
39114a55dceSRene Gollent
39214a55dceSRene Gollent
39314a55dceSRene Gollentclass Team::CustomSignalDispositionEvent : public Event {
39414a55dceSRene Gollentpublic:
39514a55dceSRene Gollent								CustomSignalDispositionEvent(uint32 type,
39614a55dceSRene Gollent									Team* team, int32 signal,
39714a55dceSRene Gollent									int32 disposition);
39814a55dceSRene Gollent
39914a55dceSRene Gollent			int32				Signal() const { return fSignal; }
40014a55dceSRene Gollent			int32				Disposition() const { return fDisposition; }
40114a55dceSRene Gollent
40214a55dceSRene Gollentprivate:
40314a55dceSRene Gollent			int32				fSignal;
40414a55dceSRene Gollent			int32				fDisposition;
40514a55dceSRene Gollent};
40614a55dceSRene Gollent
40714a55dceSRene Gollent
408a5e1e7ceSIngo Weinholdclass Team::BreakpointEvent : public Event {
409a5e1e7ceSIngo Weinholdpublic:
410a5e1e7ceSIngo Weinhold								BreakpointEvent(uint32 type, Team* team,
411a5e1e7ceSIngo Weinhold									Breakpoint* breakpoint);
412a5e1e7ceSIngo Weinhold
413a5e1e7ceSIngo Weinhold			Breakpoint*			GetBreakpoint() const	{ return fBreakpoint; }
414a5e1e7ceSIngo Weinhold
415a5e1e7ceSIngo Weinholdprotected:
416a5e1e7ceSIngo Weinhold			Breakpoint*			fBreakpoint;
417a5e1e7ceSIngo Weinhold};
418a5e1e7ceSIngo Weinhold
419a5e1e7ceSIngo Weinhold
420d692e338SRene Gollentclass Team::ConsoleOutputEvent : public Event {
421d692e338SRene Gollentpublic:
422d692e338SRene Gollent								ConsoleOutputEvent(uint32 type, Team* team,
423d692e338SRene Gollent									int32 fd, const BString& output);
424d692e338SRene Gollent
425d692e338SRene Gollent			int32				Descriptor() const	{ return fDescriptor; }
426d692e338SRene Gollent			const BString&		Output() const		{ return fOutput; }
427d692e338SRene Gollent
428d692e338SRene Gollentprotected:
429d692e338SRene Gollent			int32				fDescriptor;
430d692e338SRene Gollent			BString				fOutput;
431d692e338SRene Gollent};
432d692e338SRene Gollent
433d692e338SRene Gollent
434248c2ff4SRene Gollentclass Team::DebugReportEvent : public Event {
435248c2ff4SRene Gollentpublic:
436248c2ff4SRene Gollent								DebugReportEvent(uint32 type, Team* team,
4377bdeef54SRene Gollent									const char* reportPath,
4387bdeef54SRene Gollent									status_t finalStatus);
439248c2ff4SRene Gollent
440248c2ff4SRene Gollent			const char*			GetReportPath() const	{ return fReportPath; }
4417bdeef54SRene Gollent			status_t			GetFinalStatus() const	{ return fFinalStatus; }
442248c2ff4SRene Gollentprotected:
443248c2ff4SRene Gollent			const char*			fReportPath;
4447bdeef54SRene Gollent			status_t			fFinalStatus;
445248c2ff4SRene Gollent};
446248c2ff4SRene Gollent
4477bdeef54SRene Gollent
448e2d845a4SRene Gollentclass Team::CoreFileChangedEvent : public Event {
449e2d845a4SRene Gollentpublic:
450e2d845a4SRene Gollent								CoreFileChangedEvent(uint32 type, Team* team,
451e2d845a4SRene Gollent									const char* targetPath);
452e2d845a4SRene Gollent			const char*			GetTargetPath() const	{ return fTargetPath; }
453e2d845a4SRene Gollentprotected:
454e2d845a4SRene Gollent			const char*			fTargetPath;
455e2d845a4SRene Gollent};
456e2d845a4SRene Gollent
457248c2ff4SRene Gollent
45868e78ff8SRene Gollentclass Team::MemoryChangedEvent : public Event {
45968e78ff8SRene Gollentpublic:
46068e78ff8SRene Gollent								MemoryChangedEvent(uint32 type, Team* team,
46168e78ff8SRene Gollent									target_addr_t address, target_size_t size);
46268e78ff8SRene Gollent
46368e78ff8SRene Gollent			target_addr_t		GetTargetAddress() const
46468e78ff8SRene Gollent									{ return fTargetAddress; }
46568e78ff8SRene Gollent
46668e78ff8SRene Gollent			target_size_t		GetSize() const	{ return fSize; }
46768e78ff8SRene Gollentprotected:
46868e78ff8SRene Gollent			target_addr_t		fTargetAddress;
46968e78ff8SRene Gollent			target_size_t		fSize;
47068e78ff8SRene Gollent};
47168e78ff8SRene Gollent
47268e78ff8SRene Gollent
4734235cb3eSRene Gollentclass Team::WatchpointEvent : public Event {
4744235cb3eSRene Gollentpublic:
4754235cb3eSRene Gollent								WatchpointEvent(uint32 type, Team* team,
4764235cb3eSRene Gollent									Watchpoint* watchpoint);
4774235cb3eSRene Gollent
4784235cb3eSRene Gollent			Watchpoint*			GetWatchpoint() const	{ return fWatchpoint; }
4794235cb3eSRene Gollent
4804235cb3eSRene Gollentprotected:
4814235cb3eSRene Gollent			Watchpoint*			fWatchpoint;
4824235cb3eSRene Gollent};
4834235cb3eSRene Gollent
4844235cb3eSRene Gollent
4850fc8a75cSIngo Weinholdclass Team::UserBreakpointEvent : public Event {
4860fc8a75cSIngo Weinholdpublic:
4870fc8a75cSIngo Weinhold								UserBreakpointEvent(uint32 type, Team* team,
4880fc8a75cSIngo Weinhold									UserBreakpoint* breakpoint);
4890fc8a75cSIngo Weinhold
4900fc8a75cSIngo Weinhold			UserBreakpoint*		GetBreakpoint() const	{ return fBreakpoint; }
4910fc8a75cSIngo Weinhold
4920fc8a75cSIngo Weinholdprotected:
4930fc8a75cSIngo Weinhold			UserBreakpoint*		fBreakpoint;
4940fc8a75cSIngo Weinhold};
4950fc8a75cSIngo Weinhold
4960fc8a75cSIngo Weinhold
497ac8b6713SIngo Weinholdclass Team::Listener : public DoublyLinkedListLinkImpl<Team::Listener> {
498ac8b6713SIngo Weinholdpublic:
499ac8b6713SIngo Weinhold	virtual						~Listener();
500ac8b6713SIngo Weinhold
501754b42a5SRene Gollent	virtual	void				TeamRenamed(
502754b42a5SRene Gollent									const Team::Event& event);
503754b42a5SRene Gollent
504ae53f490SIngo Weinhold	virtual	void				ThreadAdded(const Team::ThreadEvent& event);
505ae53f490SIngo Weinhold	virtual	void				ThreadRemoved(const Team::ThreadEvent& event);
506ac8b6713SIngo Weinhold
507ae53f490SIngo Weinhold	virtual	void				ImageAdded(const Team::ImageEvent& event);
508ae53f490SIngo Weinhold	virtual	void				ImageRemoved(const Team::ImageEvent& event);
509b6aff5aaSIngo Weinhold
510b6aff5aaSIngo Weinhold	virtual	void				ThreadStateChanged(
511b6aff5aaSIngo Weinhold									const Team::ThreadEvent& event);
512b6aff5aaSIngo Weinhold	virtual	void				ThreadCpuStateChanged(
513b6aff5aaSIngo Weinhold									const Team::ThreadEvent& event);
514b6aff5aaSIngo Weinhold	virtual	void				ThreadStackTraceChanged(
515b6aff5aaSIngo Weinhold									const Team::ThreadEvent& event);
51693b64845SIngo Weinhold
51793b64845SIngo Weinhold	virtual	void				ImageDebugInfoChanged(
51893b64845SIngo Weinhold									const Team::ImageEvent& event);
519a5e1e7ceSIngo Weinhold
520cae8421dSRene Gollent	virtual	void				StopOnImageLoadSettingsChanged(
521cae8421dSRene Gollent									const Team::ImageLoadEvent& event);
522cae8421dSRene Gollent	virtual	void				StopOnImageLoadNameAdded(
523cae8421dSRene Gollent									const Team::ImageLoadNameEvent& event);
524cae8421dSRene Gollent	virtual	void				StopOnImageLoadNameRemoved(
525cae8421dSRene Gollent									const Team::ImageLoadNameEvent& event);
526cae8421dSRene Gollent
52714a55dceSRene Gollent	virtual	void				DefaultSignalDispositionChanged(
52814a55dceSRene Gollent									const Team::DefaultSignalDispositionEvent&
52914a55dceSRene Gollent										event);
53014a55dceSRene Gollent	virtual	void				CustomSignalDispositionChanged(
53114a55dceSRene Gollent									const Team::CustomSignalDispositionEvent&
53214a55dceSRene Gollent										event);
53314a55dceSRene Gollent	virtual	void				CustomSignalDispositionRemoved(
53414a55dceSRene Gollent									const Team::CustomSignalDispositionEvent&
53514a55dceSRene Gollent										event);
53614a55dceSRene Gollent
537d692e338SRene Gollent	virtual	void				ConsoleOutputReceived(
538d692e338SRene Gollent									const Team::ConsoleOutputEvent& event);
539d692e338SRene Gollent
540a5e1e7ceSIngo Weinhold	virtual	void				BreakpointAdded(
541a5e1e7ceSIngo Weinhold									const Team::BreakpointEvent& event);
542a5e1e7ceSIngo Weinhold	virtual	void				BreakpointRemoved(
543a5e1e7ceSIngo Weinhold									const Team::BreakpointEvent& event);
544a5e1e7ceSIngo Weinhold	virtual	void				UserBreakpointChanged(
5450fc8a75cSIngo Weinhold									const Team::UserBreakpointEvent& event);
5464235cb3eSRene Gollent
5474235cb3eSRene Gollent	virtual	void				WatchpointAdded(
5484235cb3eSRene Gollent									const Team::WatchpointEvent& event);
5494235cb3eSRene Gollent	virtual	void				WatchpointRemoved(
5504235cb3eSRene Gollent									const Team::WatchpointEvent& event);
5514235cb3eSRene Gollent	virtual	void				WatchpointChanged(
5524235cb3eSRene Gollent									const Team::WatchpointEvent& event);
553248c2ff4SRene Gollent
554248c2ff4SRene Gollent	virtual void				DebugReportChanged(
555248c2ff4SRene Gollent									const Team::DebugReportEvent& event);
55668e78ff8SRene Gollent
557e2d845a4SRene Gollent	virtual	void				CoreFileChanged(
558e2d845a4SRene Gollent									const Team::CoreFileChangedEvent& event);
559e2d845a4SRene Gollent
56068e78ff8SRene Gollent	virtual	void				MemoryChanged(
56168e78ff8SRene Gollent									const Team::MemoryChangedEvent& event);
562ac8b6713SIngo Weinhold};
563ac8b6713SIngo Weinhold
564ac8b6713SIngo Weinhold
565008dd426SIngo Weinhold#endif	// TEAM_H
566