diff options
-rw-r--r-- | kdbg/gdbdriver.cpp | 14 | ||||
-rw-r--r-- | kdbg/testprogs/testfile.cpp | 19 |
2 files changed, 32 insertions, 1 deletions
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index ac86016..16efe9a 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -1048,7 +1048,8 @@ moreStrings: } } // is the string continued? - if (*p == ',') { + if (*p == ',') + { // look ahead for another quote const char* q = p+1; while (isspace(*q)) @@ -1058,6 +1059,17 @@ moreStrings: p = q; goto moreStrings; } + + // some strings can end in <incomplete sequence ...> + if (strncmp(q, "<incomplete sequence", 20) == 0) + { + p = q+20; + while (*p != '\0' && *p != '>') + p++; + if (*p != '\0') { + p++; /* skip the '>' */ + } + } } /* very long strings are followed by `...' */ if (*p == '.' && p[1] == '.' && p[2] == '.') { diff --git a/kdbg/testprogs/testfile.cpp b/kdbg/testprogs/testfile.cpp index 884ddad..242c504 100644 --- a/kdbg/testprogs/testfile.cpp +++ b/kdbg/testprogs/testfile.cpp @@ -101,6 +101,25 @@ void strtest(const char* t) template<typename F> void templated_strtest(F f, const char* t) { + // test <incomplete sequence> in various contexts + struct incomplete_seq_intern { + int val; + char is[4]; + int val2; + }; + struct incomplete_seq_end { + int val; + char is[4]; + }; + unsigned char a[4] = {',', 020, 021, 0325}; + incomplete_seq_intern b = { 1, {',', 020, 021, 0325}, 2 }; + incomplete_seq_end c = { 1, {',', 020, 021, 0325} }; + unsigned char d[30][4] = { {',', 020, 021, 0325}, }; + for (int i = 1; i < 30; i++) + memcpy(d[i], d[0], 4); + incomplete_seq_intern ba[30] = { { 1, {',', 020, 021, 0325}, 2 } }; + incomplete_seq_end ca[30] = { { 1, {',', 020, 021, 0325} } }; + f(t); } |