OpenOCD
|
GDB server implementation. More...
Go to the source code of this file.
Data Structures | |
struct | gdb_connection |
struct | target_desc_format |
Enumerations | |
enum | gdb_output_flag { GDB_OUTPUT_NO , GDB_OUTPUT_ALL } |
Functions | |
static | __attribute__ ((format(PRINTF_ATTRIBUTE_FORMAT, 5, 6))) |
static int | check_pending (struct connection *connection, int timeout_s, int *got_data) |
COMMAND_HANDLER (handle_gdb_breakpoint_override_command) | |
COMMAND_HANDLER (handle_gdb_flash_program_command) | |
COMMAND_HANDLER (handle_gdb_memory_map_command) | |
COMMAND_HANDLER (handle_gdb_port_command) | |
COMMAND_HANDLER (handle_gdb_report_data_abort_command) | |
COMMAND_HANDLER (handle_gdb_report_register_access_error) | |
COMMAND_HANDLER (handle_gdb_save_tdesc_command) | |
COMMAND_HANDLER (handle_gdb_sync_command) | |
COMMAND_HANDLER (handle_gdb_target_description_command) | |
static int | compare_bank (const void *a, const void *b) |
static int | decode_xfer_read (char const *buf, char **annex, int *ofs, unsigned int *len) |
static int | fetch_packet (struct connection *connection, int *checksum_ok, int noack, int *len, char *buffer) |
static int | gdb_breakpoint_watchpoint_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_connection_closed (struct connection *connection) |
static int | gdb_detach (struct connection *connection) |
static int | gdb_error (struct connection *connection, int retval) |
static void | gdb_fileio_reply (struct target *target, struct connection *connection) |
static int | gdb_fileio_response_packet (struct connection *connection, char const *packet, int packet_size) |
static void | gdb_frontend_halted (struct target *target, struct connection *connection) |
static int | gdb_generate_reg_type_description (struct target *target, char **tdesc, int *pos, int *size, struct reg_data_type *type, char const **arch_defined_types_list[], int *num_arch_defined_types) |
static int | gdb_generate_target_description (struct target *target, char **tdesc_out) |
static int | gdb_generate_thread_list (struct target *target, char **thread_list_out) |
static int | gdb_get_char (struct connection *connection, int *next_char) |
static int | gdb_get_char_fast (struct connection *connection, int *next_char, char **buf_p, int *buf_cnt) |
The cool thing about this fn is that it allows buf_p and buf_cnt to be held in registers in the inner loop. More... | |
static int | gdb_get_char_inner (struct connection *connection, int *next_char) |
static int | gdb_get_packet (struct connection *connection, char *buffer, int *len) |
static int | gdb_get_packet_inner (struct connection *connection, char *buffer, int *len) |
static const char * | gdb_get_reg_type_name (enum reg_type type) |
static int | gdb_get_register_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_get_registers_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_get_target_description_chunk (struct target *target, struct target_desc_format *target_desc, char **chunk, int32_t offset, uint32_t length) |
static int | gdb_get_thread_list_chunk (struct target *target, char **thread_list, char **chunk, int32_t offset, uint32_t length) |
static bool | gdb_handle_vcont_packet (struct connection *connection, const char *packet, int packet_size) |
static bool | gdb_handle_vrun_packet (struct connection *connection, const char *packet, int packet_size) |
static int | gdb_input (struct connection *connection) |
static int | gdb_input_inner (struct connection *connection) |
static void | gdb_keep_client_alive (struct connection *connection) |
static int | gdb_last_signal (struct target *target) |
static int | gdb_last_signal_packet (struct connection *connection, char const *packet, int packet_size) |
static void | gdb_log_callback (void *priv, const char *file, unsigned line, const char *function, const char *string) |
static void | gdb_log_incoming_packet (struct connection *connection, char *packet) |
static void | gdb_log_outgoing_packet (struct connection *connection, char *packet_buf, unsigned int packet_len, unsigned char checksum) |
static int | gdb_memory_map (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_new_connection (struct connection *connection) |
static int | gdb_output (struct command_context *context, const char *line) |
static int | gdb_output_con (struct connection *connection, const char *line) |
int | gdb_put_packet (struct connection *connection, char *buffer, int len) |
static int | gdb_put_packet_inner (struct connection *connection, char *buffer, int len) |
static int | gdb_putback_char (struct connection *connection, int last_char) |
static int | gdb_query_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_read_memory_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_reg_pos (struct target *target, int pos, int len) |
int | gdb_register_commands (struct command_context *cmd_ctx) |
static void | gdb_restart_inferior (struct connection *connection, const char *packet, int packet_size) |
static void | gdb_send_error (struct connection *connection, uint8_t the_error) |
void | gdb_service_free (void) |
static int | gdb_set_register_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_set_registers_packet (struct connection *connection, char const *packet, int packet_size) |
static void | gdb_sig_halted (struct connection *connection) |
static void | gdb_signal_reply (struct target *target, struct connection *connection) |
static int | gdb_step_continue_packet (struct connection *connection, char const *packet, int packet_size) |
static void | gdb_str_to_target (struct target *target, char *tstr, struct reg *reg) |
int | gdb_target_add_all (struct target *target) |
static int | gdb_target_add_one (struct target *target) |
static int | gdb_target_callback_event_handler (struct target *target, enum target_event event, void *priv) |
static int | gdb_target_description_supported (struct target *target, int *supported) |
static int | gdb_target_start (struct target *target, const char *port) |
static void | gdb_target_to_reg (struct target *target, char const *tstr, int str_len, uint8_t *bin) |
static int | gdb_v_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_write (struct connection *connection, void *data, int len) |
static int | gdb_write_memory_binary_packet (struct connection *connection, char const *packet, int packet_size) |
static int | gdb_write_memory_packet (struct connection *connection, char const *packet, int packet_size) |
static int | get_reg_features_list (struct target *target, char const **feature_list[], int *feature_list_size, struct reg **reg_list, int reg_list_size) |
static int | lookup_add_arch_defined_types (char const **arch_defined_types_list[], const char *type_id, int *num_arch_defined_types) |
static char * | next_hex_encoded_field (const char **str, char sep) |
static int | smp_reg_list_noread (struct target *target, struct reg **combined_list[], int *combined_list_size, enum target_register_class reg_class) |
Variables | |
static struct gdb_connection * | current_gdb_connection |
int | gdb_actual_connections |
static int | gdb_breakpoint_override |
static enum breakpoint_type | gdb_breakpoint_override_type |
static const struct command_registration | gdb_command_handlers [] |
static int | gdb_flash_program = 1 |
static char * | gdb_port |
static char * | gdb_port_next |
static int | gdb_report_data_abort |
static int | gdb_report_register_access_error |
static char | gdb_running_type |
static const struct service_driver | gdb_service_driver |
static int | gdb_use_memory_map = 1 |
static int | gdb_use_target_description = 1 |
GDB server implementation.
This implements the GDB Remote Serial Protocol, over TCP connections, giving GDB access to the JTAG or other hardware debugging facilities found in most modern embedded processors.
Definition in file gdb_server.c.
enum gdb_output_flag |
Enumerator | |
---|---|
GDB_OUTPUT_NO | |
GDB_OUTPUT_ALL |
Definition at line 53 of file gdb_server.c.
|
static |
Definition at line 1822 of file gdb_server.c.
References ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, and size.
|
static |
Definition at line 168 of file gdb_server.c.
References gdb_connection::buf_cnt, ERROR_GDB_TIMEOUT, ERROR_OK, connection::fd, NULL, connection::priv, socket_select(), timeval::tv_sec, and timeval::tv_usec.
Referenced by gdb_get_char_inner(), and gdb_put_packet_inner().
COMMAND_HANDLER | ( | handle_gdb_breakpoint_override_command | ) |
Definition at line 3947 of file gdb_server.c.
References BKPT_HARD, BKPT_SOFT, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, gdb_breakpoint_override, gdb_breakpoint_override_type, and LOG_USER.
COMMAND_HANDLER | ( | handle_gdb_flash_program_command | ) |
Definition at line 3919 of file gdb_server.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and gdb_flash_program.
COMMAND_HANDLER | ( | handle_gdb_memory_map_command | ) |
Definition at line 3910 of file gdb_server.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and gdb_use_memory_map.
COMMAND_HANDLER | ( | handle_gdb_port_command | ) |
Definition at line 3900 of file gdb_server.c.
References CALL_COMMAND_HANDLER, ERROR_OK, gdb_port, and gdb_port_next.
COMMAND_HANDLER | ( | handle_gdb_report_data_abort_command | ) |
Definition at line 3928 of file gdb_server.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and gdb_report_data_abort.
COMMAND_HANDLER | ( | handle_gdb_report_register_access_error | ) |
Definition at line 3937 of file gdb_server.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and gdb_report_register_access_error.
COMMAND_HANDLER | ( | handle_gdb_save_tdesc_command | ) |
Definition at line 3979 of file gdb_server.c.
References alloc_printf(), CMD_CTX, ERROR_FAIL, ERROR_OK, fileio_close(), fileio_open(), FILEIO_TEXT, fileio_write(), FILEIO_WRITE, gdb_generate_target_description(), get_current_target(), LOG_ERROR, and target_type_name().
COMMAND_HANDLER | ( | handle_gdb_sync_command | ) |
Definition at line 3883 of file gdb_server.c.
References CMD, CMD_ARGC, command_print(), current_gdb_connection, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, and gdb_connection::sync.
COMMAND_HANDLER | ( | handle_gdb_target_description_command | ) |
Definition at line 3970 of file gdb_server.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and gdb_use_target_description.
|
static |
Definition at line 1885 of file gdb_server.c.
References flash_bank::base.
Referenced by gdb_memory_map().
|
static |
Definition at line 1858 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, NULL, and strndup().
Referenced by gdb_query_packet().
|
inlinestatic |
Definition at line 544 of file gdb_server.c.
References gdb_connection::buf_cnt, gdb_connection::buf_p, buffer, count, ERROR_GDB_BUFFER_TOO_SMALL, ERROR_OK, gdb_get_char(), gdb_get_char_fast(), LOG_ERROR, NULL, and connection::priv.
Referenced by gdb_get_packet_inner().
|
static |
Definition at line 1724 of file gdb_server.c.
References BKPT_HARD, BKPT_SOFT, breakpoint_add(), breakpoint_remove(), ERROR_NOT_IMPLEMENTED, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_breakpoint_override, gdb_breakpoint_override_type, gdb_error(), gdb_put_packet(), get_target_from_connection(), LOG_DEBUG, LOG_ERROR, size, target_name(), type, watchpoint_add(), watchpoint_remove(), WPT_ACCESS, WPT_READ, and WPT_WRITE.
Referenced by gdb_input_inner().
|
static |
Definition at line 1099 of file gdb_server.c.
References connection::cmd_ctx, delete_debug_msg_receiver(), ERROR_OK, gdb_actual_connections, gdb_log_callback(), gdb_target_callback_event_handler(), get_target_from_connection(), image_close(), LOG_DEBUG, log_remove_callback(), NULL, connection::priv, target, target_call_event_callbacks(), TARGET_EVENT_GDB_DETACH, TARGET_EVENT_GDB_END, target_name(), target_state_name(), target_unregister_event_callback(), and gdb_connection::vflash_image.
|
static |
Definition at line 3409 of file gdb_server.c.
References gdb_put_packet().
Referenced by gdb_input_inner().
|
static |
Definition at line 1481 of file gdb_server.c.
References ERROR_OK, gdb_send_error(), and LOG_DEBUG.
Referenced by gdb_breakpoint_watchpoint_packet(), gdb_get_register_packet(), gdb_get_registers_packet(), gdb_memory_map(), gdb_query_packet(), gdb_read_memory_packet(), gdb_set_register_packet(), gdb_set_registers_packet(), gdb_write_memory_binary_packet(), and gdb_write_memory_packet().
|
static |
Definition at line 846 of file gdb_server.c.
References target::fileio_info, gdb_connection::frontend_state, gdb_put_packet(), gdb_fileio_info::identifier, LOG_DEBUG, gdb_fileio_info::param_1, gdb_fileio_info::param_2, gdb_fileio_info::param_3, gdb_fileio_info::param_4, connection::priv, rtos_update_threads(), TARGET_HALTED, target_resume(), and TARGET_RUNNING.
Referenced by gdb_frontend_halted().
|
static |
Definition at line 3423 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, gdb_running_type, get_target_from_connection(), LOG_DEBUG, target_gdb_fileio_end(), target_resume(), and target_step().
Referenced by gdb_input_inner().
|
static |
Definition at line 934 of file gdb_server.c.
References ERROR_OK, target::fileio_info, gdb_connection::frontend_state, gdb_fileio_reply(), GDB_OUTPUT_NO, gdb_signal_reply(), gdb_connection::output_flag, connection::priv, target_get_gdb_fileio_info(), and TARGET_RUNNING.
Referenced by gdb_input_inner(), and gdb_target_callback_event_handler().
|
static |
Definition at line 2116 of file gdb_server.c.
References reg_data_type_struct_field::bitfield, reg_data_type_flags_field::bitfield, data_type, reg_data_type_bitfield::end, ERROR_OK, gdb_get_reg_type_name(), reg_data_type::id, lookup_add_arch_defined_types(), reg_data_type_union_field::name, reg_data_type_struct_field::name, reg_data_type_flags_field::name, reg_data_type_union_field::next, reg_data_type_struct_field::next, reg_data_type_flags_field::next, REG_TYPE_ARCH_DEFINED, REG_TYPE_CLASS_FLAGS, REG_TYPE_CLASS_STRUCT, REG_TYPE_CLASS_UNION, REG_TYPE_CLASS_VECTOR, size, reg_data_type_bitfield::start, type, reg_data_type_union_field::type, reg_data_type_bitfield::type, reg_data_type_struct_field::type, reg_data_type::type, and reg_data_type_struct_field::use_bitfields.
Referenced by gdb_generate_target_description().
|
static |
Definition at line 2405 of file gdb_server.c.
References reg::caller_save, ERROR_FAIL, ERROR_OK, reg::exist, feature, gdb_generate_reg_type_description(), gdb_get_reg_type_name(), get_reg_features_list(), group, reg::hidden, reg_data_type::id, LOG_ERROR, lookup_add_arch_defined_types(), name, NULL, number, REG_CLASS_ALL, reg::reg_data_type, REG_TYPE_ARCH_DEFINED, size, smp_reg_list_noread(), target_get_gdb_arch(), and reg_data_type::type.
Referenced by COMMAND_HANDLER(), and gdb_get_target_description_chunk().
|
static |
Definition at line 2644 of file gdb_server.c.
References ERROR_OK, thread_detail::exists, thread_detail::extra_info_str, NULL, target::rtos, size, rtos::thread_count, rtos::thread_details, thread_detail::thread_name_str, and thread_detail::threadid.
Referenced by gdb_get_thread_list_chunk().
|
static |
Definition at line 325 of file gdb_server.c.
References gdb_connection::buf_cnt, gdb_connection::buf_p, gdb_get_char_fast(), and connection::priv.
Referenced by fetch_packet(), gdb_get_packet_inner(), gdb_new_connection(), and gdb_put_packet_inner().
|
inlinestatic |
The cool thing about this fn is that it allows buf_p and buf_cnt to be held in registers in the inner loop.
For small caches and embedded systems this is important!
Definition at line 295 of file gdb_server.c.
References gdb_connection::buf_cnt, gdb_connection::buf_p, ERROR_OK, gdb_get_char_inner(), connection::input_pending, LOG_DEBUG, and connection::priv.
Referenced by fetch_packet(), and gdb_get_char().
|
static |
Definition at line 205 of file gdb_server.c.
References gdb_connection::buf_cnt, gdb_connection::buf_p, gdb_connection::buffer, check_pending(), gdb_connection::closed, CONNECTION_TCP, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, connection::fd, GDB_BUFFER_SIZE, connection::input_pending, LOG_DEBUG, LOG_ERROR, NULL, connection::priv, read_socket(), connection::service, strndup(), and service::type.
Referenced by gdb_get_char_fast().
|
static |
Definition at line 742 of file gdb_server.c.
References buffer, gdb_connection::busy, gdb_get_packet_inner(), and connection::priv.
Referenced by gdb_input_inner().
|
static |
Definition at line 659 of file gdb_server.c.
References buffer, gdb_connection::closed, gdb_connection::ctrl_c, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, fetch_packet(), gdb_get_char(), gdb_log_incoming_packet(), gdb_write(), LOG_DEBUG, LOG_WARNING, gdb_connection::noack_mode, and connection::priv.
Referenced by gdb_get_packet().
|
static |
Definition at line 2046 of file gdb_server.c.
References REG_TYPE_ARCH_DEFINED, REG_TYPE_BOOL, REG_TYPE_CODE_PTR, REG_TYPE_DATA_PTR, REG_TYPE_FLOAT, REG_TYPE_IEEE_DOUBLE, REG_TYPE_IEEE_SINGLE, REG_TYPE_INT, REG_TYPE_INT128, REG_TYPE_INT16, REG_TYPE_INT32, REG_TYPE_INT64, REG_TYPE_INT8, REG_TYPE_UINT, REG_TYPE_UINT128, REG_TYPE_UINT16, REG_TYPE_UINT32, REG_TYPE_UINT64, REG_TYPE_UINT8, and type.
Referenced by gdb_generate_reg_type_description(), and gdb_generate_target_description().
|
static |
Definition at line 1358 of file gdb_server.c.
References DIV_ROUND_UP, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, reg::exist, gdb_error(), gdb_put_packet(), gdb_report_register_access_error, gdb_str_to_target(), reg_arch_type::get, get_target_from_connection(), reg::hidden, LOG_DEBUG, LOG_ERROR, name, NULL, REG_CLASS_ALL, target::rtos, rtos_get_gdb_reg(), size, target_get_gdb_reg_list_noread(), reg::type, and reg::valid.
Referenced by gdb_input_inner().
|
static |
Definition at line 1224 of file gdb_server.c.
References DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, reg::exist, gdb_error(), gdb_put_packet(), gdb_report_register_access_error, gdb_str_to_target(), reg_arch_type::get, get_target_from_connection(), reg::hidden, LOG_DEBUG, name, REG_CLASS_GENERAL, target::rtos, rtos_get_gdb_reg_list(), size, strndup(), target_get_gdb_reg_list(), reg::type, and reg::valid.
Referenced by gdb_input_inner().
|
static |
Definition at line 2545 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, gdb_generate_target_description(), length, LOG_ERROR, NULL, offset, target_desc_format::tdesc, and target_desc_format::tdesc_length.
Referenced by gdb_query_packet().
|
static |
Definition at line 2700 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, gdb_generate_thread_list(), length, LOG_ERROR, MIN, NULL, and offset.
Referenced by gdb_query_packet().
|
static |
Definition at line 2979 of file gdb_server.c.
References rtos::current_thread, ERROR_OK, ERROR_TARGET_NOT_HALTED, gdb_connection::frontend_state, GDB_OUTPUT_ALL, GDB_OUTPUT_NO, gdb_put_packet(), gdb_running_type, gdb_sig_halted(), gdb_signal_reply(), rtos::gdb_target_for_threadid, get_target_from_connection(), LOG_DEBUG, LOG_ERROR, LOG_INFO, NULL, gdb_connection::output_flag, connection::priv, target::rtos, rtos_update_threads(), target::state, target_type::step, gdb_connection::sync, target, target_call_event_callbacks(), TARGET_EVENT_GDB_START, TARGET_HALTED, target_name(), target_poll(), target_resume(), TARGET_RUNNING, target_step(), and target::type.
Referenced by gdb_v_packet().
|
static |
Definition at line 3207 of file gdb_server.c.
References alloc_printf(), semihosting::cmdline, gdb_put_packet(), gdb_restart_inferior(), get_target_from_connection(), LOG_INFO, next_hex_encoded_field(), and target::semihosting.
Referenced by gdb_v_packet().
|
static |
Definition at line 3736 of file gdb_server.c.
References gdb_connection::closed, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_input_inner(), and connection::priv.
|
static |
Definition at line 3493 of file gdb_server.c.
References gdb_connection::attached, gdb_connection::buf_cnt, gdb_connection::ctrl_c, rtos::current_threadid, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_connection::extended_protocol, gdb_connection::frontend_state, gdb_breakpoint_watchpoint_packet(), GDB_BUFFER_SIZE, gdb_detach(), gdb_fileio_response_packet(), gdb_frontend_halted(), gdb_get_packet(), gdb_get_register_packet(), gdb_get_registers_packet(), gdb_last_signal_packet(), gdb_log_incoming_packet(), GDB_OUTPUT_ALL, GDB_OUTPUT_NO, gdb_put_packet(), gdb_query_packet(), gdb_read_memory_packet(), gdb_read_smp_packet(), gdb_restart_inferior(), gdb_set_register_packet(), gdb_set_registers_packet(), gdb_sig_halted(), gdb_step_continue_packet(), rtos::gdb_target_for_threadid, gdb_thread_packet(), GDB_THREAD_PACKET_NOT_CONSUMED, gdb_v_packet(), gdb_write_memory_binary_packet(), gdb_write_memory_packet(), gdb_write_smp_packet(), get_target_from_connection(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, gdb_connection::mem_write_error, gdb_connection::output_flag, service::port, connection::priv, target::rtos, connection::service, target::state, gdb_connection::sync, target, target_call_event_callbacks(), TARGET_EVENT_GDB_HALT, TARGET_EVENT_GDB_START, target_halt(), TARGET_HALTED, target_poll(), and TARGET_RUNNING.
Referenced by gdb_input().
|
static |
Definition at line 3751 of file gdb_server.c.
References gdb_connection::busy, GDB_OUTPUT_ALL, gdb_output_con(), GDB_OUTPUT_NO, gdb_connection::output_flag, and connection::priv.
|
static |
Definition at line 146 of file gdb_server.c.
References DBG_REASON_BREAKPOINT, DBG_REASON_DBGRQ, DBG_REASON_EXC_CATCH, DBG_REASON_NOTHALTED, DBG_REASON_SINGLESTEP, DBG_REASON_WATCHPOINT, DBG_REASON_WPTANDBKPT, target::debug_reason, and LOG_USER.
Referenced by gdb_last_signal_packet(), and gdb_signal_reply().
|
static |
Definition at line 1146 of file gdb_server.c.
References gdb_connection::attached, ERROR_OK, gdb_last_signal(), gdb_put_packet(), get_target_from_connection(), and connection::priv.
Referenced by gdb_input_inner().
|
static |
Definition at line 3468 of file gdb_server.c.
References gdb_connection::busy, gdb_output_con(), GDB_OUTPUT_NO, gdb_connection::output_flag, priv, and connection::priv.
Referenced by gdb_connection_closed(), and gdb_new_connection().
|
static |
Definition at line 363 of file gdb_server.c.
References find_nonprint_char(), get_target_from_connection(), LOG_LEVEL_IS, LOG_LVL_DEBUG, LOG_TARGET_DEBUG, and MIN.
Referenced by gdb_get_packet_inner(), gdb_input_inner(), and gdb_put_packet_inner().
|
static |
Definition at line 394 of file gdb_server.c.
References find_nonprint_char(), get_target_from_connection(), LOG_LEVEL_IS, LOG_LVL_DEBUG, and LOG_TARGET_DEBUG.
Referenced by gdb_put_packet_inner().
|
static |
Definition at line 1899 of file gdb_server.c.
References flash_bank::base, compare_bank(), ERROR_OK, flash_get_bank_count(), gdb_error(), gdb_put_packet(), get_flash_bank_by_num(), get_flash_bank_by_num_noprobe(), get_target_from_connection(), length, LOG_WARNING, flash_bank::name, NULL, flash_bank::num_sectors, flash_sector::offset, offset, sector_size, flash_bank::sectors, flash_sector::size, flash_bank::size, size, start, flash_bank::target, TARGET_ADDR_FMT, and target_address_max().
Referenced by gdb_query_packet().
|
static |
Definition at line 982 of file gdb_server.c.
References all_targets, gdb_connection::attached, breakpoint_clear_target(), gdb_connection::buf_cnt, gdb_connection::buf_p, gdb_connection::buffer, gdb_connection::busy, rtos_type::clean, gdb_connection::closed, connection::cmd_ctx, command_set_output_handler(), gdb_connection::ctrl_c, command_context::current_target, ERROR_OK, ERROR_TARGET_NOT_EXAMINED, gdb_connection::extended_protocol, flash_get_bank_count(), gdb_connection::frontend_state, gdb_actual_connections, gdb_get_char(), gdb_log_callback(), gdb_output(), GDB_OUTPUT_NO, gdb_putback_char(), gdb_target_callback_event_handler(), gdb_use_memory_map, gdb_write(), get_flash_bank_by_num(), get_flash_bank_by_num_noprobe(), get_target_from_connection(), log_add_callback(), LOG_ERROR, LOG_LVL_DEBUG, LOG_LVL_INFO, log_printf_lf(), LOG_WARNING, gdb_connection::mem_write_error, target::next, gdb_connection::noack_mode, NULL, gdb_connection::output_flag, connection::priv, target::rtos, rtos_update_threads(), target::state, gdb_connection::sync, flash_bank::target, target, target_call_event_callbacks(), gdb_connection::target_desc, TARGET_EVENT_GDB_ATTACH, TARGET_HALTED, target_name(), target_register_event_callback(), target_state_name(), target_was_examined(), target_desc_format::tdesc, target_desc_format::tdesc_length, gdb_connection::thread_list, rtos::type, gdb_connection::vflash_image, and watchpoint_clear_target().
|
static |
Definition at line 771 of file gdb_server.c.
References ERROR_OK, and LOG_USER_N.
Referenced by gdb_new_connection().
|
static |
Definition at line 751 of file gdb_server.c.
References ERROR_GDB_BUFFER_TOO_SMALL, gdb_put_packet(), and hexify().
Referenced by gdb_keep_client_alive(), gdb_log_callback(), and gdb_query_packet().
int gdb_put_packet | ( | struct connection * | connection, |
char * | buffer, | ||
int | len | ||
) |
Definition at line 531 of file gdb_server.c.
References buffer, gdb_connection::busy, gdb_put_packet_inner(), kept_alive(), and connection::priv.
Referenced by gdb_breakpoint_watchpoint_packet(), gdb_detach(), gdb_fileio_reply(), gdb_get_register_packet(), gdb_get_registers_packet(), gdb_handle_vcont_packet(), gdb_handle_vrun_packet(), gdb_input_inner(), gdb_last_signal_packet(), gdb_memory_map(), gdb_output_con(), gdb_query_packet(), gdb_read_memory_packet(), gdb_read_smp_packet(), gdb_send_error(), gdb_set_register_packet(), gdb_set_registers_packet(), gdb_sig_halted(), gdb_signal_reply(), gdb_v_packet(), gdb_write_memory_binary_packet(), gdb_write_memory_packet(), gdb_write_smp_packet(), hwthread_thread_packet(), linux_gdb_h_packet(), linux_gdb_t_packet(), linux_gdb_thread_packet(), linux_gdb_thread_update(), linux_thread_extra_info(), linux_thread_packet(), nuttx_thread_packet(), rtos_put_gdb_reg_list(), rtos_qsymbol(), and rtos_thread_packet().
|
static |
Definition at line 410 of file gdb_server.c.
References buffer, check_pending(), gdb_connection::closed, gdb_connection::ctrl_c, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_get_char(), gdb_log_incoming_packet(), gdb_log_outgoing_packet(), GDB_OUTPUT_NO, gdb_putback_char(), gdb_write(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, gdb_connection::noack_mode, gdb_connection::output_flag, and connection::priv.
Referenced by gdb_put_packet().
|
static |
Definition at line 331 of file gdb_server.c.
References gdb_connection::buf_cnt, gdb_connection::buf_p, gdb_connection::buffer, ERROR_OK, LOG_ERROR, and connection::priv.
Referenced by gdb_new_connection(), and gdb_put_packet_inner().
|
static |
Definition at line 2743 of file gdb_server.c.
References addr, alloc_printf(), buffer, cmd, connection::cmd_ctx, current_gdb_connection, command_context::current_target_override, decode_xfer_read(), ERROR_GDB_BUFFER_TOO_SMALL, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, flash_get_bank_count(), GDB_BUFFER_SIZE, gdb_error(), gdb_get_target_description_chunk(), gdb_get_thread_list_chunk(), gdb_memory_map(), GDB_OUTPUT_ALL, gdb_output_con(), GDB_OUTPUT_NO, gdb_put_packet(), target_type::gdb_query_custom, gdb_send_error(), gdb_target_description_supported(), gdb_use_memory_map, gdb_use_target_description, get_target_from_connection(), hexify(), command_context::interp, length, LOG_ERROR, LOG_INFO, LOG_WARNING, gdb_connection::noack_mode, NULL, offset, gdb_connection::output_flag, connection::priv, size, target_call_timer_callbacks_now(), target_checksum_memory(), gdb_connection::target_desc, gdb_connection::thread_list, target::type, and unhexify().
Referenced by gdb_input_inner().
|
static |
Definition at line 1491 of file gdb_server.c.
References addr, buffer, ERROR_NOT_IMPLEMENTED, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_error(), gdb_put_packet(), gdb_report_data_abort, get_target_from_connection(), hexify(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, target::rtos, rtos_read_buffer(), and target_read_buffer().
Referenced by gdb_input_inner().
|
inlinestatic |
Definition at line 1169 of file gdb_server.c.
References target::endianness, and TARGET_LITTLE_ENDIAN.
Referenced by gdb_str_to_target(), and gdb_target_to_reg().
int gdb_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 4099 of file gdb_server.c.
References gdb_command_handlers, gdb_port, gdb_port_next, NULL, and register_commands().
Referenced by setup_command_handler().
|
static |
Definition at line 3192 of file gdb_server.c.
References gdb_connection::attached, breakpoint_clear_target(), connection::cmd_ctx, command_run_linef(), gdb_thread_packet(), get_target_from_connection(), connection::priv, target_name(), and watchpoint_clear_target().
Referenced by gdb_handle_vrun_packet(), and gdb_input_inner().
|
static |
Definition at line 1139 of file gdb_server.c.
References gdb_put_packet().
Referenced by gdb_error(), gdb_query_packet(), and gdb_v_packet().
void gdb_service_free | ( | void | ) |
Definition at line 4106 of file gdb_server.c.
References gdb_port, and gdb_port_next.
Referenced by openocd_main().
|
static |
Definition at line 1407 of file gdb_server.c.
References DIV_ROUND_UP, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, reg::exist, gdb_error(), gdb_put_packet(), gdb_report_register_access_error, gdb_target_to_reg(), get_target_from_connection(), reg::hidden, LOG_DEBUG, LOG_ERROR, name, REG_CLASS_ALL, target::rtos, rtos_set_reg(), reg_arch_type::set, size, target_get_gdb_reg_list_noread(), and reg::type.
Referenced by gdb_input_inner().
|
static |
Definition at line 1295 of file gdb_server.c.
References DIV_ROUND_UP, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, reg::exist, gdb_error(), gdb_put_packet(), gdb_report_register_access_error, gdb_target_to_reg(), get_target_from_connection(), reg::hidden, LOG_DEBUG, LOG_ERROR, LOG_WARNING, name, REG_CLASS_GENERAL, reg_arch_type::set, size, target_get_gdb_reg_list(), and reg::type.
Referenced by gdb_input_inner().
|
static |
Definition at line 3486 of file gdb_server.c.
References gdb_put_packet().
Referenced by gdb_handle_vcont_packet(), and gdb_input_inner().
|
static |
Definition at line 778 of file gdb_server.c.
References gdb_connection::ctrl_c, rtos::current_thread, rtos::current_threadid, DBG_REASON_EXIT, DBG_REASON_WATCHPOINT, target::debug_reason, ERROR_OK, gdb_connection::frontend_state, gdb_last_signal(), gdb_put_packet(), rtos::gdb_target_for_threadid, connection::priv, target::rtos, rtos_update_threads(), target, TARGET_HALTED, TARGET_PRIxADDR, watchpoint_hit(), WPT_ACCESS, WPT_READ, and WPT_WRITE.
Referenced by gdb_frontend_halted(), and gdb_handle_vcont_packet().
|
static |
Definition at line 1696 of file gdb_server.c.
References ERROR_OK, gdb_running_type, get_target_from_connection(), LOG_DEBUG, NULL, target_resume(), and target_step().
Referenced by gdb_input_inner().
Definition at line 1186 of file gdb_server.c.
References DIV_ROUND_UP, gdb_reg_pos(), reg::size, and reg::value.
Referenced by gdb_get_register_packet(), and gdb_get_registers_packet().
int gdb_target_add_all | ( | struct target * | target | ) |
Definition at line 3865 of file gdb_server.c.
References ERROR_OK, gdb_target_add_one(), LOG_WARNING, and target::next.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 3811 of file gdb_server.c.
References alloc_printf(), ERROR_OK, gdb_port, gdb_port_next, target::gdb_port_override, target::gdb_service, gdb_target_start(), LOG_DEBUG, LOG_INFO, parse_long(), target::smp, target_name(), and target_supports_gdb_connection().
Referenced by gdb_target_add_all().
|
static |
Definition at line 959 of file gdb_server.c.
References ERROR_OK, gdb_frontend_halted(), priv, service::priv, connection::service, gdb_service::target, target_call_event_callbacks(), TARGET_EVENT_GDB_END, TARGET_EVENT_GDB_HALT, and TARGET_EVENT_HALTED.
Referenced by gdb_connection_closed(), and gdb_new_connection().
|
static |
Definition at line 2599 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, get_reg_features_list(), LOG_ERROR, NULL, REG_CLASS_ALL, target_get_gdb_arch(), and target_get_gdb_reg_list_noread().
Referenced by gdb_query_packet().
|
static |
Definition at line 3782 of file gdb_server.c.
References add_service(), gdb_service::core, foreach_smp_target, target::gdb_max_connections, target::gdb_service, gdb_service_driver, LOG_INFO, target::smp_targets, target, gdb_service::target, target_list::target, and target_name().
Referenced by gdb_target_add_one().
|
static |
Definition at line 1203 of file gdb_server.c.
References gdb_reg_pos(), and LOG_ERROR.
Referenced by gdb_set_register_packet(), and gdb_set_registers_packet().
|
static |
Definition at line 3249 of file gdb_server.c.
References addr, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, flash_erase_address_range(), flash_set_dirty(), flash_write(), gdb_flash_program, gdb_handle_vcont_packet(), gdb_handle_vrun_packet(), gdb_put_packet(), gdb_send_error(), get_target_from_connection(), image_add_section(), image_close(), image_open(), length, LOG_DEBUG, LOG_ERROR, NULL, connection::priv, target_call_event_callbacks(), TARGET_EVENT_GDB_FLASH_ERASE_END, TARGET_EVENT_GDB_FLASH_ERASE_START, TARGET_EVENT_GDB_FLASH_WRITE_END, TARGET_EVENT_GDB_FLASH_WRITE_START, and gdb_connection::vflash_image.
Referenced by gdb_input_inner().
|
static |
Definition at line 347 of file gdb_server.c.
References gdb_connection::closed, connection_write(), ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, LOG_DEBUG, LOG_WARNING, and connection::priv.
Referenced by gdb_get_packet_inner(), gdb_new_connection(), and gdb_put_packet_inner().
|
static |
Definition at line 1617 of file gdb_server.c.
References addr, ERROR_FAIL, ERROR_NOT_IMPLEMENTED, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_error(), gdb_put_packet(), get_target_from_connection(), LOG_DEBUG, LOG_ERROR, gdb_connection::mem_write_error, connection::priv, target::rtos, rtos_write_buffer(), and target_write_buffer().
Referenced by gdb_input_inner().
|
static |
Definition at line 1566 of file gdb_server.c.
References addr, buffer, ERROR_NOT_IMPLEMENTED, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, gdb_error(), gdb_put_packet(), get_target_from_connection(), LOG_DEBUG, LOG_ERROR, target::rtos, rtos_write_buffer(), target_write_buffer(), and unhexify().
Referenced by gdb_input_inner().
|
static |
Definition at line 2250 of file gdb_server.c.
References ERROR_OK, feature, reg::feature, reg_feature::name, and NULL.
Referenced by gdb_generate_target_description(), and gdb_target_description_supported().
|
static |
Definition at line 2092 of file gdb_server.c.
References NULL.
Referenced by gdb_generate_reg_type_description(), and gdb_generate_target_description().
|
static |
Definition at line 3157 of file gdb_server.c.
References count, NULL, and unhexify().
Referenced by gdb_handle_vrun_packet().
|
static |
Definition at line 2293 of file gdb_server.c.
References ERROR_FAIL, ERROR_OK, reg::exist, foreach_smp_target, LOG_DEBUG, LOG_ERROR, LOG_WARNING, reg::name, NULL, REG_CLASS_ALL, reg::size, target::smp, target::smp_targets, target_list::target, target_get_gdb_reg_list_noread(), target_name(), and target_was_examined().
Referenced by gdb_generate_target_description().
|
static |
Definition at line 104 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_query_packet().
int gdb_actual_connections |
Definition at line 120 of file gdb_server.c.
Referenced by gdb_connection_closed(), gdb_new_connection(), gdb_timeout_warning(), and semihosting_common().
|
static |
Definition at line 106 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_breakpoint_watchpoint_packet().
|
static |
Definition at line 106 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_breakpoint_watchpoint_packet().
|
static |
Definition at line 3979 of file gdb_server.c.
Referenced by gdb_register_commands().
|
static |
Definition at line 127 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_v_packet().
|
static |
Definition at line 110 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), gdb_register_commands(), gdb_service_free(), and gdb_target_add_one().
|
static |
Definition at line 111 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), gdb_register_commands(), gdb_service_free(), and gdb_target_add_one().
|
static |
Definition at line 133 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_read_memory_packet().
|
static |
Definition at line 136 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), gdb_get_register_packet(), gdb_get_registers_packet(), gdb_set_register_packet(), and gdb_set_registers_packet().
|
static |
Definition at line 144 of file gdb_server.c.
Referenced by gdb_fileio_response_packet(), gdb_handle_vcont_packet(), and gdb_step_continue_packet().
|
static |
Definition at line 3751 of file gdb_server.c.
Referenced by gdb_target_start().
|
static |
Definition at line 125 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), gdb_new_connection(), and gdb_query_packet().
|
static |
Definition at line 141 of file gdb_server.c.
Referenced by COMMAND_HANDLER(), and gdb_query_packet().