Commit 7713fc51 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

do not post source & module list query commands too early

if the respective view is enabled, the manager will request the
initial update in some unholy state, probably AdapterStarting -
when gdb isn't up yet.
parent 658f4393
......@@ -981,7 +981,7 @@ void GdbEngine::handleAqcuiredInferior()
#endif
// It's nicer to see a bit of the world we live in.
reloadModules();
reloadModulesInternal();
attemptBreakpointSynchronization();
}
#endif
......@@ -1145,9 +1145,9 @@ void GdbEngine::handleStop1(const GdbResponse &response)
void GdbEngine::handleStop1(const GdbMi &data)
{
if (m_modulesListOutdated)
reloadModules(); // This is for display only
reloadModulesInternal(); // This is for display only
if (m_sourcesListOutdated)
reloadSourceFiles(); // This needs to be done before fullName() may need it
reloadSourceFilesInternal(); // This needs to be done before fullName() may need it
QByteArray reason = data.findChild("reason").data();
if (reason == "breakpoint-hit") {
......@@ -1981,7 +1981,7 @@ void GdbEngine::attemptBreakpointSynchronization()
// For best results, we rely on an up-to-date fullname mapping.
// The listing completion will retrigger us, so no futher action is needed.
if (m_sourcesListOutdated) {
reloadSourceFiles();
reloadSourceFilesInternal();
return;
} else if (m_sourcesListUpdating) {
return;
......@@ -2054,13 +2054,13 @@ void GdbEngine::loadSymbols(const QString &moduleName)
{
// FIXME: gdb does not understand quoted names here (tested with 6.8)
postCommand(_("sharedlibrary ") + dotEscape(moduleName));
reloadModules();
reloadModulesInternal();
}
void GdbEngine::loadAllSymbols()
{
postCommand(_("sharedlibrary .*"));
reloadModules();
reloadModulesInternal();
}
QList<Symbol> GdbEngine::moduleSymbols(const QString &moduleName)
......@@ -2098,9 +2098,15 @@ QList<Symbol> GdbEngine::moduleSymbols(const QString &moduleName)
}
void GdbEngine::reloadModules()
{
if (state() == InferiorRunning || state() == InferiorStopped)
reloadModulesInternal();
}
void GdbEngine::reloadModulesInternal()
{
m_modulesListOutdated = false;
postCommand(_("info shared"), CB(handleModulesList));
postCommand(_("info shared"), NeedsStop, CB(handleModulesList));
}
void GdbEngine::handleModulesList(const GdbResponse &response)
......@@ -2157,6 +2163,13 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
//////////////////////////////////////////////////////////////////////
void GdbEngine::reloadSourceFiles()
{
if ((state() == InferiorRunning || state() == InferiorStopped)
&& !m_sourcesListUpdating)
reloadSourceFilesInternal();
}
void GdbEngine::reloadSourceFilesInternal()
{
m_sourcesListUpdating = true;
m_sourcesListOutdated = false;
......
......@@ -322,6 +322,7 @@ private: ////////// View & Data Stuff //////////
virtual void loadAllSymbols();
virtual QList<Symbol> moduleSymbols(const QString &moduleName);
virtual void reloadModules();
void reloadModulesInternal();
void handleModulesList(const GdbResponse &response);
bool m_modulesListOutdated;
......@@ -350,6 +351,7 @@ private: ////////// View & Data Stuff //////////
// Source file specific stuff
//
virtual void reloadSourceFiles();
void reloadSourceFilesInternal();
void handleQuerySources(const GdbResponse &response);
QString fullName(const QString &fileName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment