Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
15ee289e
Commit
15ee289e
authored
Nov 25, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make breakpoint and watchers view more robust when switching sessions
parent
28b3fa11
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
32 deletions
+32
-32
src/plugins/debugger/breakhandler.cpp
src/plugins/debugger/breakhandler.cpp
+12
-1
src/plugins/debugger/breakhandler.h
src/plugins/debugger/breakhandler.h
+1
-0
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+2
-2
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+17
-28
src/plugins/debugger/watchhandler.h
src/plugins/debugger/watchhandler.h
+0
-1
No files found.
src/plugins/debugger/breakhandler.cpp
View file @
15ee289e
...
...
@@ -781,6 +781,15 @@ void BreakHandler::loadSessionData()
loadBreakpoints
();
}
void
BreakHandler
::
removeSessionData
()
{
Iterator
it
=
m_storage
.
begin
(),
et
=
m_storage
.
end
();
for
(
;
it
!=
et
;
++
it
)
it
->
destroyMarker
();
m_storage
.
clear
();
layoutChanged
();
}
void
BreakHandler
::
breakByFunction
(
const
QString
&
functionName
)
{
// One breakpoint per function is enough for now. This does not handle
...
...
@@ -801,7 +810,9 @@ void BreakHandler::breakByFunction(const QString &functionName)
QIcon
BreakHandler
::
icon
(
BreakpointId
id
)
const
{
ConstIterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
pendingBreakPointIcon
());
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
qDebug
()
<<
"NO ICON FOR ID"
<<
id
;
return
pendingBreakPointIcon
());
return
it
->
icon
();
}
...
...
src/plugins/debugger/breakhandler.h
View file @
15ee289e
...
...
@@ -61,6 +61,7 @@ public:
void
loadSessionData
();
void
saveSessionData
();
void
removeSessionData
();
QAbstractItemModel
*
model
()
{
return
this
;
}
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
15ee289e
...
...
@@ -977,7 +977,7 @@ public slots:
for
(
int
i
=
0
,
n
=
m_snapshotHandler
->
size
();
i
!=
n
;
++
i
)
{
if
(
DebuggerRunControl
*
runControl
=
m_snapshotHandler
->
at
(
i
))
{
DebuggerEngine
*
engine
=
runControl
->
engine
();
engine
->
watchHandler
()
->
synchroniz
eWatchers
();
engine
->
watchHandler
()
->
updat
eWatchers
();
}
}
}
...
...
@@ -3000,11 +3000,11 @@ void DebuggerPluginPrivate::sessionLoaded()
{
m_breakHandler
->
loadSessionData
();
dummyEngine
()
->
watchHandler
()
->
loadSessionData
();
synchronizeWatchers
();
}
void
DebuggerPluginPrivate
::
aboutToUnloadSession
()
{
m_breakHandler
->
removeSessionData
();
// Stop debugging the active project when switching sessions.
// Note that at startup, session switches may occur, which interfere
// with command-line debugging startup.
...
...
src/plugins/debugger/watchhandler.cpp
View file @
15ee289e
...
...
@@ -1212,8 +1212,8 @@ QByteArray WatchHandler::watcherName(const QByteArray &exp)
void
WatchHandler
::
watchExpression
(
const
QString
&
exp
)
{
QTC_ASSERT
(
m_engine
,
return
);
// Do not insert
multiple placeholders
.
if
(
exp
.
isEmpty
()
&&
m_watcherNames
.
contains
(
QByteArray
()))
// Do not insert
the same entry more then once
.
if
(
m_watcherNames
.
value
(
exp
.
toLatin1
()))
return
;
// FIXME: 'exp' can contain illegal characters
...
...
@@ -1343,11 +1343,11 @@ void WatchHandler::removeWatchExpression(const QString &exp0)
if
(
item
->
exp
==
exp
)
{
m_watchers
->
destroyItem
(
item
);
saveWatchers
();
updateWatchersWindow
();
emitAllChanged
();
break
;
}
}
emitAllChanged
();
updateWatchersWindow
();
}
void
WatchHandler
::
updateWatchersWindow
()
...
...
@@ -1356,27 +1356,6 @@ void WatchHandler::updateWatchersWindow()
debuggerCore
()
->
updateWatchersWindow
();
}
void
WatchHandler
::
updateWatchers
()
{
// Copy over all watchers and mark all watchers as incomplete.
foreach
(
const
QByteArray
&
exp
,
m_watcherNames
.
keys
())
{
WatchData
data
;
data
.
iname
=
watcherName
(
exp
);
data
.
setAllNeeded
();
data
.
name
=
exp
;
data
.
exp
=
exp
;
insertData
(
data
);
}
}
void
WatchHandler
::
loadWatchers
()
{
m_watcherNames
.
clear
();
QVariant
value
=
debuggerCore
()
->
sessionValue
(
"Watchers"
);
foreach
(
const
QString
&
exp
,
value
.
toStringList
())
watchExpression
(
exp
);
}
QStringList
WatchHandler
::
watchedExpressions
()
{
// Filter out invalid watchers.
...
...
@@ -1432,16 +1411,26 @@ void WatchHandler::saveSessionData()
void
WatchHandler
::
loadSessionData
()
{
loadWatchers
();
loadTypeFormats
();
m_watcherNames
.
clear
();
QVariant
value
=
debuggerCore
()
->
sessionValue
(
"Watchers"
);
foreach
(
WatchItem
*
item
,
m_watchers
->
rootItem
()
->
children
)
m_watchers
->
destroyItem
(
item
);
foreach
(
const
QString
&
exp
,
value
.
toStringList
())
watchExpression
(
exp
);
updateWatchersWindow
();
emitAllChanged
();
}
void
WatchHandler
::
synchroniz
eWatchers
()
void
WatchHandler
::
updat
eWatchers
()
{
foreach
(
WatchItem
*
item
,
m_watchers
->
rootItem
()
->
children
)
m_watchers
->
destroyItem
(
item
);
// Copy over all watchers and mark all watchers as incomplete.
foreach
(
const
QByteArray
&
exp
,
m_watcherNames
.
keys
())
{
WatchData
data
;
data
.
iname
=
watcherName
(
exp
);
data
.
setAll
Unn
eeded
();
data
.
setAll
N
eeded
();
data
.
name
=
exp
;
data
.
exp
=
exp
;
insertData
(
data
);
...
...
src/plugins/debugger/watchhandler.h
View file @
15ee289e
...
...
@@ -182,7 +182,6 @@ public:
private:
friend
class
WatchModel
;
void
loadWatchers
();
void
saveWatchers
();
static
void
loadTypeFormats
();
static
void
saveTypeFormats
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment