Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
d1305884
Commit
d1305884
authored
Oct 06, 2009
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: add option to automatically derefence pointers in locals&watchers
parent
2eed41b6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
16 deletions
+47
-16
src/plugins/debugger/debuggeractions.cpp
src/plugins/debugger/debuggeractions.cpp
+10
-0
src/plugins/debugger/debuggeractions.h
src/plugins/debugger/debuggeractions.h
+1
-0
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+1
-0
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/gdbengine.cpp
+27
-16
src/plugins/debugger/gdb/gdbengine.h
src/plugins/debugger/gdb/gdbengine.h
+2
-0
src/plugins/debugger/idebuggerengine.h
src/plugins/debugger/idebuggerengine.h
+1
-0
src/plugins/debugger/watchwindow.cpp
src/plugins/debugger/watchwindow.cpp
+5
-0
No files found.
src/plugins/debugger/debuggeractions.cpp
View file @
d1305884
...
...
@@ -162,6 +162,16 @@ DebuggerSettings *DebuggerSettings::instance()
"disassembled instructions."
));
instance
->
insertItem
(
OperateByInstruction
,
item
);
item
=
new
SavedAction
(
instance
);
item
->
setText
(
tr
(
"Dereference pointers automatically"
));
item
->
setCheckable
(
true
);
item
->
setDefaultValue
(
true
);
item
->
setToolTip
(
tr
(
"This switches the Locals&Watchers view to "
"automatically derefence pointers. This saves a level in the "
"tree view, but also loses data for the now-missing intermediate "
"level."
));
instance
->
insertItem
(
AutoDerefPointers
,
item
);
//
// Locals & Watchers
//
...
...
src/plugins/debugger/debuggeractions.h
View file @
d1305884
...
...
@@ -78,6 +78,7 @@ enum DebuggerActionCode
LockView
,
LogTimeStamps
,
OperateByInstruction
,
AutoDerefPointers
,
RecheckDebuggingHelpers
,
UseDebuggingHelpers
,
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
d1305884
...
...
@@ -295,6 +295,7 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_ui
.
checkBoxSkipKnownFrames
);
m_group
.
insert
(
theDebuggerAction
(
UseToolTipsInMainEditor
),
m_ui
.
checkBoxUseToolTipsInMainEditor
);
m_group
.
insert
(
theDebuggerAction
(
AutoDerefPointers
),
0
);
m_group
.
insert
(
theDebuggerAction
(
UseToolTipsInLocalsView
),
0
);
m_group
.
insert
(
theDebuggerAction
(
UseToolTipsInBreakpointsView
),
0
);
m_group
.
insert
(
theDebuggerAction
(
UseAddressInBreakpointsView
),
0
);
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
d1305884
...
...
@@ -203,6 +203,9 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
connect
(
this
,
SIGNAL
(
applicationOutputAvailable
(
QString
)),
m_manager
,
SLOT
(
showApplicationOutput
(
QString
)),
Qt
::
QueuedConnection
);
connect
(
theDebuggerAction
(
AutoDerefPointers
),
SIGNAL
(
valueChanged
(
QVariant
)),
this
,
SLOT
(
setAutoDerefPointers
(
QVariant
)));
}
void
GdbEngine
::
connectDebuggingHelperActions
()
...
...
@@ -2703,6 +2706,13 @@ void GdbEngine::setUseDebuggingHelpers(const QVariant &on)
updateLocals
();
}
void
GdbEngine
::
setAutoDerefPointers
(
const
QVariant
&
on
)
{
Q_UNUSED
(
on
)
setTokenBarrier
();
updateLocals
();
}
bool
GdbEngine
::
hasDebuggingHelperForType
(
const
QString
&
type
)
const
{
if
(
!
theDebuggerBoolSetting
(
UseDebuggingHelpers
))
...
...
@@ -2864,22 +2874,23 @@ void GdbEngine::updateSubItem(const WatchData &data0)
#if DEBUG_SUBITEM
qDebug
()
<<
"IT'S A POINTER"
;
#endif
#if 1
data
.
setChildrenUnneeded
();
insertData
(
data
);
WatchData
data1
;
data1
.
iname
=
data
.
iname
+
QLatin1String
(
".*"
);
data1
.
name
=
QLatin1Char
(
'*'
)
+
data
.
name
;
data1
.
exp
=
QLatin1String
(
"(*("
)
+
data
.
exp
+
QLatin1String
(
"))"
);
data1
.
type
=
stripPointerType
(
data
.
type
);
data1
.
setValueNeeded
();
insertData
(
data1
);
#else
// Try automatic dereferentiation
data
.
exp
=
_
(
"*("
)
+
data
.
exp
+
_
(
")"
);
data
.
type
=
data
.
type
+
_
(
"."
);
// FIXME: fragile HACK to avoid recursion
insertData
(
data
);
#endif
if
(
theDebuggerBoolSetting
(
AutoDerefPointers
))
{
// Try automatic dereferentiation
data
.
exp
=
_
(
"(*("
)
+
data
.
exp
+
_
(
"))"
);
data
.
type
=
data
.
type
+
_
(
"."
);
// FIXME: fragile HACK to avoid recursion
insertData
(
data
);
}
else
{
data
.
setChildrenUnneeded
();
insertData
(
data
);
WatchData
data1
;
data1
.
iname
=
data
.
iname
+
QLatin1String
(
".*"
);
data1
.
name
=
QLatin1Char
(
'*'
)
+
data
.
name
;
data1
.
exp
=
QLatin1String
(
"(*("
)
+
data
.
exp
+
QLatin1String
(
"))"
);
data1
.
type
=
stripPointerType
(
data
.
type
);
data1
.
setValueNeeded
();
insertData
(
data1
);
}
return
;
}
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
d1305884
...
...
@@ -147,6 +147,8 @@ private:
Q_SLOT
void
setDebugDebuggingHelpers
(
const
QVariant
&
on
);
Q_SLOT
void
setUseDebuggingHelpers
(
const
QVariant
&
on
);
Q_SLOT
void
setAutoDerefPointers
(
const
QVariant
&
on
);
virtual
bool
isGdbEngine
()
const
{
return
true
;
}
//
// Own stuff
...
...
src/plugins/debugger/idebuggerengine.h
View file @
d1305884
...
...
@@ -116,6 +116,7 @@ public:
{
Q_UNUSED
(
regnr
);
Q_UNUSED
(
value
);
}
virtual
void
addOptionPages
(
QList
<
Core
::
IOptionsPage
*>
*
)
const
{}
virtual
bool
isGdbEngine
()
const
{
return
false
;
}
protected:
void
showStatusMessage
(
const
QString
&
msg
,
int
timeout
=
-
1
);
...
...
src/plugins/debugger/watchwindow.cpp
View file @
d1305884
...
...
@@ -34,6 +34,7 @@
#include "debuggeragents.h"
#include "debuggerdialogs.h"
#include "debuggermanager.h"
#include "idebuggerengine.h"
#include <utils/qtcassert.h>
...
...
@@ -274,6 +275,10 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addSeparator
();
menu
.
addAction
(
theDebuggerAction
(
UseToolTipsInLocalsView
));
menu
.
addAction
(
theDebuggerAction
(
AutoDerefPointers
));
theDebuggerAction
(
AutoDerefPointers
)
->
setEnabled
(
m_manager
->
currentEngine
()
->
isGdbEngine
());
QAction
*
actAdjustColumnWidths
=
menu
.
addAction
(
tr
(
"Adjust column widths to contents"
));
QAction
*
actAlwaysAdjustColumnWidth
=
...
...
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