diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-07-03 16:40:20 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-07-04 14:07:52 +0900 |
commit | ae260bb8164b9d4e3ca54e0a448b375820d0a80b (patch) | |
tree | 506279e3c31ab6b63e6e9ad73a35429c11cf102c | |
parent | 59476a68be31615f6239a99147e918630a04a1be (diff) | |
download | kdbg-ae260bb8164b9d4e3ca54e0a448b375820d0a80b.tar.gz kdbg-ae260bb8164b9d4e3ca54e0a448b375820d0a80b.zip |
Fixed command execution and detection of gdb. This resolves issue #8.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit ce9107072e149bda43a2b764161cca8a0ee7607d)
-rw-r--r-- | kdbg/dbgdriver.cpp | 7 | ||||
-rw-r--r-- | 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'); |