Skip to content

Commit

Permalink
Fix regression by making parsing of ;thread:... attributes more len…
Browse files Browse the repository at this point in the history
…ient

Don't require `;thread:...` to be at the first occurrence of `;`; this breaks
`QPassSignals`. Instead, look for it at the end of the command.
  • Loading branch information
rocallahan committed Mar 25, 2024
1 parent 662a7f0 commit e0b3c7b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/GdbServerConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -912,19 +912,28 @@ bool GdbServerConnection::query(char* payload) {

// LLDB QThreadSuffixSupported extension
static void parse_thread_suffix_threadid(char* payload, GdbThreadId* out) {
char* semicolon = strchr(payload, ';');
char* semicolon = strrchr(payload, ';');
if (!semicolon) {
return;
}
parser_assert(!strncmp(semicolon + 1, "thread:", 7));
if (!semicolon[1]) {
semicolon[0] = 0;
semicolon = strrchr(payload, ';');
if (!semicolon) {
return;
}
}
if (strncmp(semicolon + 1, "thread:", 7)) {
return;
}
char* endptr;
*out = parse_threadid(semicolon + 8, &endptr);
*semicolon = 0;
}

bool GdbServerConnection::set_var(char* payload) {
GdbThreadId target = query_thread;
parse_thread_suffix_threadid(payload, &target);
parse_thread_suffix_threadid(payload, &target);

char* args = strchr(payload, ':');
if (args) {
Expand Down

0 comments on commit e0b3c7b

Please sign in to comment.