summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2010-12-27 20:58:39 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-05-31 13:51:54 +0200
commit26a2a7598846501d109da764020b082ce5394d76 (patch)
tree044fd2e2957a8f37cb36fcfb329c33599a7d888a
parenta8abc77457cda320f7577c2da7d6d592aaac0ca6 (diff)
downloadkdbg-26a2a7598846501d109da764020b082ce5394d76.tar.gz
kdbg-26a2a7598846501d109da764020b082ce5394d76.zip
Fix parsing of disassembly produced by gdb 7.1.
Since gdb 7.1, the address does not start at the beginning of a line, and it can be prefixed by a pointer => that indicates the current instruction. (cherry picked from upstream commit 5c5f34852d30337ef7c23ef4e88d50ecee1c0703)
-rw-r--r--kdbg/gdbdriver.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp
index 16efe9a..933c191 100644
--- a/kdbg/gdbdriver.cpp
+++ b/kdbg/gdbdriver.cpp
@@ -2422,6 +2422,15 @@ std::list<DisassembledCode> GdbDriver::parseDisassemble(const char* output)
while (p != end)
{
DisassembledCode c;
+ // skip initial space or PC pointer ("=>", since gdb 7.1)
+ while (p != end) {
+ if (isspace(*p))
+ ++p;
+ else if (p[0] == '=' && p[1] == '>')
+ p += 2;
+ else
+ break;
+ }
const char* start = p;
// address
while (p != end && !isspace(*p))