Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
7cd32722
Commit
7cd32722
authored
Dec 08, 2010
by
hjk
Browse files
debugger: make memory view updatable
Task-number: QTCREATORBUG-3242
parent
cfd2dbb3
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerconstants.h
View file @
7cd32722
...
...
@@ -84,6 +84,7 @@ namespace Internal {
const
char
*
const
OPENED_BY_DEBUGGER
=
"OpenedByDebugger"
;
const
char
*
const
OPENED_WITH_DISASSEMBLY
=
"DisassemblerView"
;
const
char
*
const
OPENED_WITH_MEMORY
=
"MemoryView"
;
const
char
*
const
DEBUGMODE
=
"Debugger.DebugMode"
;
const
char
*
const
DEBUG
=
"Debugger.Debug"
;
...
...
src/plugins/debugger/debuggercore.h
View file @
7cd32722
...
...
@@ -114,6 +114,7 @@ public:
virtual
void
showModuleSymbols
(
const
QString
&
moduleName
,
const
QVector
<
Symbol
>
&
symbols
)
=
0
;
virtual
void
openMemoryEditor
()
=
0
;
virtual
void
updateMemoryEditors
()
=
0
;
virtual
void
languagesChanged
()
=
0
;
virtual
Utils
::
SavedAction
*
action
(
int
code
)
const
=
0
;
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
7cd32722
...
...
@@ -1027,6 +1027,7 @@ public slots:
void
languagesChanged
();
void
showStatusMessage
(
const
QString
&
msg
,
int
timeout
=
-
1
);
void
openMemoryEditor
();
void
updateMemoryEditors
();
const
CPlusPlus
::
Snapshot
&
cppCodeModelSnapshot
()
const
;
...
...
@@ -2433,6 +2434,16 @@ void DebuggerPluginPrivate::openMemoryEditor()
currentEngine
()
->
openMemoryView
(
dialog
.
address
());
}
void
DebuggerPluginPrivate
::
updateMemoryEditors
()
{
EditorManager
*
editorManager
=
EditorManager
::
instance
();
QTC_ASSERT
(
editorManager
,
return
);
foreach
(
IEditor
*
editor
,
editorManager
->
openedEditors
())
{
if
(
editor
->
property
(
Constants
::
OPENED_WITH_MEMORY
).
toBool
())
QMetaObject
::
invokeMethod
(
editor
->
widget
(),
"updateContents"
);
}
}
void
DebuggerPluginPrivate
::
coreShutdown
()
{
m_shuttingDown
=
true
;
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
7cd32722
...
...
@@ -3530,6 +3530,7 @@ void GdbEngine::updateLocals(const QVariant &cookie)
updateLocalsPython
(
false
,
QByteArray
());
else
updateLocalsClassic
(
cookie
);
debuggerCore
()
->
updateMemoryEditors
();
}
...
...
src/plugins/debugger/memoryagent.cpp
View file @
7cd32722
...
...
@@ -87,6 +87,8 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
Core
::
Constants
::
K_DEFAULT_BINARY_EDITOR_ID
,
&
titlePattern
);
if
(
editor
)
{
editor
->
setProperty
(
Debugger
::
Constants
::
OPENED_BY_DEBUGGER
,
true
);
editor
->
setProperty
(
Debugger
::
Constants
::
OPENED_WITH_MEMORY
,
true
);
connect
(
editor
->
widget
(),
SIGNAL
(
lazyDataRequested
(
Core
::
IEditor
*
,
quint64
,
bool
)),
SLOT
(
fetchLazyData
(
Core
::
IEditor
*
,
quint64
,
bool
)));
...
...
@@ -103,7 +105,6 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
SIGNAL
(
endOfFileRequested
(
Core
::
IEditor
*
)),
SLOT
(
handleEndOfFileRequested
(
Core
::
IEditor
*
)));
m_editors
<<
editor
;
editorManager
->
activateEditor
(
editor
);
QMetaObject
::
invokeMethod
(
editor
->
widget
(),
"setNewWindowRequestAllowed"
);
QMetaObject
::
invokeMethod
(
editor
->
widget
(),
"setLazyData"
,
Q_ARG
(
quint64
,
addr
),
Q_ARG
(
int
,
DataRange
),
Q_ARG
(
int
,
BinBlockSize
));
...
...
tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp
View file @
7cd32722
...
...
@@ -1859,6 +1859,13 @@ public:
Foo
*
f
;
};
void
testMemoryView
()
{
int
a
[
20
];
for
(
int
i
=
0
;
i
!=
20
;
++
i
)
a
[
i
]
=
i
;
}
void
testUninitialized
()
{
QString
s
;
...
...
@@ -2111,6 +2118,7 @@ void testQSettings()
int
main
(
int
argc
,
char
*
argv
[])
{
testMemoryView
();
//testQSettings();
//testWCout0();
//testWCout();
...
...
Write
Preview
Supports
Markdown
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