summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-07-03 16:40:20 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-07-03 16:40:20 +0900
commitce9107072e149bda43a2b764161cca8a0ee7607d (patch)
tree134fd8b3b19494de457a8602feab39f98b4c96dd
parenta4307635e16c1214eb7701f576bb7e530adfa979 (diff)
downloadkdbg-ce9107072e149bda43a2b764161cca8a0ee7607d.tar.gz
kdbg-ce9107072e149bda43a2b764161cca8a0ee7607d.zip
Fixed command execution and detection of gdb. This resolves issue #8.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--kdbg/dbgdriver.cpp7
-rw-r--r--kdbg/gdbdriver.cpp3
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');