1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include "replacements.h"
26 #include "gdb_server.h"
30 #include "binarybuffer.h"
31 #include "breakpoints.h"
40 #define _DEBUG_GDB_IO_
43 static unsigned short gdb_port
;
45 int gdb_last_signal(target_t
*target
)
47 switch (target
->debug_reason
)
49 case DBG_REASON_DBGRQ
:
50 return 0x2; /* SIGINT */
51 case DBG_REASON_BREAKPOINT
:
52 case DBG_REASON_WATCHPOINT
:
53 case DBG_REASON_WPTANDBKPT
:
54 return 0x05; /* SIGTRAP */
55 case DBG_REASON_SINGLESTEP
:
56 return 0x05; /* SIGTRAP */
57 case DBG_REASON_NOTHALTED
:
58 return 0x0; /* no signal... shouldn't happen */
60 ERROR("BUG: undefined debug reason");
65 int gdb_get_char(connection_t
*connection
, int* next_char
)
67 gdb_connection_t
*gdb_con
= connection
->priv
;
70 if (gdb_con
->buf_cnt
-- > 0)
72 *next_char
= *(gdb_con
->buf_p
++);
73 if (gdb_con
->buf_cnt
> 0)
74 connection
->input_pending
= 1;
76 connection
->input_pending
= 0;
79 DEBUG("returned char '%c' (0x%2.2x)", *next_char
, *next_char
);
85 while ((gdb_con
->buf_cnt
= read_socket(connection
->fd
, gdb_con
->buffer
, GDB_BUFFER_SIZE
)) <= 0)
87 if (gdb_con
->buf_cnt
== 0)
88 return ERROR_SERVER_REMOTE_CLOSED
;
91 errno
= WSAGetLastError();
99 return ERROR_SERVER_REMOTE_CLOSED
;
101 ERROR("read: %d", strerror(errno
));
111 return ERROR_SERVER_REMOTE_CLOSED
;
113 return ERROR_SERVER_REMOTE_CLOSED
;
115 ERROR("read: %s", strerror(errno
));
121 debug_buffer
= malloc(gdb_con
->buf_cnt
+ 1);
122 memcpy(debug_buffer
, gdb_con
->buffer
, gdb_con
->buf_cnt
);
123 debug_buffer
[gdb_con
->buf_cnt
] = 0;
124 DEBUG("received '%s'", debug_buffer
);
127 gdb_con
->buf_p
= gdb_con
->buffer
;
129 *next_char
= *(gdb_con
->buf_p
++);
130 if (gdb_con
->buf_cnt
> 0)
131 connection
->input_pending
= 1;
133 connection
->input_pending
= 0;
134 #ifdef _DEBUG_GDB_IO_
135 DEBUG("returned char '%c' (0x%2.2x)", *next_char
, *next_char
);
141 int gdb_putback_char(connection_t
*connection
, int last_char
)
143 gdb_connection_t
*gdb_con
= connection
->priv
;
145 if (gdb_con
->buf_p
> gdb_con
->buffer
)
147 *(--gdb_con
->buf_p
) = last_char
;
152 ERROR("BUG: couldn't put character back");
158 int gdb_put_packet(connection_t
*connection
, char *buffer
, int len
)
161 unsigned char my_checksum
= 0;
166 gdb_connection_t
*gdb_con
= connection
->priv
;
168 for (i
= 0; i
< len
; i
++)
169 my_checksum
+= buffer
[i
];
174 debug_buffer
= malloc(len
+ 1);
175 memcpy(debug_buffer
, buffer
, len
);
176 debug_buffer
[len
] = 0;
177 DEBUG("sending packet '$%s#%2.2x'", debug_buffer
, my_checksum
);
180 write_socket(connection
->fd
, "$", 1);
182 write_socket(connection
->fd
, buffer
, len
);
183 write_socket(connection
->fd
, "#", 1);
185 snprintf(checksum
, 3, "%2.2x", my_checksum
);
187 write_socket(connection
->fd
, checksum
, 2);
189 if ((retval
= gdb_get_char(connection
, &reply
)) != ERROR_OK
)
194 else if (reply
== '-')
195 WARNING("negative reply, retrying");
196 else if (reply
== 0x3)
199 if ((retval
= gdb_get_char(connection
, &reply
)) != ERROR_OK
)
203 else if (reply
== '-')
204 WARNING("negative reply, retrying");
207 ERROR("unknown character 0x%2.2x in reply, dropping connection", reply
);
208 return ERROR_SERVER_REMOTE_CLOSED
;
213 ERROR("unknown character 0x%2.2x in reply, dropping connection", reply
);
214 return ERROR_SERVER_REMOTE_CLOSED
;
221 int gdb_get_packet(connection_t
*connection
, char *buffer
, int *len
)
229 unsigned char my_checksum
= 0;
230 gdb_connection_t
*gdb_con
= connection
->priv
;
236 if ((retval
= gdb_get_char(connection
, &character
)) != ERROR_OK
)
239 DEBUG("character: '%c'", character
);
246 WARNING("acknowledgment received, but no packet pending");
249 WARNING("negative acknowledgment, but no packet pending");
256 WARNING("ignoring character 0x%x", character
);
259 } while (character
!= '$');
265 if ((retval
= gdb_get_char(connection
, &character
)) != ERROR_OK
)
269 packet_type
= character
;
273 if( packet_type
== 'X' )
280 /* data transmitted in binary mode (X packet)
281 * uses 0x7d as escape character */
282 my_checksum
+= character
& 0xff;
283 gdb_get_char(connection
, &character
);
284 my_checksum
+= character
& 0xff;
285 buffer
[count
++] = (character
^ 0x20) & 0xff;
288 ERROR("packet buffer too small");
289 return ERROR_GDB_BUFFER_TOO_SMALL
;
293 buffer
[count
++] = character
& 0xff;
294 my_checksum
+= character
& 0xff;
297 ERROR("packet buffer too small");
298 return ERROR_GDB_BUFFER_TOO_SMALL
;
313 buffer
[count
++] = character
& 0xff;
314 my_checksum
+= character
& 0xff;
317 ERROR("packet buffer too small");
318 return ERROR_GDB_BUFFER_TOO_SMALL
;
323 } while (character
!= '#');
327 if ((retval
= gdb_get_char(connection
, &character
)) != ERROR_OK
)
329 checksum
[0] = character
;
330 if ((retval
= gdb_get_char(connection
, &character
)) != ERROR_OK
)
332 checksum
[1] = character
;
335 if (my_checksum
== strtoul(checksum
, NULL
, 16))
337 write_socket(connection
->fd
, "+", 1);
341 WARNING("checksum error, requesting retransmission");
342 write_socket(connection
->fd
, "-", 1);
348 int gdb_output(struct command_context_s
*context
, char* line
)
350 connection_t
*connection
= context
->output_handler_priv
;
354 bin_size
= strlen(line
);
356 hex_buffer
= malloc(bin_size
*2 + 4);
359 for (i
=0; i
<bin_size
; i
++)
360 snprintf(hex_buffer
+ 1 + i
*2, 3, "%2.2x", line
[i
]);
361 hex_buffer
[bin_size
*2+1] = '0';
362 hex_buffer
[bin_size
*2+2] = 'a';
363 hex_buffer
[bin_size
*2+3] = 0x0;
365 gdb_put_packet(connection
, hex_buffer
, bin_size
*2 + 3);
371 int gdb_target_callback_event_handler(struct target_s
*target
, enum target_event event
, void *priv
)
373 connection_t
*connection
= priv
;
374 gdb_connection_t
*gdb_connection
= connection
->priv
;
380 case TARGET_EVENT_HALTED
:
381 if (gdb_connection
->frontend_state
== TARGET_RUNNING
)
383 if (gdb_connection
->ctrl_c
)
386 gdb_connection
->ctrl_c
= 0;
390 signal
= gdb_last_signal(target
);
393 snprintf(sig_reply
, 4, "T%2.2x", signal
);
394 gdb_put_packet(connection
, sig_reply
, 3);
395 gdb_connection
->frontend_state
= TARGET_HALTED
;
398 case TARGET_EVENT_RESUMED
:
399 if (gdb_connection
->frontend_state
== TARGET_HALTED
)
401 gdb_connection
->frontend_state
= TARGET_RUNNING
;
411 int gdb_new_connection(connection_t
*connection
)
413 gdb_connection_t
*gdb_connection
= malloc(sizeof(gdb_connection_t
));
414 gdb_service_t
*gdb_service
= connection
->service
->priv
;
418 connection
->priv
= gdb_connection
;
420 /* initialize gdb connection information */
421 gdb_connection
->buf_p
= gdb_connection
->buffer
;
422 gdb_connection
->buf_cnt
= 0;
423 gdb_connection
->ctrl_c
= 0;
424 gdb_connection
->frontend_state
= TARGET_HALTED
;
426 /* output goes through gdb connection */
427 command_set_output_handler(connection
->cmd_ctx
, gdb_output
, connection
);
429 /* register callback to be informed about target events */
430 target_register_event_callback(gdb_target_callback_event_handler
, connection
);
432 /* a gdb session just attached, put the target in halt mode */
433 if (((retval
= gdb_service
->target
->type
->halt(gdb_service
->target
)) != ERROR_OK
) &&
434 (retval
!= ERROR_TARGET_ALREADY_HALTED
))
436 ERROR("error when trying to halt target");
440 while (gdb_service
->target
->state
!= TARGET_HALTED
)
442 gdb_service
->target
->type
->poll(gdb_service
->target
);
445 /* remove the initial ACK from the incoming buffer */
446 if ((retval
= gdb_get_char(connection
, &initial_ack
)) != ERROR_OK
)
449 if (initial_ack
!= '+')
450 gdb_putback_char(connection
, initial_ack
);
455 int gdb_connection_closed(connection_t
*connection
)
457 if (connection
->priv
)
458 free(connection
->priv
);
460 ERROR("BUG: connection->priv == NULL");
462 target_unregister_event_callback(gdb_target_callback_event_handler
, connection
);
467 int gdb_last_signal_packet(connection_t
*connection
, target_t
*target
, char* packet
, int packet_size
)
472 signal
= gdb_last_signal(target
);
474 snprintf(sig_reply
, 4, "S%2.2x", signal
);
475 gdb_put_packet(connection
, sig_reply
, 3);
480 void gdb_get_registers_packet(connection_t
*connection
, target_t
*target
, char* packet
, int packet_size
)
485 int reg_packet_size
= 0;
492 if ((retval
= target
->type
->get_gdb_reg_list(target
, ®_list
, ®_list_size
)) != ERROR_OK
)
496 case ERROR_TARGET_NOT_HALTED
:
497 ERROR("gdb requested registers, but we're not halted");
500 ERROR("BUG: unexpected error returned by get_gdb_reg_list()");
505 for (i
= 0; i
< reg_list_size
; i
++)
507 reg_packet_size
+= reg_list
[i
]->size
;
510 reg_packet
= malloc(CEIL(reg_packet_size
, 8) * 2);
511 reg_packet_p
= reg_packet
;
513 for (i
= 0; i
< reg_list_size
; i
++)
516 char *hex_buf
= buf_to_char(reg_list
[i
]->value
, reg_list
[i
]->size
);
517 DEBUG("hex_buf: %s", hex_buf
);
518 for (j
= CEIL(reg_list
[i
]->size
, 8) * 2; j
> 0; j
-= 2)
520 *reg_packet_p
++ = hex_buf
[j
- 2];
521 *reg_packet_p
++ = hex_buf
[j
- 1];
526 reg_packet_p
= strndup(reg_packet
, CEIL(reg_packet_size
, 8) * 2);
527 DEBUG("reg_packet: %s", reg_packet_p
);
530 gdb_put_packet(connection
, reg_packet
, CEIL(reg_packet_size
, 8) * 2);
535 void gdb_set_registers_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
545 /* skip command character */
551 WARNING("GDB set_registers packet with uneven characters received");
555 if ((retval
= target
->type
->get_gdb_reg_list(target
, ®_list
, ®_list_size
)) != ERROR_OK
)
559 case ERROR_TARGET_NOT_HALTED
:
560 ERROR("gdb requested registers, but we're not halted");
563 ERROR("BUG: unexpected error returned by get_gdb_reg_list()");
569 for (i
= 0; i
< reg_list_size
; i
++)
571 char_to_buf(packet
, CEIL(reg_list
[i
]->size
, 8) * 2, reg_list
[i
]->value
, reg_list
[i
]->size
);
572 reg_list
[i
]->dirty
= 1;
575 gdb_put_packet(connection
, "OK", 2);
578 void gdb_get_register_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
583 int reg_num
= strtoul(packet
+ 1, NULL
, 16);
591 if ((retval
= target
->type
->get_gdb_reg_list(target
, ®_list
, ®_list_size
)) != ERROR_OK
)
595 case ERROR_TARGET_NOT_HALTED
:
596 ERROR("gdb requested registers, but we're not halted");
599 ERROR("BUG: unexpected error returned by get_gdb_reg_list()");
604 if (reg_list_size
<= reg_num
)
606 ERROR("gdb requested a non-existing register");
610 hex_buf
= buf_to_char(reg_list
[reg_num
]->value
, reg_list
[reg_num
]->size
);
611 reg_packet
= reg_packet_p
= malloc(CEIL(reg_list
[reg_num
]->size
, 8) * 2);
613 for (i
= CEIL(reg_list
[reg_num
]->size
, 8) * 2; i
> 0; i
-= 2)
615 *reg_packet_p
++ = hex_buf
[i
- 2];
616 *reg_packet_p
++ = hex_buf
[i
- 1];
619 gdb_put_packet(connection
, reg_packet
, CEIL(reg_list
[reg_num
]->size
, 8) * 2);
626 void gdb_set_register_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
629 int reg_num
= strtoul(packet
+ 1, &separator
, 16);
636 if ((retval
= target
->type
->get_gdb_reg_list(target
, ®_list
, ®_list_size
)) != ERROR_OK
)
640 case ERROR_TARGET_NOT_HALTED
:
641 ERROR("gdb requested registers, but we're not halted");
644 ERROR("BUG: unexpected error returned by get_gdb_reg_list()");
649 if (reg_list_size
< reg_num
)
651 ERROR("gdb requested a non-existing register");
655 if (*separator
!= '=')
657 ERROR("GDB set register packet, but no '=' following the register number");
661 char_to_buf(separator
+ 1, CEIL(reg_list
[reg_num
]->size
, 8) * 2, reg_list
[reg_num
]->value
, reg_list
[reg_num
]->size
);
662 reg_list
[reg_num
]->dirty
= 1;
664 gdb_put_packet(connection
, "OK", 2);
668 void gdb_read_memory_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
679 /* skip command character */
682 addr
= strtoul(packet
, &separator
, 16);
684 if (*separator
!= ',')
687 len
= strtoul(separator
+1, NULL
, 16);
689 buffer
= malloc(len
);
691 DEBUG("addr: 0x%8.8x, len: 0x%8.8x", addr
, len
);
697 target
->type
->read_memory(target
, addr
, 4, 1, buffer
);
699 target
->type
->read_memory(target
, addr
, 1, len
, buffer
);
703 target
->type
->read_memory(target
, addr
, 2, 1, buffer
);
705 target
->type
->read_memory(target
, addr
, 1, len
, buffer
);
708 if (((addr
% 4) == 0) && ((len
% 4) == 0))
709 target
->type
->read_memory(target
, addr
, 4, len
/ 4, buffer
);
711 target
->type
->read_memory(target
, addr
, 1, len
, buffer
);
714 hex_buffer
= malloc(len
* 2 + 1);
716 for (i
=0; i
<len
; i
++)
717 snprintf(hex_buffer
+ 2*i
, 3, "%2.2x", buffer
[i
]);
719 gdb_put_packet(connection
, hex_buffer
, len
* 2);
725 void gdb_write_memory_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
735 /* skip command character */
738 addr
= strtoul(packet
, &separator
, 16);
740 if (*separator
!= ',')
743 len
= strtoul(separator
+1, &separator
, 16);
745 if (*(separator
++) != ':')
748 buffer
= malloc(len
);
750 DEBUG("addr: 0x%8.8x, len: 0x%8.8x", addr
, len
);
752 for (i
=0; i
<len
; i
++)
755 sscanf(separator
+ 2*i
, "%2x", &tmp
);
761 /* handle sized writes */
764 target
->type
->write_memory(target
, addr
, 4, 1, buffer
);
766 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
770 target
->type
->write_memory(target
, addr
, 2, 1, buffer
);
772 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
776 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
778 /* handle bulk writes */
780 target_write_buffer(target
, addr
, len
, buffer
);
784 gdb_put_packet(connection
, "OK", 2);
789 void gdb_write_memory_binary_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
797 /* skip command character */
800 addr
= strtoul(packet
, &separator
, 16);
802 if (*separator
!= ',')
805 len
= strtoul(separator
+1, &separator
, 16);
807 if (*(separator
++) != ':')
812 buffer
= malloc(len
);
814 DEBUG("addr: 0x%8.8x, len: 0x%8.8x", addr
, len
);
816 memcpy( buffer
, separator
, len
);
822 target
->type
->write_memory(target
, addr
, 4, 1, buffer
);
824 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
828 target
->type
->write_memory(target
, addr
, 2, 1, buffer
);
830 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
834 target
->type
->write_memory(target
, addr
, 1, len
, buffer
);
837 target_write_buffer(target
, addr
, len
, buffer
);
844 gdb_put_packet(connection
, "OK", 2);
847 void gdb_step_continue_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
857 packet
[packet_size
] = 0;
858 address
= strtoul(packet
+ 1, NULL
, 16);
865 if (packet
[0] == 'c')
868 target
->type
->resume(target
, current
, address
, 0, 0); /* resume at current address, don't handle breakpoints, not debugging */
870 else if (packet
[0] == 's')
873 target
->type
->step(target
, current
, address
, 0); /* step at current or address, don't handle breakpoints */
877 void gdb_breakpoint_watchpoint_packet(connection_t
*connection
, target_t
*target
, char *packet
, int packet_size
)
880 enum breakpoint_type bp_type
;
881 enum watchpoint_rw wp_type
;
889 type
= strtoul(packet
+ 1, &separator
, 16);
891 if (type
== 0) /* memory breakpoint */
893 else if (type
== 1) /* hardware breakpoint */
895 else if (type
== 2) /* write watchpoint */
897 else if (type
== 3) /* read watchpoint */
899 else if (type
== 4) /* access watchpoint */
900 wp_type
= WPT_ACCESS
;
902 if (*separator
!= ',')
905 address
= strtoul(separator
+1, &separator
, 16);
907 if (*separator
!= ',')
910 size
= strtoul(separator
+1, &separator
, 16);
916 if (packet
[0] == 'Z')
918 if ((retval
= breakpoint_add(target
, address
, size
, bp_type
)) != ERROR_OK
)
920 if (retval
== ERROR_TARGET_RESOURCE_NOT_AVAILABLE
)
922 gdb_put_packet(connection
, "E00", 3);
929 breakpoint_remove(target
, address
);
931 gdb_put_packet(connection
, "OK", 2);
937 if (packet
[0] == 'Z')
938 watchpoint_add(target
, address
, size
, type
-2, 0, 0xffffffffu
);
940 watchpoint_remove(target
, address
);
941 gdb_put_packet(connection
, "OK", 2);
950 void gdb_query_packet(connection_t
*connection
, char *packet
, int packet_size
)
952 command_context_t
*cmd_ctx
= connection
->cmd_ctx
;
953 gdb_service_t
*gdb_service
= connection
->service
->priv
;
954 target_t
*target
= gdb_service
->target
;
956 if (strstr(packet
, "qRcmd,"))
962 cmd
= malloc((packet_size
- 6)/2 + 1);
963 for (i
=0; i
< (packet_size
- 6)/2; i
++)
966 sscanf(packet
+ 6 + 2*i
, "%2x", &tmp
);
969 cmd
[(packet_size
- 6)/2] = 0x0;
970 command_run_line(cmd_ctx
, cmd
);
973 gdb_put_packet(connection
, "OK", 2);
977 gdb_put_packet(connection
, "", 0);
980 int gdb_input(connection_t
*connection
)
982 gdb_service_t
*gdb_service
= connection
->service
->priv
;
983 target_t
*target
= gdb_service
->target
;
984 char packet
[GDB_BUFFER_SIZE
];
987 gdb_connection_t
*gdb_con
= connection
->priv
;
989 /* drain input buffer */
992 packet_size
= GDB_BUFFER_SIZE
-1;
993 if ((retval
= gdb_get_packet(connection
, packet
, &packet_size
)) != ERROR_OK
)
997 case ERROR_GDB_BUFFER_TOO_SMALL
:
998 ERROR("BUG: buffer supplied for gdb packet was too small");
1000 case ERROR_SERVER_REMOTE_CLOSED
:
1001 return ERROR_SERVER_REMOTE_CLOSED
;
1003 ERROR("unexpected error");
1008 /* terminate with zero */
1009 packet
[packet_size
] = 0;
1011 DEBUG("recevied packet: '%s'", packet
);
1013 if (packet_size
> 0)
1018 /* Hct... -- set thread
1019 * we don't have threads, send empty reply */
1020 gdb_put_packet(connection
, NULL
, 0);
1023 gdb_query_packet(connection
, packet
, packet_size
);
1026 gdb_get_registers_packet(connection
, target
, packet
, packet_size
);
1029 gdb_set_registers_packet(connection
, target
, packet
, packet_size
);
1032 gdb_get_register_packet(connection
, target
, packet
, packet_size
);
1035 gdb_set_register_packet(connection
, target
, packet
, packet_size
);
1038 gdb_read_memory_packet(connection
, target
, packet
, packet_size
);
1041 gdb_write_memory_packet(connection
, target
, packet
, packet_size
);
1045 gdb_breakpoint_watchpoint_packet(connection
, target
, packet
, packet_size
);
1048 gdb_last_signal_packet(connection
, target
, packet
, packet_size
);
1052 gdb_step_continue_packet(connection
, target
, packet
, packet_size
);
1055 target
->type
->resume(target
, 1, 0, 1, 0);
1056 gdb_put_packet(connection
, "OK", 2);
1059 gdb_write_memory_binary_packet(connection
, target
, packet
, packet_size
);
1062 gdb_put_packet(connection
, "OK", 2);
1063 return ERROR_SERVER_REMOTE_CLOSED
;
1065 /* ignore unkown packets */
1066 DEBUG("ignoring 0x%2.2x packet", packet
[0]);
1067 gdb_put_packet(connection
, NULL
, 0);
1072 if (gdb_con
->ctrl_c
)
1074 if (target
->state
== TARGET_RUNNING
)
1076 target
->type
->halt(target
);
1077 gdb_con
->ctrl_c
= 0;
1081 } while (gdb_con
->buf_cnt
> 0);
1088 gdb_service_t
*gdb_service
;
1089 target_t
*target
= targets
;
1094 WARNING("no gdb ports allocated as no target has been specified");
1100 WARNING("no gdb port specified, using default port 3333");
1106 char service_name
[8];
1108 snprintf(service_name
, 8, "gdb-%2.2i", i
);
1110 gdb_service
= malloc(sizeof(gdb_service_t
));
1111 gdb_service
->target
= target
;
1113 add_service("gdb", CONNECTION_GDB
, gdb_port
+ i
, 1, gdb_new_connection
, gdb_input
, gdb_connection_closed
, gdb_service
);
1115 DEBUG("gdb service for target %s at port %i", target
->type
->name
, gdb_port
+ i
);
1118 target
= target
->next
;
1124 /* daemon configuration command gdb_port */
1125 int handle_gdb_port_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1130 /* only if the port wasn't overwritten by cmdline */
1132 gdb_port
= strtoul(args
[0], NULL
, 0);
1137 int gdb_register_commands(command_context_t
*command_context
)
1139 register_command(command_context
, NULL
, "gdb_port", handle_gdb_port_command
,
1140 COMMAND_CONFIG
, "");
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)