forked from qt-creator/qt-creator
Debugger: Use more FilePaths in module handling interface
Change-Id: Ie058b928900015d0f71776151547bf7ba32a62bf Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1441,15 +1441,16 @@ void CdbEngine::reloadModules()
|
||||
runCommand({"modules", ExtensionCommand, CB(handleModules)});
|
||||
}
|
||||
|
||||
void CdbEngine::loadSymbols(const QString & /* moduleName */)
|
||||
void CdbEngine::loadSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
|
||||
void CdbEngine::loadAllSymbols()
|
||||
{
|
||||
}
|
||||
|
||||
void CdbEngine::requestModuleSymbols(const QString &moduleName)
|
||||
void CdbEngine::requestModuleSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
|
@@ -65,9 +65,9 @@ public:
|
||||
void changeMemory(MemoryAgent *, quint64 addr, const QByteArray &data) override;
|
||||
|
||||
void reloadModules() override;
|
||||
void loadSymbols(const QString &moduleName) override;
|
||||
void loadSymbols(const Utils::FilePath &moduleName) override;
|
||||
void loadAllSymbols() override;
|
||||
void requestModuleSymbols(const QString &moduleName) override;
|
||||
void requestModuleSymbols(const Utils::FilePath &moduleName) override;
|
||||
|
||||
void reloadRegisters() override;
|
||||
void reloadSourceFiles() override;
|
||||
|
@@ -2083,7 +2083,7 @@ void DebuggerEngine::examineModules()
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerEngine::loadSymbols(const QString &)
|
||||
void DebuggerEngine::loadSymbols(const FilePath &)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2095,11 +2095,11 @@ void DebuggerEngine::loadSymbolsForStack()
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerEngine::requestModuleSymbols(const QString &)
|
||||
void DebuggerEngine::requestModuleSymbols(const FilePath &)
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerEngine::requestModuleSections(const QString &)
|
||||
void DebuggerEngine::requestModuleSections(const FilePath &)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2652,7 +2652,7 @@ static void createNewDock(QWidget *widget)
|
||||
dockWidget->show();
|
||||
}
|
||||
|
||||
void DebuggerEngine::showModuleSymbols(const QString &moduleName, const Symbols &symbols)
|
||||
void DebuggerEngine::showModuleSymbols(const FilePath &moduleName, const Symbols &symbols)
|
||||
{
|
||||
auto w = new QTreeWidget;
|
||||
w->setUniformRowHeights(true);
|
||||
@@ -2660,7 +2660,7 @@ void DebuggerEngine::showModuleSymbols(const QString &moduleName, const Symbols
|
||||
w->setRootIsDecorated(false);
|
||||
w->setAlternatingRowColors(true);
|
||||
w->setSortingEnabled(true);
|
||||
w->setObjectName("Symbols." + moduleName);
|
||||
w->setObjectName("Symbols." + moduleName.toFSPathString());
|
||||
QStringList header;
|
||||
header.append(Tr::tr("Symbol"));
|
||||
header.append(Tr::tr("Address"));
|
||||
@@ -2668,7 +2668,7 @@ void DebuggerEngine::showModuleSymbols(const QString &moduleName, const Symbols
|
||||
header.append(Tr::tr("Section"));
|
||||
header.append(Tr::tr("Name"));
|
||||
w->setHeaderLabels(header);
|
||||
w->setWindowTitle(Tr::tr("Symbols in \"%1\"").arg(moduleName));
|
||||
w->setWindowTitle(Tr::tr("Symbols in \"%1\"").arg(moduleName.toUserOutput()));
|
||||
for (const Symbol &s : symbols) {
|
||||
auto it = new QTreeWidgetItem;
|
||||
it->setData(0, Qt::DisplayRole, s.name);
|
||||
@@ -2681,7 +2681,7 @@ void DebuggerEngine::showModuleSymbols(const QString &moduleName, const Symbols
|
||||
createNewDock(w);
|
||||
}
|
||||
|
||||
void DebuggerEngine::showModuleSections(const QString &moduleName, const Sections §ions)
|
||||
void DebuggerEngine::showModuleSections(const FilePath &moduleName, const Sections §ions)
|
||||
{
|
||||
auto w = new QTreeWidget;
|
||||
w->setUniformRowHeights(true);
|
||||
@@ -2689,7 +2689,7 @@ void DebuggerEngine::showModuleSections(const QString &moduleName, const Section
|
||||
w->setRootIsDecorated(false);
|
||||
w->setAlternatingRowColors(true);
|
||||
w->setSortingEnabled(true);
|
||||
w->setObjectName("Sections." + moduleName);
|
||||
w->setObjectName("Sections." + moduleName.toFSPathString());
|
||||
QStringList header;
|
||||
header.append(Tr::tr("Name"));
|
||||
header.append(Tr::tr("From"));
|
||||
@@ -2697,7 +2697,7 @@ void DebuggerEngine::showModuleSections(const QString &moduleName, const Section
|
||||
header.append(Tr::tr("Address"));
|
||||
header.append(Tr::tr("Flags"));
|
||||
w->setHeaderLabels(header);
|
||||
w->setWindowTitle(Tr::tr("Sections in \"%1\"").arg(moduleName));
|
||||
w->setWindowTitle(Tr::tr("Sections in \"%1\"").arg(moduleName.toUserOutput()));
|
||||
for (const Section &s : sections) {
|
||||
auto it = new QTreeWidgetItem;
|
||||
it->setData(0, Qt::DisplayRole, s.name);
|
||||
|
@@ -303,11 +303,11 @@ public:
|
||||
|
||||
virtual void reloadModules();
|
||||
virtual void examineModules();
|
||||
virtual void loadSymbols(const QString &moduleName);
|
||||
virtual void loadSymbols(const Utils::FilePath &moduleName);
|
||||
virtual void loadSymbolsForStack();
|
||||
virtual void loadAllSymbols();
|
||||
virtual void requestModuleSymbols(const QString &moduleName);
|
||||
virtual void requestModuleSections(const QString &moduleName);
|
||||
virtual void requestModuleSymbols(const Utils::FilePath &moduleName);
|
||||
virtual void requestModuleSections(const Utils::FilePath &moduleName);
|
||||
|
||||
virtual void reloadRegisters();
|
||||
virtual void reloadPeripheralRegisters();
|
||||
@@ -452,8 +452,8 @@ public:
|
||||
|
||||
void openMemoryEditor();
|
||||
|
||||
static void showModuleSymbols(const QString &moduleName, const QVector<Symbol> &symbols);
|
||||
static void showModuleSections(const QString &moduleName, const QVector<Section> §ions);
|
||||
static void showModuleSymbols(const Utils::FilePath &moduleName, const QVector<Symbol> &symbols);
|
||||
static void showModuleSections(const Utils::FilePath &moduleName, const QVector<Section> §ions);
|
||||
|
||||
void handleExecDetach();
|
||||
void handleExecContinue();
|
||||
|
@@ -2783,10 +2783,10 @@ static QString dotEscape(QString str)
|
||||
return str;
|
||||
}
|
||||
|
||||
void GdbEngine::loadSymbols(const QString &modulePath)
|
||||
void GdbEngine::loadSymbols(const FilePath &modulePath)
|
||||
{
|
||||
// FIXME: gdb does not understand quoted names here (tested with 6.8)
|
||||
runCommand({"sharedlibrary " + dotEscape(modulePath)});
|
||||
runCommand({"sharedlibrary " + dotEscape(modulePath.path())});
|
||||
reloadModulesInternal();
|
||||
reloadStack();
|
||||
updateLocals();
|
||||
@@ -2824,7 +2824,7 @@ void GdbEngine::loadSymbolsForStack()
|
||||
}
|
||||
|
||||
static void handleShowModuleSymbols(const DebuggerResponse &response,
|
||||
const QString &modulePath, const QString &fileName)
|
||||
const FilePath &modulePath, const QString &fileName)
|
||||
{
|
||||
if (response.resultClass == ResultDone) {
|
||||
Symbols symbols;
|
||||
@@ -2883,21 +2883,21 @@ static void handleShowModuleSymbols(const DebuggerResponse &response,
|
||||
}
|
||||
}
|
||||
|
||||
void GdbEngine::requestModuleSymbols(const QString &modulePath)
|
||||
void GdbEngine::requestModuleSymbols(const FilePath &modulePath)
|
||||
{
|
||||
Utils::TemporaryFile tf("gdbsymbols");
|
||||
TemporaryFile tf("gdbsymbols");
|
||||
if (!tf.open())
|
||||
return;
|
||||
QString fileName = tf.fileName();
|
||||
tf.close();
|
||||
DebuggerCommand cmd("maint print msymbols \"" + fileName + "\" " + modulePath, NeedsTemporaryStop);
|
||||
DebuggerCommand cmd("maint print msymbols \"" + fileName + "\" " + modulePath.path(), NeedsTemporaryStop);
|
||||
cmd.callback = [modulePath, fileName](const DebuggerResponse &r) {
|
||||
handleShowModuleSymbols(r, modulePath, fileName);
|
||||
};
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
void GdbEngine::requestModuleSections(const QString &moduleName)
|
||||
void GdbEngine::requestModuleSections(const FilePath &moduleName)
|
||||
{
|
||||
// There seems to be no way to get the symbols from a single .so.
|
||||
DebuggerCommand cmd("maint info section ALLOBJ", NeedsTemporaryStop);
|
||||
@@ -2908,14 +2908,14 @@ void GdbEngine::requestModuleSections(const QString &moduleName)
|
||||
}
|
||||
|
||||
void GdbEngine::handleShowModuleSections(const DebuggerResponse &response,
|
||||
const QString &moduleName)
|
||||
const FilePath &moduleName)
|
||||
{
|
||||
// ~" Object file: /usr/lib/i386-linux-gnu/libffi.so.6\n"
|
||||
// ~" 0xb44a6114->0xb44a6138 at 0x00000114: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS\n"
|
||||
if (response.resultClass == ResultDone) {
|
||||
const QStringList lines = response.consoleStreamOutput.split('\n');
|
||||
const QString prefix = " Object file: ";
|
||||
const QString needle = prefix + moduleName;
|
||||
const QString needle = prefix + moduleName.path();
|
||||
Sections sections;
|
||||
bool active = false;
|
||||
for (const QString &line : std::as_const(lines)) {
|
||||
|
@@ -216,17 +216,17 @@ private: ////////// General Interface //////////
|
||||
//
|
||||
// Modules specific stuff
|
||||
//
|
||||
void loadSymbols(const QString &moduleName) final;
|
||||
void loadSymbols(const Utils::FilePath &moduleName) final;
|
||||
void loadAllSymbols() final;
|
||||
void loadSymbolsForStack() final;
|
||||
void requestModuleSymbols(const QString &moduleName) final;
|
||||
void requestModuleSections(const QString &moduleName) final;
|
||||
void requestModuleSymbols(const Utils::FilePath &moduleName) final;
|
||||
void requestModuleSections(const Utils::FilePath &moduleName) final;
|
||||
void reloadModules() final;
|
||||
void examineModules() final;
|
||||
|
||||
void reloadModulesInternal();
|
||||
void handleModulesList(const DebuggerResponse &response);
|
||||
void handleShowModuleSections(const DebuggerResponse &response, const QString &moduleName);
|
||||
void handleShowModuleSections(const DebuggerResponse &response, const Utils::FilePath &moduleName);
|
||||
|
||||
//
|
||||
// Snapshot specific stuff
|
||||
|
@@ -630,7 +630,7 @@ void LldbEngine::handleInterpreterBreakpointModified(const GdbMi &bpItem)
|
||||
updateBreakpointData(bp, bpItem, false);
|
||||
}
|
||||
|
||||
void LldbEngine::loadSymbols(const QString &moduleName)
|
||||
void LldbEngine::loadSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
@@ -660,13 +660,13 @@ void LldbEngine::reloadModules()
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
void LldbEngine::requestModuleSymbols(const QString &moduleName)
|
||||
void LldbEngine::requestModuleSymbols(const FilePath &moduleName)
|
||||
{
|
||||
DebuggerCommand cmd("fetchSymbols");
|
||||
cmd.arg("module", moduleName);
|
||||
cmd.arg("module", moduleName.path());
|
||||
cmd.callback = [moduleName](const DebuggerResponse &response) {
|
||||
const GdbMi &symbols = response.data["symbols"];
|
||||
QString moduleName = response.data["module"].data();
|
||||
const QString module = response.data["module"].data();
|
||||
Symbols syms;
|
||||
for (const GdbMi &item : symbols) {
|
||||
Symbol symbol;
|
||||
@@ -677,7 +677,7 @@ void LldbEngine::requestModuleSymbols(const QString &moduleName)
|
||||
symbol.demangled = item["demangled"].data();
|
||||
syms.append(symbol);
|
||||
}
|
||||
showModuleSymbols(moduleName, syms);
|
||||
showModuleSymbols(moduleName.withNewPath(module), syms);
|
||||
};
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
@@ -68,9 +68,9 @@ private:
|
||||
void assignValueInDebugger(WatchItem *item, const QString &expr, const QVariant &value) override;
|
||||
void executeDebuggerCommand(const QString &command) override;
|
||||
|
||||
void loadSymbols(const QString &moduleName) override;
|
||||
void loadSymbols(const Utils::FilePath &moduleName) override;
|
||||
void loadAllSymbols() override;
|
||||
void requestModuleSymbols(const QString &moduleName) override;
|
||||
void requestModuleSymbols(const Utils::FilePath &moduleName) override;
|
||||
void reloadModules() override;
|
||||
void reloadRegisters() override;
|
||||
void reloadSourceFiles() override {}
|
||||
|
@@ -263,7 +263,7 @@ void PdbEngine::removeBreakpoint(const Breakpoint &bp)
|
||||
notifyBreakpointRemoveOk(bp);
|
||||
}
|
||||
|
||||
void PdbEngine::loadSymbols(const QString &moduleName)
|
||||
void PdbEngine::loadSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
@@ -300,10 +300,10 @@ void PdbEngine::refreshModules(const GdbMi &modules)
|
||||
handler->endUpdateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::requestModuleSymbols(const QString &moduleName)
|
||||
void PdbEngine::requestModuleSymbols(const FilePath &moduleName)
|
||||
{
|
||||
DebuggerCommand cmd("listSymbols");
|
||||
cmd.arg("module", moduleName);
|
||||
cmd.arg("module", moduleName.path());
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void PdbEngine::refreshSymbols(const GdbMi &symbols)
|
||||
symbol.name = item["name"].data();
|
||||
syms.append(symbol);
|
||||
}
|
||||
showModuleSymbols(moduleName, syms);
|
||||
showModuleSymbols(runParameters().inferior.command.executable().withNewPath(moduleName), syms);
|
||||
}
|
||||
|
||||
bool PdbEngine::canHandleToolTip(const DebuggerToolTipContext &) const
|
||||
|
@@ -52,9 +52,9 @@ private:
|
||||
const QString &expr, const QVariant &value) override;
|
||||
void executeDebuggerCommand(const QString &command) override;
|
||||
|
||||
void loadSymbols(const QString &moduleName) override;
|
||||
void loadSymbols(const Utils::FilePath &moduleName) override;
|
||||
void loadAllSymbols() override;
|
||||
void requestModuleSymbols(const QString &moduleName) override;
|
||||
void requestModuleSymbols(const Utils::FilePath &moduleName) override;
|
||||
void reloadModules() override;
|
||||
void reloadRegisters() override {}
|
||||
void reloadSourceFiles() override {}
|
||||
|
@@ -736,7 +736,7 @@ bool QmlEngine::acceptsBreakpoint(const BreakpointParameters &bp) const
|
||||
return bp.isQmlFileAndLineBreakpoint();
|
||||
}
|
||||
|
||||
void QmlEngine::loadSymbols(const QString &moduleName)
|
||||
void QmlEngine::loadSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
@@ -759,7 +759,7 @@ void QmlEngine::updateAll()
|
||||
d->updateLocals();
|
||||
}
|
||||
|
||||
void QmlEngine::requestModuleSymbols(const QString &moduleName)
|
||||
void QmlEngine::requestModuleSymbols(const FilePath &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
}
|
||||
|
@@ -75,9 +75,9 @@ private:
|
||||
void assignValueInDebugger(WatchItem *item,
|
||||
const QString &expr, const QVariant &value) override;
|
||||
|
||||
void loadSymbols(const QString &moduleName) override;
|
||||
void loadSymbols(const Utils::FilePath &moduleName) override;
|
||||
void loadAllSymbols() override;
|
||||
void requestModuleSymbols(const QString &moduleName) override;
|
||||
void requestModuleSymbols(const Utils::FilePath &moduleName) override;
|
||||
void reloadModules() override;
|
||||
void reloadRegisters() override {}
|
||||
void reloadSourceFiles() override;
|
||||
|
Reference in New Issue
Block a user