Mercurial > repos > blastem
comparison gdb_remote.c @ 1166:73e36dac5be7
Fix GDB remote protocol support
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 10 Jan 2017 23:45:59 -0800 |
parents | 2eb54e24914e |
children | 75ba222877f7 |
comparison
equal
deleted
inserted
replaced
1165:9fc680b35dbb | 1166:73e36dac5be7 |
---|---|
376 } | 376 } |
377 case 'q': | 377 case 'q': |
378 if (!memcmp("Supported", command+1, strlen("Supported"))) { | 378 if (!memcmp("Supported", command+1, strlen("Supported"))) { |
379 sprintf(send_buf, "PacketSize=%X", (int)bufsize); | 379 sprintf(send_buf, "PacketSize=%X", (int)bufsize); |
380 gdb_send_command(send_buf); | 380 gdb_send_command(send_buf); |
381 } else if (!memcmp("Attached", command+1, strlen("Supported"))) { | 381 } else if (!memcmp("Attached", command+1, strlen("Attached"))) { |
382 //not really meaningful for us, but saying we spawned a new process | 382 //not really meaningful for us, but saying we spawned a new process |
383 //is probably closest to the truth | 383 //is probably closest to the truth |
384 gdb_send_command("0"); | 384 gdb_send_command("0"); |
385 } else if (!memcmp("Offsets", command+1, strlen("Offsets"))) { | 385 } else if (!memcmp("Offsets", command+1, strlen("Offsets"))) { |
386 //no relocations, so offsets are all 0 | 386 //no relocations, so offsets are all 0 |
393 } else if (!memcmp("TfV", command+1, strlen("TfV")) || !memcmp("TfP", command+1, strlen("TfP"))) { | 393 } else if (!memcmp("TfV", command+1, strlen("TfV")) || !memcmp("TfP", command+1, strlen("TfP"))) { |
394 //TODO: actual tracepoint support | 394 //TODO: actual tracepoint support |
395 gdb_send_command(""); | 395 gdb_send_command(""); |
396 } else if (command[1] == 'C') { | 396 } else if (command[1] == 'C') { |
397 //we only support a single thread currently, so send 1 | 397 //we only support a single thread currently, so send 1 |
398 gdb_send_command("1"); | 398 gdb_send_command("QC1"); |
399 } else if (!strcmp("fThreadInfo", command + 1)) { | |
400 //we only support a single thread currently, so send 1 | |
401 gdb_send_command("m1"); | |
402 } else if (!strcmp("sThreadInfo", command + 1)) { | |
403 gdb_send_command("l"); | |
399 } else { | 404 } else { |
400 goto not_impl; | 405 goto not_impl; |
401 } | 406 } |
402 break; | 407 break; |
403 case 'v': | 408 case 'v': |
404 if (!memcmp("Cont?", command+1, strlen("Cont?"))) { | 409 if (!memcmp("Cont?", command+1, strlen("Cont?"))) { |
405 gdb_send_command("vCont;c;C;s;S"); | 410 gdb_send_command("vCont;c;C;s;S"); |
411 } else if (!strcmp("MustReplyEmpty", command + 1)) { | |
412 gdb_send_command(""); | |
406 } else if (!memcmp("Cont;", command+1, strlen("Cont;"))) { | 413 } else if (!memcmp("Cont;", command+1, strlen("Cont;"))) { |
407 switch (*(command + 1 + strlen("Cont;"))) | 414 switch (*(command + 1 + strlen("Cont;"))) |
408 { | 415 { |
409 case 'c': | 416 case 'c': |
410 case 'C': | 417 case 'C': |