sscanf cleanup in GDB Z packet handling function.

Tested working with arm-none-eabi-gcc 10.2.1
This commit is contained in:
Fabrice Prost-Boucle 2022-01-19 22:25:11 +01:00 committed by Piotr Esden-Tempski
parent e0619ca7d5
commit 488df7e6f7
1 changed files with 1 additions and 5 deletions

View File

@ -539,11 +539,7 @@ handle_z_packet(char *packet, int plen)
uint32_t addr;
int ret;
/* I have no idea why this doesn't work. Seems to work
* with real sscanf() though... */
//sscanf(packet, "%*[zZ]%hhd,%08lX,%hhd", &type, &addr, &len);
type = packet[1] - '0';
sscanf(packet + 2, ",%" PRIx32 ",%d", &addr, &len);
sscanf(packet, "%*[zZ]%d,%08" PRIX32 ",%d", &type, &addr, &len);
if(set)
ret = target_breakwatch_set(cur_target, type, addr, len);
else