https://bugs.kde.org/show_bug.cgi?id=368603

--- Comment #12 from RJVB <rjvber...@gmail.com> ---
(In reply to Aetf from comment #8)

> Could you try if this works for you?

It works in the sense that it rejects Apple-style version reporting ...

With these hunks I get a functional LLDB plugin again:
```
@@ -381,9 +393,40 @@ void DebugSession::handleCoreFile(const QStringList &s)

 void DebugSession::handleVersion(const QStringList& s)
 {
+    m_hasCorrectCLIOutput = !s.isEmpty();
+    if (!m_hasCorrectCLIOutput) {
+        // No output from 'version' command. It's likely that
+        // the lldb used is not patched for the CLI output
+
+        if (!qobject_cast<QGuiApplication*>(qApp))  {
+            //for unittest
+            qFatal("You need a graphical application.");
+        }
+
+        auto ans = KMessageBox::warningYesNo(
+            qApp->activeWindow(),
+            i18n("<b>Your lldb-mi version is unsupported, as it lacks an
essential patch.</b><br/>"
+                 "See https://llvm.org/bugs/show_bug.cgi?id=28026 for more
information.<br/>"
+                 "Debugger console will be disabled to prevent crash.<br/>"
+                 "Do you want to continue?"),
+            i18n("LLDB Version Unsupported"),
+            KStandardGuiItem::yes(),
+            KStandardGuiItem::no(),
+            "unsupported-lldb-debugger");
+        if (ans == KMessageBox::ButtonCode::No) {
+            programFinished("Stopped because of unsupported LLDB version");
+            stopDebugger();
+        }
+        return;
+    }
+
     qCDebug(DEBUGGERLLDB) << s.first();

+#ifdef Q_OS_OSX
+    QRegularExpression rx("^lldb-(\\d+).(\\d+).(\\d+)\\b",
QRegularExpression::MultilineOption);
+#else
     QRegularExpression rx("^lldb version: (\\d+).(\\d+).(\\d+)\\b",
QRegularExpression::MultilineOption);
+#endif
     auto match = rx.match(s.first());
     int version[] = {0, 0, 0};
     if (match.hasMatch()) {
@@ -394,7 +437,12 @@ void DebugSession::handleVersion(const QStringList& s)

     // minimal version is 3.8.1
     bool ok = true;
+#ifdef Q_OS_OSX
+    // lldb 3.8.1 reports version 350.99.0 on OS X
+    const int min_ver[] = {350, 99, 0};
+#else
     const int min_ver[] = {3, 8, 1};
+#endif
     for (int i = 0; i < 3; ++i) {
         if (version[i] < min_ver[i]) {
             ok = false;
```

Unrelated: for some reason I can no longer use the lldb plugin on Linux. It
starts, but then "drops out of" the debugging view, back into the code view.
Any ideas?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to