fix telnet async messages. retired telnet_async command - no user serviceable parts inside.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1135 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-11-05 08:48:50 +00:00
parent bbafcb3758
commit 71c7306885
7 changed files with 78 additions and 80 deletions

View File

@ -265,10 +265,6 @@ OpenOCD command line using the @option{-c} command line switch.
@item @b{telnet_port} <@var{number}>
@cindex telnet_port
@*Port on which to listen for incoming telnet connections
@item @b{telnet_async} <@var{enable/disable}>
@cindex telnet_async
@*Enable/disable asynchronous messages. Default off. Slows down debugging
if enabled and telnet session is open while stepping.
@item @b{tcl_port} <@var{number}>
@cindex tcl_port
@*Port on which to listen for incoming TCL syntax. This port is intended as

View File

@ -302,21 +302,6 @@ proc verify {args} {
add_help_text verify "synonym to verify_image"
add_help_text telnet_async "<enable/disable> - enable/disable async messages. Default 0."
global telnet_async_state
set telnet_async_state 0
proc telnet_async {state} {
global telnet_async_state
if {[string compare $state enable]==0} {
set telnet_async_state 1
} elseif {[string compare $state disable]==0} {
set telnet_async_state 0
} else {
return -code error "Illegal option $state"
}
}
add_help_text cpu "<name> - prints out target options and a comment on CPU which matches name"

View File

@ -106,8 +106,18 @@ static int log_target_callback_event_handler(struct target_s *target, enum targe
{
switch (event)
{
case TARGET_EVENT_GDB_START:
target->display=0;
break;
case TARGET_EVENT_GDB_END:
target->display=1;
break;
case TARGET_EVENT_HALTED:
if (target->display)
{
/* do not display information when debugger caused the halt */
target_arch_state(target);
}
break;
default:
break;

View File

@ -671,6 +671,7 @@ static void gdb_frontend_halted(struct target_s *target, connection_t *connectio
{
char sig_reply[4];
int signal;
/* stop forwarding log packets! */
log_remove_callback(gdb_log_callback, connection);
@ -701,6 +702,9 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
case TARGET_EVENT_EARLY_HALTED:
gdb_frontend_halted(target, connection);
break;
case TARGET_EVENT_HALTED:
target_call_event_callbacks(target, TARGET_EVENT_GDB_END);
break;
case TARGET_EVENT_GDB_FLASH_ERASE_START:
target_handle_event( target, TARGET_EVENT_OLD_gdb_program_config );
if((retval = jtag_execute_queue()) != ERROR_OK)
@ -815,6 +819,7 @@ int gdb_connection_closed(connection_t *connection)
}
target_unregister_event_callback(gdb_target_callback_event_handler, connection);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_END);
log_remove_callback(gdb_log_callback, connection);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_DETACH );
@ -2054,6 +2059,7 @@ int gdb_input_inner(connection_t *connection)
gdb_connection_t *gdb_con = connection->priv;
gdb_con->frontend_state = TARGET_RUNNING;
log_add_callback(gdb_log_callback, connection);
target_call_event_callbacks(target, TARGET_EVENT_GDB_START);
int retval=gdb_step_continue_packet(connection, target, packet, packet_size);
if (retval!=ERROR_OK)
{

View File

@ -48,11 +48,6 @@ static unsigned short telnet_port = 0;
int handle_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_telnet_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int telnet_async()
{
return jim_global_long("telnet_async_state");
}
static char *negotiate =
"\xFF\xFB\x03" /* IAC WILL Suppress Go Ahead */
"\xFF\xFB\x01" /* IAC WILL Echo */
@ -191,7 +186,6 @@ int telnet_new_connection(connection_t *connection)
telnet_connection->next_history = 0;
telnet_connection->current_history = 0;
if (telnet_async())
log_add_callback(telnet_log_callback, connection);
@ -348,14 +342,8 @@ int telnet_input(connection_t *connection)
t_con->line_cursor = -1; /* to supress prompt in log callback during command execution */
if (!telnet_async())
log_add_callback(telnet_log_callback, connection);
retval = command_run_line(command_context, t_con->line);
if (!telnet_async())
log_remove_callback(telnet_log_callback, connection);
t_con->line_cursor = 0;
if (retval == ERROR_COMMAND_CLOSE_CONNECTION)

View File

@ -175,6 +175,11 @@ const Jim_Nvp nvp_target_event[] = {
{ .value = TARGET_EVENT_RESUME_START, .name = "resume-start" },
{ .value = TARGET_EVENT_RESUME_END, .name = "resume-end" },
{ .name = "gdb-start", .value = TARGET_EVENT_GDB_START },
{ .name = "gdb-end", .value = TARGET_EVENT_GDB_END },
/* historical name */
{ .value = TARGET_EVENT_RESET_START, .name = "reset-start" },
@ -3841,6 +3846,8 @@ target_create( Jim_GetOptInfo *goi )
target->next = NULL;
target->arch_info = NULL;
target->display = 1;
/* initialize trace information */
target->trace_info = malloc(sizeof(trace_t));
target->trace_info->num_trace_points = 0;

View File

@ -268,6 +268,9 @@ typedef struct target_s
u32 dbg_msg_enabled; /* debug message status */
void *arch_info; /* architecture specific information */
struct target_s *next; /* next target in list */
int display; /* display async info in telnet session. Do not display
lots of halted/resumed info when stepping in debugger. */
} target_t;
enum target_event
@ -290,6 +293,9 @@ enum target_event
TARGET_EVENT_RESUME_START,
TARGET_EVENT_RESUME_END,
TARGET_EVENT_GDB_START, /* debugger started execution (step/run) */
TARGET_EVENT_GDB_END, /* debugger stopped execution (step/run) */
TARGET_EVENT_RESET_START,
TARGET_EVENT_RESET_ASSERT_PRE,
TARGET_EVENT_RESET_ASSERT_POST,