Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
5560f5e2
Commit
5560f5e2
authored
Apr 30, 2010
by
hjk
Browse files
debugger: make it possible to bulk-assign breakpoints to threads
parent
24d1fbd1
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/breakwindow.cpp
View file @
5560f5e2
...
...
@@ -31,6 +31,7 @@
#include
"debuggeractions.h"
#include
"debuggermanager.h"
#include
"stackhandler.h"
#include
"ui_breakcondition.h"
#include
"ui_breakbyfunction.h"
...
...
@@ -196,6 +197,13 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
new
QAction
(
tr
(
"Edit Breakpoint..."
),
&
menu
);
editBreakpointAction
->
setEnabled
(
si
.
size
()
>
0
);
int
threadId
=
m_manager
->
threadsHandler
()
->
currentThreadId
();
QString
associateTitle
=
threadId
==
-
1
?
tr
(
"Associate Breakpoint With All Threads"
)
:
tr
(
"Associate Breakpoint With Thread %1"
).
arg
(
threadId
);
QAction
*
associateBreakpointAction
=
new
QAction
(
associateTitle
,
&
menu
);
associateBreakpointAction
->
setEnabled
(
si
.
size
()
>
0
);
QAction
*
synchronizeAction
=
new
QAction
(
tr
(
"Synchronize Breakpoints"
),
&
menu
);
synchronizeAction
->
setEnabled
(
...
...
@@ -231,6 +239,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addAction
(
deleteAction
);
menu
.
addAction
(
editBreakpointAction
);
menu
.
addAction
(
associateBreakpointAction
);
menu
.
addAction
(
toggleEnabledAction
);
menu
.
addAction
(
pathAction
);
menu
.
addSeparator
();
...
...
@@ -270,6 +279,8 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
else
if
(
act
==
editBreakpointAction
)
editBreakpoint
(
si
);
else
if
(
act
==
associateBreakpointAction
)
associateBreakpoint
(
si
,
threadId
);
else
if
(
act
==
synchronizeAction
)
emit
breakpointSynchronizationRequested
();
else
if
(
act
==
toggleEnabledAction
)
...
...
@@ -371,6 +382,16 @@ void BreakWindow::editBreakpoint(const QModelIndexList &list)
emit
breakpointSynchronizationRequested
();
}
void
BreakWindow
::
associateBreakpoint
(
const
QModelIndexList
&
list
,
int
threadId
)
{
QString
str
;
if
(
threadId
!=
-
1
)
str
=
QString
::
number
(
threadId
);
foreach
(
const
QModelIndex
&
idx
,
list
)
model
()
->
setData
(
idx
.
sibling
(
idx
.
row
(),
6
),
str
);
emit
breakpointSynchronizationRequested
();
}
void
BreakWindow
::
resizeColumnsToContents
()
{
for
(
int
i
=
model
()
->
columnCount
();
--
i
>=
0
;
)
...
...
src/plugins/debugger/breakwindow.h
View file @
5560f5e2
...
...
@@ -72,6 +72,7 @@ private:
void
deleteBreakpoints
(
const
QModelIndexList
&
list
);
void
deleteBreakpoints
(
QList
<
int
>
rows
);
void
editBreakpoint
(
const
QModelIndexList
&
list
);
void
associateBreakpoint
(
const
QModelIndexList
&
list
,
int
thread
);
void
setBreakpointsEnabled
(
const
QModelIndexList
&
list
,
bool
enabled
);
void
setBreakpointsFullPath
(
const
QModelIndexList
&
list
,
bool
fullpath
);
...
...
src/plugins/debugger/debuggermanager.h
View file @
5560f5e2
...
...
@@ -287,7 +287,7 @@ public slots: // FIXME
void
operateByInstructionTriggered
();
void
startFailed
();
p
rivate
:
p
ublic
:
Internal
::
ModulesHandler
*
modulesHandler
()
const
;
Internal
::
BreakHandler
*
breakHandler
()
const
;
Internal
::
RegisterHandler
*
registerHandler
()
const
;
...
...
@@ -295,6 +295,8 @@ private:
Internal
::
ThreadsHandler
*
threadsHandler
()
const
;
Internal
::
WatchHandler
*
watchHandler
()
const
;
Internal
::
SnapshotHandler
*
snapshotHandler
()
const
;
private:
Internal
::
SourceFilesWindow
*
sourceFileWindow
()
const
;
QWidget
*
threadsWindow
()
const
;
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
5560f5e2
...
...
@@ -2544,15 +2544,13 @@ void GdbEngine::attemptBreakpointSynchronization()
data
->
bpEnabled
=
false
;
continue
;
}
if
(
data
->
threadSpec
!=
data
->
bpThreadSpec
&&
!
data
->
bp
ThreadSpec
.
isEmpty
())
{
if
(
data
->
threadSpec
!=
data
->
bpThreadSpec
&&
!
data
->
bp
Number
.
isEmpty
())
{
// The only way to change this seems to be to re-set the bp completely.
//qDebug() << "FIXME: THREAD: " << data->threadSpec << data->bpThreadSpec;
//data->bpThreadSpec = data->threadSpec;
if
(
!
data
->
bpNumber
.
isEmpty
())
{
postCommand
(
"-break-delete "
+
data
->
bpNumber
,
NeedsStop
|
RebuildBreakpointModel
);
sendInsertBreakpoint
(
index
);
}
data
->
bpThreadSpec
.
clear
();
postCommand
(
"-break-delete "
+
data
->
bpNumber
,
NeedsStop
|
RebuildBreakpointModel
);
sendInsertBreakpoint
(
index
);
continue
;
}
if
(
data
->
bpAddress
.
startsWith
(
"0x"
)
...
...
src/plugins/debugger/stackhandler.cpp
View file @
5560f5e2
...
...
@@ -361,6 +361,13 @@ QVariant ThreadsHandler::headerData(int section, Qt::Orientation orientation, in
return
QVariant
();
}
int
ThreadsHandler
::
currentThreadId
()
const
{
if
(
m_currentIndex
<
0
||
m_currentIndex
>=
m_threads
.
size
())
return
-
1
;
return
m_threads
[
m_currentIndex
].
id
;
}
void
ThreadsHandler
::
setCurrentThread
(
int
index
)
{
if
(
index
==
m_currentIndex
)
...
...
src/plugins/debugger/stackhandler.h
View file @
5560f5e2
...
...
@@ -119,6 +119,7 @@ class ThreadsHandler : public QAbstractTableModel
public:
ThreadsHandler
(
QObject
*
parent
=
0
);
int
currentThreadId
()
const
;
void
setCurrentThread
(
int
index
);
void
selectThread
(
int
index
);
void
setThreads
(
const
QList
<
ThreadData
>
&
threads
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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