break;
case 'q':
- if ((strstr(packet, "qSymbol"))) {
+ if (strncmp(packet, "qSymbol", 7) == 0) {
if (rtos_qsymbol(connection, packet, packet_size) == 1) {
linux_compute_virt2phys(target,
target->rtos->
}
break;
- } else if (strstr(packet, "qfThreadInfo")) {
+ } else if (strncmp(packet, "qfThreadInfo", 12) == 0) {
if (linux_os->thread_list == NULL) {
retval = linux_gdb_thread_packet(target,
connection,
packet_size);
break;
}
- } else if (strstr(packet, "qsThreadInfo")) {
+ } else if (strncmp(packet, "qsThreadInfo", 12) == 0) {
gdb_put_packet(connection, "l", 1);
break;
- } else if (strstr(packet, "qThreadExtraInfo,")) {
+ } else if (strncmp(packet, "qThreadExtraInfo,", 17) == 0) {
linux_thread_extra_info(target, connection, packet,
packet_size);
break;
{
struct target *target = get_target_from_connection(connection);
- if (strstr(packet, "qThreadExtraInfo,")) {
+ if (strncmp(packet, "qThreadExtraInfo,", 17) == 0) {
if ((target->rtos != NULL) && (target->rtos->thread_details != NULL) &&
(target->rtos->thread_count != 0)) {
threadid_t threadid = 0;
}
gdb_put_packet(connection, "", 0);
return ERROR_OK;
- } else if (strstr(packet, "qSymbol")) {
+ } else if (strncmp(packet, "qSymbol", 7) == 0) {
if (rtos_qsymbol(connection, packet, packet_size) == 1) {
target->rtos_auto_detect = false;
target->rtos->type->create(target);
target->rtos->type->update_threads(target->rtos);
}
return ERROR_OK;
- } else if (strstr(packet, "qfThreadInfo")) {
+ } else if (strncmp(packet, "qfThreadInfo", 12) == 0) {
int i;
if ((target->rtos != NULL) && (target->rtos->thread_count != 0)) {
gdb_put_packet(connection, "", 0);
return ERROR_OK;
- } else if (strstr(packet, "qsThreadInfo")) {
+ } else if (strncmp(packet, "qsThreadInfo", 12) == 0) {
gdb_put_packet(connection, "l", 1);
return ERROR_OK;
- } else if (strstr(packet, "qAttached")) {
+ } else if (strncmp(packet, "qAttached", 9) == 0) {
gdb_put_packet(connection, "1", 1);
return ERROR_OK;
- } else if (strstr(packet, "qOffsets")) {
+ } else if (strncmp(packet, "qOffsets", 8) == 0) {
char offsets[] = "Text=0;Data=0;Bss=0";
gdb_put_packet(connection, offsets, sizeof(offsets)-1);
return ERROR_OK;
- } else if (strstr(packet, "qC")) {
+ } else if (strncmp(packet, "qC", 2) == 0) {
if (target->rtos != NULL) {
char buffer[19];
int size;
struct gdb_connection *gdb_connection = connection->priv;
struct target *target = get_target_from_connection(connection);
- if (strstr(packet, "qRcmd,")) {
+ if (strncmp(packet, "qRcmd,", 6) == 0) {
if (packet_size > 6) {
char *cmd;
int i;
}
gdb_put_packet(connection, "OK", 2);
return ERROR_OK;
- } else if (strstr(packet, "qCRC:")) {
+ } else if (strncmp(packet, "qCRC:", 5) == 0) {
if (packet_size > 5) {
int retval;
char gdb_reply[10];
return ERROR_OK;
}
- } else if (strstr(packet, "qSupported")) {
+ } else if (strncmp(packet, "qSupported", 10) == 0) {
/* we currently support packet size and qXfer:memory-map:read (if enabled)
* disable qXfer:features:read for the moment */
int retval = ERROR_OK;
free(buffer);
return ERROR_OK;
- } else if (strstr(packet, "qXfer:memory-map:read::")
+ } else if ((strncmp(packet, "qXfer:memory-map:read::", 23) == 0)
&& (flash_get_bank_count() > 0))
return gdb_memory_map(connection, packet, packet_size);
- else if (strstr(packet, "qXfer:features:read:")) {
+ else if (strncmp(packet, "qXfer:features:read:", 20) == 0) {
char *xml = NULL;
int size = 0;
int pos = 0;
free(xml);
return ERROR_OK;
- } else if (strstr(packet, "QStartNoAckMode")) {
+ } else if (strncmp(packet, "QStartNoAckMode", 15) == 0) {
gdb_connection->noack_mode = 1;
gdb_put_packet(connection, "OK", 2);
return ERROR_OK;
return ERROR_OK;
}
- if (strstr(packet, "vFlashErase:")) {
+ if (strncmp(packet, "vFlashErase:", 12) == 0) {
unsigned long addr;
unsigned long length;
return ERROR_OK;
}
- if (strstr(packet, "vFlashWrite:")) {
+ if (strncmp(packet, "vFlashWrite:", 12) == 0) {
int retval;
unsigned long addr;
unsigned long length;
return ERROR_OK;
}
- if (!strcmp(packet, "vFlashDone")) {
+ if (strncmp(packet, "vFlashDone", 10) == 0) {
uint32_t written;
/* process the flashing buffer. No need to erase as GDB
char *hex_buffer;
int retval = ERROR_OK;
if (target->smp) {
- if (strstr(packet, "jc")) {
+ if (strncmp(packet, "jc", 2) == 0) {
hex_buffer = malloc(len * 2 + 1);
buffer = (uint8_t *)&target->gdb_service->core[0];
uint32_t i;
/* skip command character */
if (target->smp) {
- if (strstr(packet, "Jc")) {
+ if (strncmp(packet, "Jc", 2) == 0) {
packet += 2;
coreid = strtoul(packet, &separator, 16);
target->gdb_service->core[1] = coreid;