diff --git a/debugger/framestack/framestackmodel.h b/debugger/framestack/framestackmodel.h --- a/debugger/framestack/framestackmodel.h +++ b/debugger/framestack/framestackmodel.h @@ -85,6 +85,9 @@ void fetchMoreFrames() override; + void setCrashedThreadIndex(int index); + int crashedThreadIndex() const; + private Q_SLOTS: void stateChanged(KDevelop::IDebugSession::DebuggerState state); @@ -96,6 +99,9 @@ int m_currentThread; int m_currentFrame; + + int m_crashedThreadIndex; + // used to count how often a user has scrolled down and more frames needed to be fetched; // this way, the number of frames fetched in each chunk can be increased if the user wants // to scroll far diff --git a/debugger/framestack/framestackmodel.cpp b/debugger/framestack/framestackmodel.cpp --- a/debugger/framestack/framestackmodel.cpp +++ b/debugger/framestack/framestackmodel.cpp @@ -25,6 +25,7 @@ #include #include +#include #include "../../interfaces/icore.h" #include "../../interfaces/idebugcontroller.h" @@ -38,6 +39,7 @@ : IFrameStackModel(session) , m_currentThread(-1) , m_currentFrame(-1) + , m_crashedThreadIndex(-1) , m_subsequentFrameFetchOperations(0) , m_updateCurrentFrameOnNextFetch(false) { @@ -145,6 +147,11 @@ if (index.column() == 0) { if (role == Qt::DisplayRole) { return i18nc("#thread-id at function-name or address", "#%1 at %2", thread.nr, thread.name); + } else if (role == Qt::TextColorRole) { + if (thread.nr == m_crashedThreadIndex) { + KColorScheme scheme(QPalette::Active); + return scheme.foreground(KColorScheme::NegativeText).color(); + } } } } else { @@ -263,6 +270,15 @@ setCurrentThread(m_threads[index.row()].nr); } +void FrameStackModel::setCrashedThreadIndex(int index) +{ + m_crashedThreadIndex = index; +} + +int FrameStackModel::crashedThreadIndex() const +{ + return m_crashedThreadIndex; +} int FrameStackModel::currentThread() const {