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
63eaf1e1
Commit
63eaf1e1
authored
Dec 21, 2010
by
hjk
Browse files
debugger: add an option to load "missing" symbols for current stack
parent
dc921cc5
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/cdb/cdbmodules.cpp
View file @
63eaf1e1
...
...
@@ -74,13 +74,12 @@ bool getModuleNameList(CIDebugSymbols *syms, QStringList *modules, QString *erro
static
inline
void
getBasicModuleParameters
(
const
DEBUG_MODULE_PARAMETERS
&
p
,
Module
*
module
)
{
const
QString
hexPrefix
=
QLatin1String
(
"0x"
);
if
((
p
.
Flags
&
DEBUG_MODULE_USER_MODE
)
&&
(
p
.
SymbolType
!=
DEBUG_SYMTYPE_NONE
))
module
->
symbolsRead
=
Module
::
ReadOk
;
else
module
->
symbolsRead
=
Module
::
ReadFailed
;
module
->
startAddress
=
hexPrefix
+
QString
::
number
(
p
.
Base
,
16
)
;
module
->
endAddress
=
hexPrefix
+
QString
::
number
((
p
.
Base
+
p
.
Size
),
16
)
;
module
->
startAddress
=
p
.
Base
;
module
->
endAddress
=
p
.
Base
+
p
.
Size
;
}
// Get module name by index
...
...
src/plugins/debugger/cdb2/cdbengine2.cpp
View file @
63eaf1e1
...
...
@@ -1164,8 +1164,8 @@ void CdbEngine::handleModules(const CdbExtensionCommandPtr &reply)
Debugger
::
Internal
::
Module
module
;
module
.
moduleName
=
QString
::
fromAscii
(
gdbmiModule
.
findChild
(
"name"
).
data
());
module
.
modulePath
=
QString
::
fromAscii
(
gdbmiModule
.
findChild
(
"image"
).
data
());
module
.
startAddress
=
QString
::
fromAscii
(
gdbmiModule
.
findChild
(
"start"
).
data
());
module
.
endAddress
=
QString
::
fromAscii
(
gdbmiModule
.
findChild
(
"end"
).
data
());
module
.
startAddress
=
gdbmiModule
.
findChild
(
"start"
).
data
()
.
toULongLong
(
0
,
0
);
module
.
endAddress
=
gdbmiModule
.
findChild
(
"end"
).
data
()
.
toULongLong
(
0
,
0
);
if
(
gdbmiModule
.
findChild
(
"deferred"
).
type
()
==
Debugger
::
Internal
::
GdbMi
::
Invalid
)
module
.
symbolsRead
=
Debugger
::
Internal
::
Module
::
ReadOk
;
modules
.
push_back
(
module
);
...
...
src/plugins/debugger/debuggerengine.cpp
View file @
63eaf1e1
...
...
@@ -1182,6 +1182,10 @@ void DebuggerEngine::loadAllSymbols()
{
}
void
DebuggerEngine
::
loadSymbolsForStack
()
{
}
void
DebuggerEngine
::
requestModuleSymbols
(
const
QString
&
)
{
}
...
...
src/plugins/debugger/debuggerengine.h
View file @
63eaf1e1
...
...
@@ -214,6 +214,7 @@ public:
virtual
void
reloadModules
();
virtual
void
examineModules
();
virtual
void
loadSymbols
(
const
QString
&
moduleName
);
virtual
void
loadSymbolsForStack
();
virtual
void
loadAllSymbols
();
virtual
void
requestModuleSymbols
(
const
QString
&
moduleName
);
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
63eaf1e1
...
...
@@ -2630,6 +2630,30 @@ void GdbEngine::loadAllSymbols()
updateLocals
();
}
void
GdbEngine
::
loadSymbolsForStack
()
{
bool
needUpdate
=
false
;
const
Modules
&
modules
=
modulesHandler
()
->
modules
();
foreach
(
const
StackFrame
&
frame
,
stackHandler
()
->
frames
())
{
if
(
frame
.
function
==
_
(
"??"
))
{
qDebug
()
<<
"LOAD FOR "
<<
frame
.
address
;
foreach
(
const
Module
&
module
,
modules
)
{
if
(
module
.
startAddress
<=
frame
.
address
&&
frame
.
address
<
module
.
endAddress
)
{
postCommand
(
"sharedlibrary "
+
dotEscape
(
module
.
moduleName
.
toLocal8Bit
()));
needUpdate
=
true
;
}
}
}
}
if
(
needUpdate
)
{
reloadModulesInternal
();
reloadStack
(
true
);
updateLocals
();
}
}
void
GdbEngine
::
requestModuleSymbols
(
const
QString
&
moduleName
)
{
QTemporaryFile
tf
(
QDir
::
tempPath
()
+
_
(
"/gdbsymbols"
));
...
...
@@ -2756,12 +2780,13 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
// shlib-info={...}...
foreach
(
const
GdbMi
&
item
,
response
.
data
.
children
())
{
Module
module
;
module
.
moduleName
=
QString
::
fromLocal8Bit
(
item
.
findChild
(
"path"
).
data
());
module
.
moduleName
=
QString
::
fromLocal8Bit
(
item
.
findChild
(
"path"
).
data
());
module
.
symbolsRead
=
(
item
.
findChild
(
"state"
).
data
()
==
"Y"
)
?
Module
::
ReadOk
:
Module
::
ReadFailed
;
module
.
startAddress
=
_
(
item
.
findChild
(
"loaded_addr"
).
data
());
//: End address of loaded module
module
.
endAddress
=
tr
(
"<unknown>"
,
"address"
);
module
.
startAddress
=
item
.
findChild
(
"loaded_addr"
).
data
().
toULongLong
(
0
,
0
);
module
.
endAddress
=
0
;
// FIXME: End address not easily available.
modules
.
append
(
module
);
}
}
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
63eaf1e1
...
...
@@ -377,6 +377,7 @@ private: ////////// View & Data Stuff //////////
//
void
loadSymbols
(
const
QString
&
moduleName
);
void
loadAllSymbols
();
void
loadSymbolsForStack
();
void
requestModuleSymbols
(
const
QString
&
moduleName
);
void
reloadModules
();
void
examineModules
();
...
...
src/plugins/debugger/moduleshandler.cpp
View file @
63eaf1e1
...
...
@@ -107,11 +107,17 @@ QVariant ModulesModel::data(const QModelIndex &index, int role) const
break
;
case
4
:
if
(
role
==
Qt
::
DisplayRole
)
return
module
.
startAddress
;
return
QString
(
QLatin1String
(
"0x"
)
+
QString
::
number
(
module
.
startAddress
,
16
));
break
;
case
5
:
if
(
role
==
Qt
::
DisplayRole
)
return
module
.
endAddress
;
if
(
role
==
Qt
::
DisplayRole
)
{
if
(
module
.
endAddress
)
return
QString
(
QLatin1String
(
"0x"
)
+
QString
::
number
(
module
.
endAddress
,
16
));
//: End address of loaded module
return
tr
(
"<unknown>"
,
"address"
);
}
break
;
}
return
QVariant
();
...
...
src/plugins/debugger/moduleshandler.h
View file @
63eaf1e1
...
...
@@ -90,8 +90,8 @@ public:
QString
modulePath
;
SymbolReadState
symbolsRead
;
SymbolType
symbolsType
;
QString
startAddress
;
QString
endAddress
;
quint64
startAddress
;
quint64
endAddress
;
};
typedef
QVector
<
Module
>
Modules
;
...
...
src/plugins/debugger/stackwindow.cpp
View file @
63eaf1e1
...
...
@@ -143,6 +143,10 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
actShowDisassembler
->
setEnabled
(
engineCapabilities
&
DisassemblerCapability
);
}
QAction
*
actLoadSymbols
=
0
;
if
(
engineCapabilities
&
ShowModuleSymbolsCapability
)
actLoadSymbols
=
menu
.
addAction
(
tr
(
"Try to Load Unknown Symbols"
));
menu
.
addSeparator
();
#if 0 // @TODO: not implemented
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
...
...
@@ -162,7 +166,9 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction
*
act
=
menu
.
exec
(
ev
->
globalPos
());
if
(
act
==
actCopyContents
)
if
(
!
act
)
;
else
if
(
act
==
actCopyContents
)
copyContentsToClipboard
();
else
if
(
act
==
actAdjust
)
resizeColumnsToContents
();
...
...
@@ -172,6 +178,8 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
engine
->
openMemoryView
(
address
);
else
if
(
act
==
actShowDisassembler
)
engine
->
openDisassemblerView
(
frame
);
else
if
(
act
==
actLoadSymbols
)
engine
->
loadSymbolsForStack
();
}
void
StackWindow
::
copyContentsToClipboard
()
...
...
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