Commit 3d34ccf4 authored by hjk's avatar hjk
Browse files

Debugger: Enforce use of target-async for Android gdbserver



Since NDK r11 this seems to be needed to get breakpoints set
correctly on Linux and Mac.

Change-Id: I54281feecc0a915d4761228c612b72889756aecf
Reviewed-by: default avatarBogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 04321897
......@@ -42,6 +42,8 @@
#include <qtsupport/qtkitinformation.h>
#include <utils/hostosinfo.h>
#include <QDirIterator>
#include <QTcpServer>
......@@ -93,6 +95,8 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.displayName = AndroidManager::packageName(target);
params.remoteSetupNeeded = true;
params.useContinueInsteadOfRun = true;
if (!Utils::HostOsInfo::isWindowsHost()) // Workaround for NDK 11c(b?)
params.useTargetAsync = true;
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) {
......
......@@ -98,6 +98,7 @@ public:
// Used by Android to avoid false positives on warnOnRelease
bool skipExecutableValidation = false;
bool useTargetAsync = false;
QStringList additionalSearchDirectories;
// Used by iOS.
......
......@@ -4436,7 +4436,12 @@ bool GdbEngine::usesExecInterrupt() const
{
DebuggerStartMode mode = runParameters().startMode;
return (mode == AttachToRemoteServer || mode == AttachToRemoteProcess)
&& boolSetting(TargetAsync);
&& usesTargetAsync();
}
bool GdbEngine::usesTargetAsync() const
{
return runParameters().useTargetAsync || boolSetting(TargetAsync);
}
void GdbEngine::scheduleTestResponse(int testCase, const QByteArray &response)
......
......@@ -423,6 +423,7 @@ protected:
bool m_terminalTrap;
bool m_temporaryStopPending;
bool usesExecInterrupt() const;
bool usesTargetAsync() const;
QHash<int, QByteArray> m_scheduledTestResponses;
QSet<int> m_testCases;
......
......@@ -205,7 +205,7 @@ void GdbRemoteServerEngine::setupInferior()
// gdb/mi/mi-main.c:1958: internal-error:
// mi_execute_async_cli_command: Assertion `is_running (inferior_ptid)'
// failed.\nA problem internal to GDB has been detected,[...]
if (boolSetting(TargetAsync))
if (usesTargetAsync())
runCommand({"set target-async on", NoFlags, CB(handleSetTargetAsync)});
if (symbolFile.isEmpty()) {
......@@ -429,7 +429,7 @@ void GdbRemoteServerEngine::handleExecRun(const DebuggerResponse &response)
void GdbRemoteServerEngine::interruptInferior2()
{
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
if (boolSetting(TargetAsync)) {
if (usesTargetAsync()) {
runCommand({"-exec-interrupt", NoFlags, CB(handleInterruptInferior)});
} else if (m_isQnxGdb && HostOsInfo::isWindowsHost()) {
m_gdbProc.interrupt();
......
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