From 27a115f6685cc7821dd2ab6d528d6f3abe70158d Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 14 Dec 2010 17:55:38 +0000 Subject: [PATCH] Revert r39846 and r39847. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39849 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/kernel/debugger.h | 22 +--------- headers/private/debug/DebugMessageHandler.h | 5 --- headers/private/kernel/user_debugger.h | 2 - src/apps/debugger/TeamDebugger.cpp | 42 ------------------- src/apps/debugger/TeamDebugger.h | 4 -- .../debugger_interface/DebugEvent.cpp | 26 ------------ .../debugger/debugger_interface/DebugEvent.h | 30 ------------- .../debugger_interface/DebuggerInterface.cpp | 11 ----- .../gui/team_window/TeamWindow.cpp | 4 -- src/system/kernel/debug/user_debugger.cpp | 42 ------------------- src/system/kernel/thread.cpp | 5 --- 11 files changed, 1 insertion(+), 192 deletions(-) diff --git a/headers/os/kernel/debugger.h b/headers/os/kernel/debugger.h index 0d48bf9066..12add40d00 100644 --- a/headers/os/kernel/debugger.h +++ b/headers/os/kernel/debugger.h @@ -180,8 +180,6 @@ typedef enum { B_DEBUGGER_MESSAGE_TEAM_DELETED, // the debugged team is gone B_DEBUGGER_MESSAGE_TEAM_EXEC, // the debugged team executes exec() B_DEBUGGER_MESSAGE_THREAD_CREATED, // a thread has been created - B_DEBUGGER_MESSAGE_THREAD_RENAMED, // a thread has been renamed - B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED, // a thread has had its priority altered B_DEBUGGER_MESSAGE_THREAD_DELETED, // a thread has been deleted B_DEBUGGER_MESSAGE_IMAGE_CREATED, // an image has been created B_DEBUGGER_MESSAGE_IMAGE_DELETED, // an image has been deleted @@ -547,25 +545,9 @@ typedef struct { typedef struct { debug_origin origin; // the thread that created the new thread - thread_id new_thread; // the newly created thread + team_id new_thread; // the newly created thread } debug_thread_created; -// B_DEBUGGER_MESSAGE_THREAD_RENAMED - -typedef struct { - debug_origin origin; - thread_id renamed_thread; // the thread whose name has changed - char name[B_OS_NAME_LENGTH]; -} debug_thread_renamed; - -// B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED - -typedef struct { - debug_origin origin; - thread_id changed_thread; // the thread whose priority has changed - int32 new_priority; // the new priority -} debug_thread_priority_changed; - // B_DEBUGGER_MESSAGE_THREAD_DELETED typedef struct { @@ -637,8 +619,6 @@ typedef union { debug_team_deleted team_deleted; debug_team_exec team_exec; debug_thread_created thread_created; - debug_thread_renamed thread_renamed; - debug_thread_priority_changed thread_priority_changed; debug_thread_deleted thread_deleted; debug_image_created image_created; debug_image_deleted image_deleted; diff --git a/headers/private/debug/DebugMessageHandler.h b/headers/private/debug/DebugMessageHandler.h index 0abc557194..e2ca0ea259 100644 --- a/headers/private/debug/DebugMessageHandler.h +++ b/headers/private/debug/DebugMessageHandler.h @@ -42,11 +42,6 @@ public: const debug_team_exec& message); virtual bool HandleThreadCreated( const debug_thread_created& message); - virtual bool HandleThreadRenamed( - const debug_thread_renamed& message); - virtual bool HandleThreadPriorityChanged( - const debug_thread_priority_changed& - message); virtual bool HandleThreadDeleted( const debug_thread_deleted& message); virtual bool HandleImageCreated( diff --git a/headers/private/kernel/user_debugger.h b/headers/private/kernel/user_debugger.h index 03b4dbb3fb..43d5e9d977 100644 --- a/headers/private/kernel/user_debugger.h +++ b/headers/private/kernel/user_debugger.h @@ -234,8 +234,6 @@ void user_debug_team_deleted(team_id teamID, port_id debuggerPort); void user_debug_team_exec(); void user_debug_update_new_thread_flags(thread_id threadID); void user_debug_thread_created(thread_id threadID); -void user_debug_thread_renamed(thread_id threadID, const char* name); -void user_debug_thread_priority_changed(thread_id threadID, int32 priority); void user_debug_thread_deleted(team_id teamID, thread_id threadID); void user_debug_thread_exiting(struct thread* thread); void user_debug_image_created(const image_info *imageInfo); diff --git a/src/apps/debugger/TeamDebugger.cpp b/src/apps/debugger/TeamDebugger.cpp index e269ed206b..b07f958a32 100644 --- a/src/apps/debugger/TeamDebugger.cpp +++ b/src/apps/debugger/TeamDebugger.cpp @@ -884,25 +884,6 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event) handled = _HandleThreadCreated(threadEvent); break; } - case B_DEBUGGER_MESSAGE_THREAD_RENAMED: - { - ThreadRenamedEvent* threadEvent - = dynamic_cast(event); - TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_RENAMED: thread: %ld " - "(\"%s\")\n", - threadEvent->RenamedThread(), threadEvent->NewName()); - handled = _HandleThreadRenamed(threadEvent); - break; - } - case B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED: - { - ThreadPriorityChangedEvent* threadEvent - = dynamic_cast(event); - TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED: thread:" - " %ld\n", threadEvent->ChangedThread()); - handled = _HandleThreadPriorityChanged(threadEvent); - break; - } case B_DEBUGGER_MESSAGE_THREAD_DELETED: TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_DELETED: thread: %ld\n", event->Thread()); @@ -972,29 +953,6 @@ TeamDebugger::_HandleThreadCreated(ThreadCreatedEvent* event) } -bool -TeamDebugger::_HandleThreadRenamed(ThreadRenamedEvent* event) -{ - AutoLocker< ::Team> locker(fTeam); - - ::Thread* thread = fTeam->ThreadByID(event->RenamedThread()); - - if (thread != NULL) - thread->SetName(event->NewName()); - - return false; -} - - -bool -TeamDebugger::_HandleThreadPriorityChanged(ThreadPriorityChangedEvent*) -{ - // TODO: implement once we actually track thread priorities - - return false; -} - - bool TeamDebugger::_HandleThreadDeleted(ThreadDeletedEvent* event) { diff --git a/src/apps/debugger/TeamDebugger.h b/src/apps/debugger/TeamDebugger.h index ab616c6b7c..ac4181d7d8 100644 --- a/src/apps/debugger/TeamDebugger.h +++ b/src/apps/debugger/TeamDebugger.h @@ -95,10 +95,6 @@ private: bool _HandleThreadCreated( ThreadCreatedEvent* event); - bool _HandleThreadRenamed( - ThreadRenamedEvent* event); - bool _HandleThreadPriorityChanged( - ThreadPriorityChangedEvent* event); bool _HandleThreadDeleted( ThreadDeletedEvent* event); bool _HandleImageCreated( diff --git a/src/apps/debugger/debugger_interface/DebugEvent.cpp b/src/apps/debugger/debugger_interface/DebugEvent.cpp index c62832e452..0891249d44 100644 --- a/src/apps/debugger/debugger_interface/DebugEvent.cpp +++ b/src/apps/debugger/debugger_interface/DebugEvent.cpp @@ -155,32 +155,6 @@ ThreadCreatedEvent::ThreadCreatedEvent(team_id team, thread_id thread, } -// #pragma mark - ThreadRenamedEvent - - -ThreadRenamedEvent::ThreadRenamedEvent(team_id team, thread_id thread, - thread_id renamedThread, const char* newName) - : - DebugEvent(B_DEBUGGER_MESSAGE_THREAD_RENAMED, team, thread), - fRenamedThread(renamedThread) -{ - strlcpy(fName, newName, sizeof(fName)); -} - - -// #pragma mark - ThreadPriorityChangedEvent - - -ThreadPriorityChangedEvent::ThreadPriorityChangedEvent(team_id team, - thread_id thread, thread_id changedThread, int32 newPriority) - : - DebugEvent(B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED, team, thread), - fChangedThread(changedThread), - fNewPriority(newPriority) -{ -} - - // #pragma mark - ThreadDeletedEvent diff --git a/src/apps/debugger/debugger_interface/DebugEvent.h b/src/apps/debugger/debugger_interface/DebugEvent.h index ad673adc1c..f81a5e4ee9 100644 --- a/src/apps/debugger/debugger_interface/DebugEvent.h +++ b/src/apps/debugger/debugger_interface/DebugEvent.h @@ -127,36 +127,6 @@ private: }; -class ThreadRenamedEvent : public DebugEvent { -public: - ThreadRenamedEvent(team_id team, - thread_id thread, thread_id renamedThread, - const char* name); - - thread_id RenamedThread() const { return fRenamedThread; } - const char* NewName() const { return fName; } - -private: - thread_id fRenamedThread; - char fName[B_OS_NAME_LENGTH]; -}; - - -class ThreadPriorityChangedEvent : public DebugEvent { -public: - ThreadPriorityChangedEvent(team_id team, - thread_id thread, thread_id changedThread, - int32 newPriority); - - thread_id ChangedThread() const { return fChangedThread; } - int32 NewPriority() const { return fNewPriority; } - -private: - thread_id fChangedThread; - int32 fNewPriority; -}; - - class ThreadDeletedEvent : public DebugEvent { public: ThreadDeletedEvent(team_id team, diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index 74c2b86ba7..ddcd4f825b 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -670,17 +670,6 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode, event = new(std::nothrow) ThreadCreatedEvent(message.origin.team, message.origin.thread, message.thread_created.new_thread); break; - case B_DEBUGGER_MESSAGE_THREAD_RENAMED: - event = new(std::nothrow) ThreadRenamedEvent(message.origin.team, - message.origin.thread, message.thread_renamed.renamed_thread, - message.thread_renamed.name); - break; - case B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED: - event = new(std::nothrow) ThreadPriorityChangedEvent( - message.origin.team, message.origin.thread, - message.thread_priority_changed.changed_thread, - message.thread_priority_changed.new_priority); - break; case B_DEBUGGER_MESSAGE_THREAD_DELETED: event = new(std::nothrow) ThreadDeletedEvent(message.origin.team, message.origin.thread); diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 21b8af4cc3..f5906b989c 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -168,10 +168,6 @@ TeamWindow::DispatchMessage(BMessage* message, BHandler* handler) && message->FindInt32("modifiers", (int32*)&modifiers) == B_OK) { switch (key) { - case B_F5_KEY: - fListener->ThreadActionRequested( - fActiveThread->ID(), MSG_THREAD_RUN); - break; case B_F10_KEY: fListener->ThreadActionRequested( fActiveThread->ID(), MSG_THREAD_STEP_OVER); diff --git a/src/system/kernel/debug/user_debugger.cpp b/src/system/kernel/debug/user_debugger.cpp index 6ec3e689a8..2ddd89262e 100644 --- a/src/system/kernel/debug/user_debugger.cpp +++ b/src/system/kernel/debug/user_debugger.cpp @@ -1077,48 +1077,6 @@ user_debug_thread_created(thread_id threadID) } -void -user_debug_thread_renamed(thread_id threadID, const char *name) -{ - // check, if a debugger is installed and is interested in thread events - struct thread *thread = thread_get_current_thread(); - int32 teamDebugFlags = atomic_get(&thread->team->debug_info.flags); - if (~teamDebugFlags - & (B_TEAM_DEBUG_DEBUGGER_INSTALLED | B_TEAM_DEBUG_THREADS)) { - return; - } - - // prepare the message - debug_thread_renamed message; - message.renamed_thread = threadID; - strlcpy(message.name, name, sizeof(message.name)); - - thread_hit_debug_event(B_DEBUGGER_MESSAGE_THREAD_RENAMED, &message, - sizeof(message), true); -} - - -void -user_debug_thread_priority_changed(thread_id threadID, int32 priority) -{ - // check, if a debugger is installed and is interested in thread events - struct thread *thread = thread_get_current_thread(); - int32 teamDebugFlags = atomic_get(&thread->team->debug_info.flags); - if (~teamDebugFlags - & (B_TEAM_DEBUG_DEBUGGER_INSTALLED | B_TEAM_DEBUG_THREADS)) { - return; - } - - // prepare the message - debug_thread_priority_changed message; - message.changed_thread = threadID; - message.new_priority = priority; - - thread_hit_debug_event(B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED, &message, - sizeof(message), true); -} - - void user_debug_thread_deleted(team_id teamID, thread_id threadID) { diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index 5636ce4821..0bf3bd55ff 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2559,9 +2559,6 @@ rename_thread(thread_id id, const char *name) RELEASE_THREAD_LOCK(); restore_interrupts(state); - if (status == B_OK) - user_debug_thread_renamed(id, name); - return status; } @@ -2604,8 +2601,6 @@ set_thread_priority(thread_id id, int32 priority) scheduler_set_thread_priority(thread, priority); } - user_debug_thread_priority_changed(id, priority); - return oldPriority; }