[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevelop/5.0] debuggers/gdb: GDB: Merge console stream into Debug View
From:       Kevin Funk <kfunk () kde ! org>
Date:       2016-01-15 0:47:35
Message-ID: E1aJsYB-0005Ks-LD () scm ! kde ! org
[Download RAW message or body]

Git commit 609bacd7f1a94a1aae9518718b5b175ece67141c by Kevin Funk.
Committed on 15/01/2016 at 00:46.
Pushed by kfunk into branch '5.0'.

GDB: Merge console stream into Debug View

So you get crucial information during debugging, for example:

[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6f4f700 (LWP 19219)]
Program received signal
SIGABRT, Aborted.
0x00007ffff6f85267 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:55

M  +5    -6    debuggers/gdb/debugsession.cpp
M  +4    -1    debuggers/gdb/gdb.cpp

http://commits.kde.org/kdevelop/609bacd7f1a94a1aae9518718b5b175ece67141c

diff --git a/debuggers/gdb/debugsession.cpp b/debuggers/gdb/debugsession.cpp
index 4e4de5e..ee7b120 100644
--- a/debuggers/gdb/debugsession.cpp
+++ b/debuggers/gdb/debugsession.cpp
@@ -31,6 +31,7 @@
 #include <QApplication>
 #include <QRegExp>
 #include <QStandardPaths>
+#include <QRegularExpression>
 
 #include <KMessageBox>
 #include <KLocalizedString>
@@ -875,12 +876,10 @@ bool \
DebugSession::startDebugger(KDevelop::ILaunchConfiguration* cfg)  // It's better to \
do this right away so that the state bit is always  // correct.
 
-    /** FIXME: connect ttyStdout. It takes QByteArray, so
-        I'm not sure what to do.  */
-#if 0
-    connect(gdb, SIGNAL(applicationOutput(QString)),
-            this, SIGNAL(ttyStdout(QString)));
-#endif
+    connect(gdb, &GDB::applicationOutput,
+            this, [this](const QString& output) {
+        emit applicationStandardOutputLines(output.split(QRegularExpression("[\r\n]"),QString::SkipEmptyParts));
 +    });
     connect(gdb, &GDB::userCommandOutput, this,
             &DebugSession::gdbUserCommandStdout);
     connect(gdb, &GDB::internalCommandOutput, this,
diff --git a/debuggers/gdb/gdb.cpp b/debuggers/gdb/gdb.cpp
index 66fee9e..38b1ba6 100644
--- a/debuggers/gdb/gdb.cpp
+++ b/debuggers/gdb/gdb.cpp
@@ -311,8 +311,11 @@ void GDB::processLine(const QByteArray& line)
             } else {
                 if (currentCmd_ && currentCmd_->isUserCommand())
                     emit userCommandOutput(s.message);
-                else
+                else if (s.subkind == GDBMI::StreamRecord::Console) {
+                    emit applicationOutput(s.message);
+                } else {
                     emit internalCommandOutput(s.message);
+                }
 
                 if (currentCmd_)
                     currentCmd_->newOutput(s.message);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic