Skip to content

Commit

Permalink
[ merge ] patch from [email protected], GDB server endless loop
Browse files Browse the repository at this point in the history
  • Loading branch information
texane committed Dec 27, 2012
1 parent 7505f99 commit 1c2828c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gdbserver/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ int serve(stlink_t *sl, int port) {
perror("listen");
return 1;
}


start_again:
stlink_force_debug(sl);
stlink_reset(sl);
init_code_breakpoints(sl);
Expand Down Expand Up @@ -681,7 +682,7 @@ int serve(stlink_t *sl, int port) {
int status = gdb_recv_packet(client, &packet);
if(status < 0) {
fprintf(stderr, "cannot recv: %d\n", status);
return 1;
goto start_again;
}

#ifdef DEBUG
Expand Down Expand Up @@ -1220,7 +1221,9 @@ int serve(stlink_t *sl, int port) {
int result = gdb_send_packet(client, reply);
if(result != 0) {
fprintf(stderr, "cannot send: %d\n", result);
return 1;
free(reply);
free(packet);
goto start_again;
}

free(reply);
Expand Down

0 comments on commit 1c2828c

Please sign in to comment.