diff options
author | Johannes Sixt <j6t@kdbg.org> | 2010-12-27 20:58:39 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-05-31 15:32:08 +0200 |
commit | 547472d5964f4580376a1a364eacf3e1c6b77677 (patch) | |
tree | c1808f2021207d9b759290a1cbd185982d779f16 | |
parent | 636663de42fc504919aa996e2f04b6f9ca1fb82e (diff) | |
download | kdbg-547472d5964f4580376a1a364eacf3e1c6b77677.tar.gz kdbg-547472d5964f4580376a1a364eacf3e1c6b77677.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)
(cherry picked from commit 26a2a7598846501d109da764020b082ce5394d76)
-rw-r--r-- | kdbg/gdbdriver.cpp | 9 |
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)) |