OpenOCD
|
Go to the source code of this file.
Macros | |
#define | KEEP_ALIVE_KICK_TIME_MS 500 |
#define | KEEP_ALIVE_TIMEOUT_MS 1000 |
#define | MAX_SOCKET_ERR_MSG_LENGTH 256 |
Functions | |
void | alive_sleep (uint64_t ms) |
char * | alloc_printf (const char *format,...) |
char * | alloc_vprintf (const char *fmt, va_list ap) |
void | busy_sleep (uint64_t ms) |
COMMAND_HANDLER (handle_debug_level_command) | |
COMMAND_HANDLER (handle_log_output_command) | |
const char * | find_nonprint_char (const char *buf, unsigned int buf_len) |
Find the first non-printable character in the char buffer, return a pointer to it. More... | |
static void | gdb_timeout_warning (int64_t delta_time) |
void | keep_alive (void) |
void | kept_alive (void) |
int | log_add_callback (log_callback_fn fn, void *priv) |
void | log_exit (void) |
static void | log_forward (const char *file, unsigned int line, const char *function, const char *string) |
void | log_init (void) |
Initialize logging module. More... | |
void | log_printf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format,...) |
void | log_printf_lf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format,...) |
static void | log_puts (enum log_levels level, const char *file, int line, const char *function, const char *string) |
int | log_register_commands (struct command_context *cmd_ctx) |
int | log_remove_callback (log_callback_fn fn, void *priv) |
void | log_socket_error (const char *socket_desc) |
void | log_vprintf_lf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format, va_list args) |
Variables | |
static int | count |
int | debug_level = LOG_LVL_INFO |
static int64_t | last_time |
static struct log_callback * | log_callbacks |
static const struct command_registration | log_command_handlers [] |
static FILE * | log_output |
static const char *const | log_strings [6] |
static int64_t | start |
void alive_sleep | ( | uint64_t | ms | ) |
Definition at line 456 of file log.c.
References keep_alive().
Referenced by aduc702x_check_flash_completion(), aducm360_check_flash_completion(), ambiqmicro_exec_command(), ap_poll_register(), arc_exit_debug(), arc_halt(), arc_step(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_soft_reset_halt(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), at91sam7_wait_status_busy(), at91sam9_nand_ready(), bitbang_swd_read_reg(), bitbang_swd_write_reg(), cfi_intel_wait_status_busy(), cfi_spansion_wait_status_busy(), COMMAND_HANDLER(), cortex_m_soft_reset_halt(), dap_dp_poll_register(), davinci_nand_ready(), efm32x_wait_status(), em357_wait_status_busy(), esirisc_wait_debug_active(), esp32_apptrace_wait4halt(), esp32_apptrace_wait_tracing_finished(), esp32_soc_reset(), esp32s2_soc_reset(), esp32s3_soc_reset(), esp_algorithm_run_image(), fespi_wip(), imx31_nand_ready(), isc_leave(), jtag_sleep(), jtagspi_wait(), kinetis_ke_ftmrx_command(), kinetis_ke_mdm_poll_register(), kinetis_ke_prepare_flash(), kinetis_mdm_poll_register(), lpc2900_wait_status(), lpc3180_controller_ready(), lpc3180_nand_ready(), lpc3180_tc_ready(), lpc32xx_controller_ready(), lpc32xx_dma_ready(), lpc32xx_nand_ready(), lpc32xx_tc_ready(), mrvlqspi_fifo_flush(), mrvlqspi_flash_busy_status(), mrvlqspi_set_ss_state(), mrvlqspi_stop_transfer(), mxc_nand_ready(), nand_page_command(), nand_poll_ready(), nand_read_status(), nrf5_erase_page(), nrf5_wait_for_nvmc(), nuc910_nand_ready(), or1k_is_cpu_running(), pic32mx_wait_status_busy(), poll_busy(), poll_ssp_busy(), poll_tff(), psoc5lp_spc_busy_wait_data(), psoc5lp_spc_busy_wait_idle(), rpc_hf_wait_tend(), s3c2440_nand_ready(), sh_qspi_wait_for_bit(), sim3x_erase_page(), sim3x_flash_erase(), stm32l4_wait_status_busy(), stm32lx_wait_until_bsy_clear_timeout(), stm32x_wait_flash_op_queue(), stm32x_wait_status_busy(), stm32x_write_option(), stmqspi_erase(), str7x_waitbusy(), str9x_erase(), str9x_write(), str9xpec_erase_area(), swd_connect_multidrop(), swd_connect_single(), swm050_erase(), swm050_mass_erase(), target_profiling_default(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), tms470_try_flash_keys(), tms470_write(), w600_start_do(), wait_till_ready(), xcf_erase_check(), xds110_init(), xmc4xxx_wait_status_busy(), xscale_read_tx(), and xscale_write_rx().
char* alloc_printf | ( | const char * | format, |
... | |||
) |
Definition at line 364 of file log.c.
References alloc_vprintf().
Referenced by __attribute__(), __register_commands(), add_connection(), add_default_dirs(), add_user_dirs(), alloc_concatenate_strings(), COMMAND_HANDLER(), COMMAND_HELPER(), esirisc_get_gdb_arch(), find_file(), gdb_handle_vrun_packet(), gdb_query_packet(), gdb_target_add_one(), get_home_dir(), jim_command_dispatch(), jtag_examine_chain(), parse_cmdline_args(), register_command(), script_debug(), target_jim_get_reg(), telnet_auto_complete(), and zephyr_fetch_thread_list().
char* alloc_vprintf | ( | const char * | fmt, |
va_list | ap | ||
) |
Definition at line 339 of file log.c.
References NULL.
Referenced by __attribute__(), alloc_printf(), command_print(), command_print_sameline(), command_run_linef(), log_printf(), and log_vprintf_lf().
void busy_sleep | ( | uint64_t | ms | ) |
Definition at line 469 of file log.c.
References timeval_ms().
Referenced by COMMAND_HANDLER(), niietcm4_opstatus_check(), niietcm4_uopstatus_check(), numicro_erase(), numicro_fmc_cmd(), and numicro_write().
COMMAND_HANDLER | ( | handle_debug_level_command | ) |
Definition at line 197 of file log.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), debug_level, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_ERROR, LOG_LVL_DEBUG_IO, and LOG_LVL_SILENT.
COMMAND_HANDLER | ( | handle_log_output_command | ) |
Definition at line 215 of file log.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, and log_output.
const char* find_nonprint_char | ( | const char * | buf, |
unsigned int | buf_len | ||
) |
Find the first non-printable character in the char buffer, return a pointer to it.
If no such character exists, return NULL.
Definition at line 508 of file log.c.
References NULL.
Referenced by gdb_log_incoming_packet(), and gdb_log_outgoing_packet().
|
static |
Definition at line 398 of file log.c.
References gdb_get_actual_connections(), KEEP_ALIVE_TIMEOUT_MS, LOG_DEBUG, and LOG_WARNING.
Referenced by keep_alive(), and kept_alive().
void keep_alive | ( | void | ) |
Definition at line 415 of file log.c.
References gdb_timeout_warning(), KEEP_ALIVE_KICK_TIME_MS, KEEP_ALIVE_TIMEOUT_MS, last_time, server_keep_clients_alive(), and timeval_ms().
Referenced by alive_sleep(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_read_memory(), arm7_9_soft_reset_halt(), arm7_9_write_memory(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), armv7a_l1_d_cache_clean_virt(), armv7a_l1_d_cache_flush_level(), armv7a_l1_d_cache_flush_virt(), armv7a_l1_d_cache_inval_virt(), armv7a_l1_i_cache_inval_virt(), ath79_erase(), avrf_write(), cc26xx_wait_algo_done(), cc26xx_write(), cc3220sf_erase(), cc3220sf_mass_erase(), cc3220sf_write(), cfi_intel_write_block(), COMMAND_HANDLER(), COMMAND_HELPER(), cortex_m_load_core_reg_u32(), cortex_m_store_core_reg_u32(), dmi_op_timeout(), efm32x_write_word(), esirisc_flash_wait(), fespi_erase(), image_calculate_checksum(), ipc_acquire(), ipc_poll_lock_stat(), jtag_add_sleep(), kinetis_write_inner(), kinetis_write_sections(), mips64_ejtag_fastdata_scan(), mips_ejtag_add_scan_96(), mips_ejtag_drscan_32_queued(), mips_ejtag_drscan_64(), mips_ejtag_fastdata_scan(), mpsse_flush(), msp432_wait_inactive(), msp432_wait_return_code(), msp432_write(), npcx_get_flash_id(), nrf5_wait_for_nvmc(), qn908x_write(), qspi_verify(), read_memory_bus_v1(), riscv_batch_run(), riscv_get_register(), riscv_program_exec(), riscv_set_register(), samd_check_error(), same5_wait_and_check_error(), sh_qspi_erase(), slow_fespi_write_buffer(), stlink_tcp_send_cmd(), stmqspi_blank_check(), stmqspi_erase(), stmsmi_erase(), stmsmi_write(), target_call_timer_callbacks_check_time(), target_fill_mem(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), target_wait_state(), xmc4xxx_wait_status_busy(), xscale_read_tx(), xscale_write_rx(), and xtensa_wait_algorithm().
void kept_alive | ( | void | ) |
Definition at line 443 of file log.c.
References gdb_timeout_warning(), KEEP_ALIVE_TIMEOUT_MS, last_time, and timeval_ms().
Referenced by gdb_put_packet().
int log_add_callback | ( | log_callback_fn | fn, |
void * | priv | ||
) |
Definition at line 297 of file log.c.
References ERROR_BUF_TOO_SMALL, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, log_callback::fn, log_callbacks, log_callback::next, log_callback::priv, and priv.
Referenced by command_log_capture_start(), gdb_new_connection(), and telnet_new_connection().
void log_exit | ( | void | ) |
Definition at line 287 of file log.c.
References log_output, and NULL.
Referenced by openocd_main().
|
static |
Definition at line 56 of file log.c.
References log_callback::fn, log_callbacks, log_callback::next, and log_callback::priv.
Referenced by log_puts().
void log_init | ( | void | ) |
Initialize logging module.
Call during program startup.
Definition at line 267 of file log.c.
References debug_level, ERROR_OK, last_time, LOG_LVL_DEBUG_IO, LOG_LVL_SILENT, log_output, start, and timeval_ms().
Referenced by setup_command_handler().
void log_printf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
Definition at line 134 of file log.c.
References alloc_vprintf(), count, debug_level, and log_puts().
void log_printf_lf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
Definition at line 183 of file log.c.
References log_vprintf_lf().
Referenced by dump_field(), gdb_new_connection(), jtag_examine_chain_display(), and svf_hexbuf_print().
|
static |
Definition at line 78 of file log.c.
References count, debug_level, info, log_forward(), LOG_LVL_DEBUG, LOG_LVL_INFO, LOG_LVL_OUTPUT, LOG_LVL_USER, log_output, log_strings, start, and timeval_ms().
Referenced by log_printf(), and log_vprintf_lf().
int log_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 262 of file log.c.
References log_command_handlers, NULL, and register_commands().
Referenced by setup_command_handler().
int log_remove_callback | ( | log_callback_fn | fn, |
void * | priv | ||
) |
Definition at line 322 of file log.c.
References ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, log_callback::fn, log_callbacks, log_callback::next, log_callback::priv, and priv.
Referenced by command_log_capture_finish(), gdb_connection_closed(), and telnet_connection_closed().
void log_socket_error | ( | const char * | socket_desc | ) |
Definition at line 484 of file log.c.
References DWORD, LOG_ERROR, MAX_SOCKET_ERR_MSG_LENGTH, and NULL.
Referenced by gdb_get_char_inner(), jtag_vpi_quit(), jtag_vpi_receive_cmd(), jtag_vpi_send_cmd(), remote_bitbang_fill_buf(), remote_bitbang_flush(), remote_bitbang_init_tcp(), remote_bitbang_init_unix(), remote_bitbang_quit(), semihosting_redirect_read(), and semihosting_redirect_write().
void log_vprintf_lf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
va_list | args | ||
) |
Definition at line 159 of file log.c.
References alloc_vprintf(), count, debug_level, and log_puts().
Referenced by jaylink_log_handler(), and log_printf_lf().
|
static |
Definition at line 53 of file log.c.
Referenced by log_printf(), log_puts(), and log_vprintf_lf().
int debug_level = LOG_LVL_INFO |
Definition at line 35 of file log.c.
Referenced by arc_arch_state(), arc_exit_debug(), arc_halt(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_soft_reset_halt(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), COMMAND_HANDLER(), default_interface_jtag_execute_queue(), dump_field(), ecos_check_app_info(), execute_abstract_command(), log_init(), log_memory_access(), log_printf(), log_puts(), log_vprintf_lf(), poll_target(), script_debug(), xscale_read_tx(), and xscale_write_rx().
|
static |
Definition at line 40 of file log.c.
Referenced by keep_alive(), kept_alive(), and log_init().
|
static |
Definition at line 38 of file log.c.
Referenced by log_add_callback(), log_forward(), and log_remove_callback().
|
static |
Definition at line 215 of file log.c.
Referenced by log_register_commands().
|
static |
Definition at line 37 of file log.c.
Referenced by COMMAND_HANDLER(), log_exit(), log_init(), and log_puts().
|
static |
Definition at line 44 of file log.c.
Referenced by log_puts().
|
static |
Definition at line 42 of file log.c.
Referenced by COMMAND_HANDLER(), deassert_reset(), dmi_op_timeout(), ejtag_dma_dstrt_poll(), eneispif_wait(), fespi_rx(), fespi_tx(), fespi_txwm_wait(), full_step(), gdb_memory_map(), linux_get_tasks(), linux_task_update(), log_init(), log_puts(), mpsse_flush(), msp432_write(), read_sbcs_nonbusy(), riscv013_clear_abstract_error(), riscv_run_algorithm(), sample_memory(), setup_bank(), wait_for_authbusy(), wait_for_debugint_clear(), wait_for_idle(), wait_for_state(), write_memory_bus_v1(), write_memory_progbuf(), xmc1xxx_erase_check(), xtensa_do_step(), and xtensa_region_ar_exec().