aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggeritem.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2020-01-24 17:08:27 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2020-02-04 13:48:47 +0000
commit96c1fbcd0a1329ce3f674d3d53bc8b31eecd903f (patch)
treec381f6a8ac4265e798e5fbcc91d355a13e555885 /src/plugins/debugger/debuggeritem.cpp
parent13c6e5df286c851b4d5d7e3ec69c9d4066116e97 (diff)
BareMetal: Long live support for KEIL uVision v5.x debugger
This patch adds debugger integration from the KEIL uVision IDE: * http://www2.keil.com/mdk5/uvision/ This IDE has the uVision Socket Interface (UVSC) that allows to the applications configuration, building and debugging: * http://www.keil.com/appnotes/docs/apnt_198.asp Besides, it provides a binary client libraries for Windows, which are implements some API which we are use in this patch. Currently implemented the following features: * Enumeration of a stack frames. * Enumeration of a threads (tasks). * Registers view (read/write). * Local variables view (read/write). * Watchers view (read/write). * Disassembler view. * Current location marker. * Break-points. * Step-in. * Step-over. * Step-out. * Step-by-instruction. * Start/stop/pause/continue debugger. * Auto-detection for the installed uVision instances (as debuggers). * Wizard for choosing and configuring of the UVSC debug providers. At this moment added support only for the 32-bit ARM devices, provided by the STMicroelectronics: https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html For this are implemented two debugger providers: * Simulator - allow to simulate the target device. * ST-Link v2 - it is a HW debugger. This implementation tested only with the QBS using the following target boards: * NUCLEO-F767ZI (based on STM32F767ZIT6 MCU). * STM32F4DISCOVERY (based on STM32F407VG MCU). * STM32F103x (based on STM32F103C8T6 MCU). A more detailed information about this patch can be found in a bug-tracker. Fixes: QTCREATORBUG-23426 Change-Id: Ie36a1f7430b56c33d6665cc35e43fe9bd95d28f1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/debugger/debuggeritem.cpp')
-rw-r--r--src/plugins/debugger/debuggeritem.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp
index 3287095d828..bb31684a54a 100644
--- a/src/plugins/debugger/debuggeritem.cpp
+++ b/src/plugins/debugger/debuggeritem.cpp
@@ -37,6 +37,7 @@
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
#include <utils/utilsicons.h>
+#include <utils/winutils.h>
#include <QFileInfo>
#include <QProcess>
@@ -138,6 +139,14 @@ void DebuggerItem::createId()
m_id = QUuid::createUuid().toString();
}
+static bool isUVisionExecutable(const QFileInfo &fileInfo)
+{
+ if (!HostOsInfo::isWindowsHost())
+ return false;
+ const QString baseName = fileInfo.baseName();
+ return baseName == "UV4";
+}
+
void DebuggerItem::reinitializeFromFile()
{
// CDB only understands the single-dash -version, whereas GDB and LLDB are
@@ -149,6 +158,18 @@ void DebuggerItem::reinitializeFromFile()
if (fileInfo.baseName().toLower().contains("lldb-mi"))
version = "--version";
+ // We don't need to start the uVision executable to
+ // determine its version.
+ if (isUVisionExecutable(fileInfo)) {
+ QString errorMessage;
+ m_version = winGetDLLVersion(WinDLLFileVersion,
+ fileInfo.absoluteFilePath(),
+ &errorMessage);
+ m_engineType = UvscEngineType;
+ m_abis.clear();
+ return;
+ }
+
SynchronousProcess proc;
SynchronousProcessResponse response = proc.runBlocking({m_command, {version}});
if (response.result != SynchronousProcessResponse::Finished) {
@@ -236,6 +257,8 @@ QString DebuggerItem::engineTypeName() const
return QLatin1String("CDB");
case LldbEngineType:
return QLatin1String("LLDB");
+ case UvscEngineType:
+ return QLatin1String("UVSC");
default:
return QString();
}