From 6f8246615e8088c749b1b546be4300feba0a0476 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 19 Nov 2005 20:53:52 +0000 Subject: [PATCH] Be prepared for the case where a function from a shared library is printed. --- kdbg/gdbdriver.cpp | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index 09e7fa8..fa0a1a3 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -1068,19 +1068,38 @@ static bool parseValue(const char*& s, VarTree* variable) repeat: if (*s == '{') { - s++; - if (!parseNested(s, variable)) { - return false; - } - // must be the closing brace - if (*s != '}') { - TRACE("parse error: missing } of " + variable->getText()); - return false; + // Sometimes we find the following output: + // {} 0x40012000 + // {} + // {} + if (strncmp(s, "{m_value = FROM_LATIN1(start, s-start); + variable->m_value += ' '; // add only a single space + while (isspace(*s)) + s++; + goto repeat; } - s++; - // final white space - while (isspace(*s)) + else + { + s++; + if (!parseNested(s, variable)) { + return false; + } + // must be the closing brace + if (*s != '}') { + TRACE("parse error: missing } of " + variable->getText()); + return false; + } s++; + // final white space + while (isspace(*s)) + s++; + } } else { // examples of leaf values (cannot be the empty string): // 123 -- 2.11.4.GIT