*/
static void log_puts(enum log_levels level, const char *file, int line, const char *function, const char *string)
{
*/
static void log_puts(enum log_levels level, const char *file, int line, const char *function, const char *string)
{
if (level == LOG_OUTPUT)
{
/* do not prepend any headers, just print out what we were given and return */
if (level == LOG_OUTPUT)
{
/* do not prepend any headers, just print out what we were given and return */
/* Never forward LOG_DEBUG, too verbose and they can be found in the log if need be */
if (level <= LOG_INFO)
{
/* Never forward LOG_DEBUG, too verbose and they can be found in the log if need be */
if (level <= LOG_INFO)
{
- log_callback_t *cb;
- for (cb = log_callbacks; cb; cb = cb->next)
+ log_callback_t *cb, *next;
+ cb = log_callbacks;
+ /* DANGER!!!! the log callback can remove itself!!!! */
+ while (cb)
cb->fn(cb->priv, file, line, function, string);
cb->fn(cb->priv, file, line, function, string);
int gdb_output(struct command_context_s *context, char* line)
{
/* this will be dumped to the log and also sent as an O packet if possible */
int gdb_output(struct command_context_s *context, char* line)
{
/* this will be dumped to the log and also sent as an O packet if possible */
target_process_events(cmd_ctx);
target_process_events(cmd_ctx);
- target_arch_state(target);
-