summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-24 18:52:45 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-24 18:52:45 +0000
commit1aa854684de1827edd3b605fc64a78a498f2358a (patch)
tree570d9229ec0b96cb12b564974ca6009064bdf5bb /src/server
parent379f0b0b9b10d4bc2a018d3683bd6de45e186b2b (diff)
downloadopenocd+libswd-1aa854684de1827edd3b605fc64a78a498f2358a.tar.gz
openocd+libswd-1aa854684de1827edd3b605fc64a78a498f2358a.tar.bz2
openocd+libswd-1aa854684de1827edd3b605fc64a78a498f2358a.tar.xz
openocd+libswd-1aa854684de1827edd3b605fc64a78a498f2358a.zip
- fixed target->type->poll() return value
- added arch_state to show status of currently selected target - simplified target->type->arch_state() api. - clean up telnet output a bit - fixed GDB output for arch_state - removed a couple of unecessary exit()'s - cleaned up error propagation a bit in a few places git-svn-id: svn://svn.berlios.de/openocd/trunk@332 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/server')
-rw-r--r--src/server/telnet_server.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index e84d0454..b40daca8 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -93,10 +93,21 @@ void telnet_log_callback(void *priv, const char *file, int line,
{
connection_t *connection = priv;
char *t = allocPrintf(format, args);
+ char *t2;
if (t == NULL)
return;
+ t2=t;
+ char *endline;
+ do
+ {
+ if ((endline=strchr(t2, '\n'))!=NULL)
+ {
+ *endline=0;
+ }
+ telnet_outputline(connection, t2);
+ t2=endline+1;
+ } while (endline);
- telnet_outputline(connection, t);
free(t);
}
@@ -106,15 +117,12 @@ int telnet_target_callback_event_handler(struct target_s *target, enum target_ev
struct command_context_s *cmd_ctx = priv;
connection_t *connection = cmd_ctx->output_handler_priv;
telnet_connection_t *t_con = connection->priv;
- char buffer[512];
switch (event)
{
case TARGET_EVENT_HALTED:
command_print(cmd_ctx, "Target %i halted", get_num_by_target(target));
- target->type->arch_state(target, buffer, 512);
- buffer[511] = 0;
- command_print(cmd_ctx, "%s", buffer);
+ target_arch_state(target);
if (!t_con->suppress_prompt)
telnet_prompt(connection);
break;