From ce9107072e149bda43a2b764161cca8a0ee7607d Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 3 Jul 2021 16:40:20 +0900 Subject: Fixed command execution and detection of gdb. This resolves issue #8. Signed-off-by: Michele Calgaro --- kdbg/dbgdriver.cpp | 7 ++++--- kdbg/gdbdriver.cpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kdbg/dbgdriver.cpp b/kdbg/dbgdriver.cpp index eb6bbf1..ab8301d 100644 --- a/kdbg/dbgdriver.cpp +++ b/kdbg/dbgdriver.cpp @@ -220,12 +220,13 @@ void DebuggerDriver::writeCommand() m_activeCmd = cmd; TRACE("in writeCommand: " + cmd->m_cmdString); - const char* str = cmd->m_cmdString.local8Bit(); - writeStdin(str, cmd->m_cmdString.local8Bit().length()); + const char* str = cmd->m_cmdString.local8Bit().data(); + size_t cmdStrLen = strlen(str); + writeStdin(str, cmdStrLen); // write also to log file if (m_logFile.isOpen()) { - m_logFile.writeBlock(str, cmd->m_cmdString.local8Bit().length()); + m_logFile.writeBlock(str, cmdStrLen); m_logFile.flush(); } diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index 58464ec..6255df4 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -2072,7 +2072,8 @@ bool GdbDriver::parseChangeExecutable(const char* output, TQString& message) strncmp(output, "Missing separate debuginfo", 26) == 0 || strncmp(output, "Try: ", 5) == 0 || strncmp(output, "Using host libthread_db", 23) == 0 || - strncmp(output, "(no debugging symbols found)", 28) == 0) + strncmp(output, "(no debugging symbols found", 27) == 0 || + strncmp(output, "(No debugging symbols found", 27) == 0) { // this line is good, go to the next one const char* end = strchr(output, '\n'); -- cgit v1.2.1