Debugger: Add rename event for Team.
Team: - Add listener hook and event type for rename events. These occur on exec() since at this point we're running a different executable. TeamWindow: - Factor out code for generating window title into a helper, and use from both window initialization and newly implemented rename listener hook.
This commit is contained in:
@@ -31,6 +31,7 @@ enum {
|
|||||||
MSG_SET_CUSTOM_SIGNAL_DISPOSITION = 'scsd',
|
MSG_SET_CUSTOM_SIGNAL_DISPOSITION = 'scsd',
|
||||||
MSG_REMOVE_CUSTOM_SIGNAL_DISPOSITION = 'rcsd',
|
MSG_REMOVE_CUSTOM_SIGNAL_DISPOSITION = 'rcsd',
|
||||||
|
|
||||||
|
MSG_TEAM_RENAMED = 'tera',
|
||||||
MSG_THREAD_STATE_CHANGED = 'tsch',
|
MSG_THREAD_STATE_CHANGED = 'tsch',
|
||||||
MSG_THREAD_CPU_STATE_CHANGED = 'tcsc',
|
MSG_THREAD_CPU_STATE_CHANGED = 'tcsc',
|
||||||
MSG_THREAD_STACK_TRACE_CHANGED = 'tstc',
|
MSG_THREAD_STACK_TRACE_CHANGED = 'tstc',
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ void
|
|||||||
Team::SetName(const BString& name)
|
Team::SetName(const BString& name)
|
||||||
{
|
{
|
||||||
fName = name;
|
fName = name;
|
||||||
|
_NotifyTeamRenamed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -862,6 +863,16 @@ Team::NotifyMemoryChanged(target_addr_t address, target_size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Team::_NotifyTeamRenamed()
|
||||||
|
{
|
||||||
|
for (ListenerList::Iterator it = fListeners.GetIterator();
|
||||||
|
Listener* listener = it.Next();) {
|
||||||
|
listener->TeamRenamed(Event(TEAM_EVENT_TEAM_RENAMED, this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Team::_NotifyThreadAdded(Thread* thread)
|
Team::_NotifyThreadAdded(Thread* thread)
|
||||||
{
|
{
|
||||||
@@ -1067,6 +1078,12 @@ Team::Listener::~Listener()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Team::Listener::TeamRenamed(const Team::Event& event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Team::Listener::ThreadAdded(const Team::ThreadEvent& event)
|
Team::Listener::ThreadAdded(const Team::ThreadEvent& event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
// team event types
|
// team event types
|
||||||
enum {
|
enum {
|
||||||
|
TEAM_EVENT_TEAM_RENAMED,
|
||||||
|
|
||||||
TEAM_EVENT_THREAD_ADDED,
|
TEAM_EVENT_THREAD_ADDED,
|
||||||
TEAM_EVENT_THREAD_REMOVED,
|
TEAM_EVENT_THREAD_REMOVED,
|
||||||
TEAM_EVENT_IMAGE_ADDED,
|
TEAM_EVENT_IMAGE_ADDED,
|
||||||
@@ -273,6 +275,7 @@ private:
|
|||||||
typedef DoublyLinkedList<Listener> ListenerList;
|
typedef DoublyLinkedList<Listener> ListenerList;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void _NotifyTeamRenamed();
|
||||||
void _NotifyThreadAdded(Thread* thread);
|
void _NotifyThreadAdded(Thread* thread);
|
||||||
void _NotifyThreadRemoved(Thread* thread);
|
void _NotifyThreadRemoved(Thread* thread);
|
||||||
void _NotifyImageAdded(Image* image);
|
void _NotifyImageAdded(Image* image);
|
||||||
@@ -474,6 +477,9 @@ class Team::Listener : public DoublyLinkedListLinkImpl<Team::Listener> {
|
|||||||
public:
|
public:
|
||||||
virtual ~Listener();
|
virtual ~Listener();
|
||||||
|
|
||||||
|
virtual void TeamRenamed(
|
||||||
|
const Team::Event& event);
|
||||||
|
|
||||||
virtual void ThreadAdded(const Team::ThreadEvent& event);
|
virtual void ThreadAdded(const Team::ThreadEvent& event);
|
||||||
virtual void ThreadRemoved(const Team::ThreadEvent& event);
|
virtual void ThreadRemoved(const Team::ThreadEvent& event);
|
||||||
|
|
||||||
|
|||||||
@@ -145,12 +145,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
|
|||||||
fFilePanel(NULL),
|
fFilePanel(NULL),
|
||||||
fActiveSourceWorker(-1)
|
fActiveSourceWorker(-1)
|
||||||
{
|
{
|
||||||
fTeam->Lock();
|
_UpdateTitle();
|
||||||
BString name = fTeam->Name();
|
|
||||||
fTeam->Unlock();
|
|
||||||
if (fTeam->ID() >= 0)
|
|
||||||
name << " (" << fTeam->ID() << ")";
|
|
||||||
SetTitle(name.String());
|
|
||||||
|
|
||||||
fTeam->AddListener(this);
|
fTeam->AddListener(this);
|
||||||
}
|
}
|
||||||
@@ -518,6 +513,11 @@ TeamWindow::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MSG_TEAM_RENAMED:
|
||||||
|
{
|
||||||
|
_UpdateTitle();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MSG_THREAD_STATE_CHANGED:
|
case MSG_THREAD_STATE_CHANGED:
|
||||||
{
|
{
|
||||||
int32 threadID;
|
int32 threadID;
|
||||||
@@ -905,6 +905,13 @@ TeamWindow::ValueNodeWriteRequested(ValueNode* node, CpuState* state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TeamWindow::TeamRenamed(const Team::Event& event)
|
||||||
|
{
|
||||||
|
PostMessage(MSG_TEAM_RENAMED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TeamWindow::ThreadStateChanged(const Team::ThreadEvent& event)
|
TeamWindow::ThreadStateChanged(const Team::ThreadEvent& event)
|
||||||
{
|
{
|
||||||
@@ -1141,6 +1148,18 @@ TeamWindow::_Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TeamWindow::_UpdateTitle()
|
||||||
|
{
|
||||||
|
AutoLocker< ::Team> lock(fTeam);
|
||||||
|
|
||||||
|
BString name = fTeam->Name();
|
||||||
|
if (fTeam->ID() >= 0)
|
||||||
|
name << " (" << fTeam->ID() << ")";
|
||||||
|
SetTitle(name.String());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TeamWindow::_SetActiveThread(::Thread* thread)
|
TeamWindow::_SetActiveThread(::Thread* thread)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ private:
|
|||||||
CpuState* state, Value* value);
|
CpuState* state, Value* value);
|
||||||
|
|
||||||
// Team::Listener
|
// Team::Listener
|
||||||
|
virtual void TeamRenamed(const Team::Event& event);
|
||||||
virtual void ThreadStateChanged(
|
virtual void ThreadStateChanged(
|
||||||
const Team::ThreadEvent& event);
|
const Team::ThreadEvent& event);
|
||||||
virtual void ThreadCpuStateChanged(
|
virtual void ThreadCpuStateChanged(
|
||||||
@@ -157,6 +158,7 @@ private:
|
|||||||
|
|
||||||
void _Init();
|
void _Init();
|
||||||
|
|
||||||
|
void _UpdateTitle();
|
||||||
void _SetActiveThread(::Thread* thread);
|
void _SetActiveThread(::Thread* thread);
|
||||||
void _SetActiveImage(Image* image);
|
void _SetActiveImage(Image* image);
|
||||||
void _SetActiveStackTrace(StackTrace* stackTrace);
|
void _SetActiveStackTrace(StackTrace* stackTrace);
|
||||||
|
|||||||
Reference in New Issue
Block a user