summaryrefslogtreecommitdiff
path: root/src/helper/log.c
Commit message (Collapse)AuthorAgeFilesLines
* log: debug level is between silent and debug output levelsØyvind Harboe2011-02-251-9/+8
| | | | | | It wasn't previously possible to silence the output. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* log: remove hack to redirect logs when pipes are in useØyvind Harboe2010-10-011-17/+2
| | | | | | | | | | | There is an explicit command "log_output" that can be used to redirect log output to a file, no need for a hack in the first place. Before enabling pipes, use "log_output foo" to redirect log output to the "foo" files. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: fix bug in tcl "puts"Øyvind Harboe2010-05-181-9/+4
| | | | | | | | | | | | tcl "puts" didn't work because the logging code sensored strings that did not include a '\n'. The correct thing is to sensor empty strings, which are used to keep gdb connection alive. The tcl "puts" code broke apart strings which do contain '\n' in order to implement the -nonewline argument, which is how it got hurt by the bug in log.c Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* HELPER/LOG: review unused symbolsAntonio Borneo2010-04-101-38/+0
| | | | | | | | | Remove unused functions: - log_catch - log_rethrow - log_try Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* src/helper: usage/help updatesDavid Brownell2010-01-091-8/+13
| | | | | | | | | | Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Fix some whitespace glitches, shrink a few overlong lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* change #include "server.h" to <server/server.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "server.h" the following form should be used. #include <server/server.h> The exception is from .c files in the same directory.
* support OPENOCD_DEBUG_LEVEL environment settingZachary T Welch2009-11-251-0/+13
| | | | | Detect the OPENOCD_DEBUG_LEVEL setting in log_init(), allowing the very early startup phases to be debugged.
* log: improve initializationZachary T Welch2009-11-251-8/+3
| | | | | | Removes redundant assignment of start_ms from log_register_commands(). Eliminates command_context parameter and return value. Adds Doxygen comment block for this API call.
* log: use register_commands()Zachary T Welch2009-11-241-5/+19
| | | | | Use register_commands() for logging callbacks. Improve help and add proper usage.
* use COMMAND_REGISTER macroZachary T Welch2009-11-241-2/+2
| | | | | Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
* improve alloc_vprintfAndreas Fritiofson2009-11-241-27/+16
| | | | | | | | | | | | | | The previous implementation was unnecessarily complex. Get rid of the loops, let vsnprintf() tell us directly how much storage we need and allocate that. A second pass writes the actual string. Also add a va_end() that was missing. This should be much faster for large strings and less wasteful for small ones. A quirk that has been retained is that some callers patch in a newline at the end of the returned string and depend on alloc_vprintf to allocate at least one byte extra. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: Zachary T Welch <zw@superlucidity.net>
* command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch2009-11-171-1/+1
| | | | Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
* command_handler: change 'args' to CMD_ARGVZachary T Welch2009-11-171-2/+2
| | | | | This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
* command_handler: change to 'argc' to CMD_ARGCZachary T Welch2009-11-171-3/+3
| | | | | This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
* helper/log: improve API parameter typesZachary T Welch2009-11-161-15/+12
| | | | | | | Uses unsigned type to pass line numbers. Use uint64_t to pass sleep routines their milliseconds. Updates sleep routines to use this type and improve whitespace.
* target: less implicit inclusion of "command.h"David Brownell2009-11-161-1/+0
| | | | | | | | | | Lots of files still include it, often through needless duplicate inclusion of "log.h"; sigh. This cleans up the inclusion graph a bunch, so there are fewer inclusion paths, but it doesn't change much otherwise. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* command_context_t -> struct command_contextZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* log_callback_t -> struct log_callbackZachary T Welch2009-11-131-5/+5
| | | | | Removes useless and confusing typedef for log callback structure. Types with _t should be suitable for passing by-value as arguments.
* use COMMAND_HANDLER macro to define all commandsZachary T Welch2009-11-131-2/+2
|
* Improve debug_level command argument parsing.Zachary T Welch2009-11-051-3/+1
|
* Try/catch scheme. Typed up the functionality and regression tested.oharboe2009-09-251-9/+91
| | | | | | Ready for discussion and tiny patches that tries out this scheme. git-svn-id: svn://svn.berlios.de/openocd/trunk@2755 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe2009-07-171-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '[<>]' whitespacezwelch2009-06-231-5/+5
| | | | | | | | | | - Replace ')\([<>]\)(' with ') \1 ('. - Replace ')\([<>]\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\([<>]\)(' with '\1 \2 ('. - Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '+' whitespacezwelch2009-06-231-2/+2
| | | | | | | | | | - Replace ')\(+\)(' with ') \1 ('. - Replace ')\(+\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(+\)(' with '\1 \2 ('. - Replace '\(\w\)\(+\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '=' whitespacezwelch2009-06-231-13/+13
| | | | | | | | | - Replace ')\(=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(=\)(' with '\1 \2 ('. - Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '[+]=' whitespacezwelch2009-06-231-1/+1
| | | | | | | | - Replace '\(\w\)\([+]=\)(' with '\1 \2 ('. - Replace '\(\w\)\([+]=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '!=' whitespacezwelch2009-06-231-1/+1
| | | | | | | | | - Replace ')\(!=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(!=\)(' with '\1 \2 ('. - Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Replace 'if(' with 'if ('.zwelch2009-06-231-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - fix break caused by r2208 when using --pipe optionntfreak2009-06-211-2/+2
| | | | | | - issue is gdb stdin buffer gets full before we redirect openocd output git-svn-id: svn://svn.berlios.de/openocd/trunk@2350 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and improve handle_debug_level_comamnd:zwelch2009-06-121-10/+11
| | | | | | | | | | - Bug fix: Return a syntax error if more than one argument is given. - Bug fix: Use new parse_uint helper ensure debug_level parses correctly. - Change: Display the debug_level after it has been set. - Simplify bounds checking of debug_level. git-svn-id: svn://svn.berlios.de/openocd/trunk@2208 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Nicolas Pitre <nico@cam.org>kc8apf2009-05-271-1/+13
| | | | | | | | - Silence errors about keep_alive() not being called frequently enough unless a gdb session is active or debugging is enabled git-svn-id: svn://svn.berlios.de/openocd/trunk@1933 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Mark API layering violations in the helper module with @todo notes.zwelch2009-05-111-0/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1718 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Audit and eliminate redundant helper #include directives.zwelch2009-05-111-8/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1706 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add --enable-malloc-logging configure option and update log.c to match.zwelch2009-05-111-5/+8
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1703 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* made warning about keep_alive() not being invoked more helpfuloharboe2009-05-051-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - remove build warningsntfreak2009-03-171-0/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1415 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Dick Hollenbeck <dick@softplc.com> better loggingoharboe2008-12-191-7/+8
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1262 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - add ability for openocd to communicate to gdb using pipes (stdin/stdout).ntfreak2008-12-151-2/+17
| | | | | | - this is enabled by new command line option option --pipe. git-svn-id: svn://svn.berlios.de/openocd/trunk@1242 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - remove target specific variant and use target->variant memberntfreak2008-12-131-1/+0
| | | | | | | - fix build warning in cortex_m3 - code cleanup - remove trailing lf and convert c++ comments git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* sleep command now prints out target debugmsgs w/anything like usable performanceoharboe2008-10-161-4/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1076 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added busy sleep (for testing purposes)oharboe2008-10-091-0/+11
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1033 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - added myself to copyright on files i remember adding large contributions ↵ntfreak2008-09-201-1/+4
| | | | | | | | | for over the years - cleaned up headers to match rest of code - added missing svn props for previously added files git-svn-id: svn://svn.berlios.de/openocd/trunk@987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixed regression introduced in 890 when "fixing warnings" for ↵oharboe2008-09-121-33/+33
| | | | | | | | | | target_call_timer_callbacks_now(). target_call_timer_callbacks_now() did the same as target_call_timer_callbacks(). - Reduced keep_alive()'s job to only deal with GDB keep alive problems. git-svn-id: svn://svn.berlios.de/openocd/trunk@985 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* keep_alive now invokes target_call_timer_callbacks_nowoharboe2008-09-081-7/+14
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@981 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added alive_sleep() function to let GDB alive packets be sentoharboe2008-08-191-0/+17
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@938 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* avoid empty lines in log as a keep_alive() sideffectoharboe2008-08-131-3/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@909 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Kuehling <dvdkhlng@gmx.de> - added jim-eventloop.coharboe2008-08-071-0/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@898 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added yours sincerely for files where I feel that I've made non-trivial ↵oharboe2008-07-251-0/+3
| | | | | | contributions. git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Only print out gobs of information to log when -d3 is enabled.oharboe2008-07-221-2/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@855 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* BUG: prefix to timeout for gdb keep alive packets.oharboe2008-07-201-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@844 b42882b7-edfa-0310-969c-e2dbd0fdcd60