aboutsummaryrefslogtreecommitdiff
path: root/src/helper/log.h
AgeCommit message (Collapse)AuthorFilesLines
2016-10-07helper/log: Add log_vprintf_lf()Marc Schink1-0/+2
Add log_vprintf_lf() to enable the possibility to output log messages with a variable argument list. Change-Id: I7fd6e93db63a7d98f662df2881a42e4d923c3848 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3709 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-05-24Make #include guard naming consistentMarc Schink1-3/+3
Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink1-3/+1
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-11stlink_usb: Fix swallowed error on read/write operations, add retries on SWD ↵Angus Gratton1-0/+2
WAIT, clean up error debug output. - stlink_usb_get_rw_status() had a bug where FAULT or WAIT responses in read/write operations were ignored, leading to incomplete data. - Added wrapper stlink_cmd_allow_retry to handle SWD_AP_WAIT/SWD_DP_WAIT statuses in most commands. These statuses appear if an SWD read or write received a WAIT ACK response from the target more than 4 times in a row. The driver retries the operation (with exponential backoff) before failing outright (in testing 1 retry was always enough.) - As part of the implementation of stlink_cmd_allow_retry a large number of lines of boilerplate were refactored. - Fleshed out stlink_usb_error_check and added it to some more code paths so WAIT or FAULT responses are logged to debug. WAIT responses will be logged even if they are subsequently retried, which should help in case the retries have subtle side effects (none anticipated.) Tested with two targets: STLINK F0 Discovery, Nordic NRF51822. Only tested with STLINK V2 programmers. Change-Id: I9af24e8f0121b035356dbb9978d6bbf4feb2e4d3 Signed-off-by: Angus Gratton <gus@projectgus.com> Reviewed-on: http://openocd.zylin.com/2201 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-07-22Revert "When calling openocd from a shell like this:"Alex Austin1-1/+1
This reverts commit e8641695c634109ebf5f1149923971770da1d28a Original premise was wrong. Proper command is "shutdown", not "exit". Change-Id: I07f5fe0dda9c24abe53628da986bfda0e406bb4a Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/757 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-11When calling openocd from a shell like this:Stian Skjelsad1-1/+1
openocd -f board/sheevaplug.cfg -c init -c exit the calling shell will believe that openocd exited with an error due to exitval will be non-zero This is not tested against incomming telnet Change-Id: I63d15715a7b46f39a7de261a45039f8c3cad7a98 Signed-off-by: Stian Skjelstad <stian@nixia.no> Reviewed-on: http://openocd.zylin.com/470 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Bill Traynor <wmat@alphatroop.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-02-06build: cleanup src/helper directorySpencer Oliver1-21/+21
Change-Id: I71a312df783995e9083c345c25e73902d5aef59e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/415 Tested-by: jenkins
2012-01-04retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERRORØyvind Harboe1-1/+0
Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/300 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-01-09nit: more LOG_* \n fixesEric Wetzel1-3/+0
Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages Remove LOG_INFO_N LOG_INFO_N was only used once and had a \n at the end Change LOG_USER_N calls that end with \n to LOG_USER
2010-04-10HELPER/LOG: review unused symbolsAntonio Borneo1-8/+0
Remove unused functions: - log_catch - log_rethrow - log_try Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-01-29Clang buildfixesAlex Austin1-1/+6
Building with clang took a few very small changes. The change to helper/log.h is because clang doesn't like an expression where the result is unused. In helper/system.h, I just defined true and false since clang doesn't have them builtin. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03change #include "command.h" to <helper/command.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "command.h" the following form should be used. #include <helper/command.h> The exception is from .c files in the same directory.
2009-11-25log: improve initializationZachary T Welch1-1/+4
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.
2009-11-16helper/log: improve API parameter typesZachary T Welch1-4/+4
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.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-3/+3
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13log_callback_t -> struct log_callbackZachary T Welch1-4/+3
Removes useless and confusing typedef for log callback structure. Types with _t should be suitable for passing by-value as arguments.
2009-11-11log: improve log_callback_fn signatureZachary T Welch1-1/+1
Use unsigned type for line number in log_callback_fn signature.
2009-11-09src/helper: wrap and clean headers.Zachary T Welch1-11/+14
Remove all useless 'extern' keywords from function prototypes. Wraps long lines for readability.
2009-10-19corrective fix for MinGW GNU C99 printf complianceRedirect 'Slash' NIL1-3/+4
Compilation on cygwin, using gcc v3 with option -mno-cygwin, currently produces a large number of the following warnings: warning: `gnu_printf' is an unrecognized format function type These have been introduced with the recent MinGW GNU C99 printf compliance patch, as gnu_printf was only introduced with gcc v4.4 and is not recognized with earlier versions. The attached fix adds gcc version detection to the previous patch to avoid the problem.
2009-10-17More MinGW C99 printf complianceRedirect 'Slash' NIL1-2/+10
Passing "--std=gun99" is unfortunately not sufficient to make current MinGW compilers conform with respect to checking printf format strings. (The C runtime seems not to have problems.) Fix by using a "gnu_printf" format specifier not "printf".
2009-09-25Try/catch scheme. Typed up the functionality and regression tested.oharboe1-0/+9
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
2009-07-17Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace at end of lines, step 2.zwelch1-8/+8
- Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs before ')'.zwelch1-1/+1
- Replace '[ \t]*[)]' with ')'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs after '('.zwelch1-1/+1
- Replace '([ \t]*' with '('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '+' whitespacezwelch1-1/+1
- 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
2009-05-12Audit and remove redundant uses of replacements.h in the tree.zwelch1-1/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1761 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Audit and eliminate redundant helper #include directives.zwelch1-2/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1706 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-13- remove target specific variant and use target->variant memberntfreak1-1/+1
- 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
2008-10-11Duane Ellis: addresses protocol problems with GDB.oharboe1-0/+1
https://lists.berlios.de/pipermail/openocd-development/2008-October/003326.html git-svn-id: svn://svn.berlios.de/openocd/trunk@1039 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-09added busy sleep (for testing purposes)oharboe1-0/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@1033 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-20- added myself to copyright on files i remember adding large contributions ↵ntfreak1-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
2008-08-19added alive_sleep() function to let GDB alive packets be sentoharboe1-0/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@938 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-05Duane Ellis: fix warningsoharboe1-2/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@890 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25added yours sincerely for files where I feel that I've made non-trivial ↵oharboe1-0/+3
contributions. git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-24more error message cleanup. invalid args & syntax errors both now print ↵oharboe1-2/+2
arguments of command. git-svn-id: svn://svn.berlios.de/openocd/trunk@870 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-181. GDB will print cryptic error messages if it is not fed keep-alive packetsoharboe1-0/+2
within the last 2000ms. To fix this, add keep_alive() if you are spending >1000ms in an algorithm thus holding up the server loop. target_call_timer_callbacks() invokes keep_alive(). 2. post_reset script is now executed at normal JTAG speed and not reset speed. 3. Resume is now synchronous again. Hopefully it will work this time. git-svn-id: svn://svn.berlios.de/openocd/trunk@826 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-04Pavel Chromy: fix logging syntax error + formatting & removing obsolete ↵oharboe1-1/+1
comments. git-svn-id: svn://svn.berlios.de/openocd/trunk@702 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-07This matters for embedded devices, but is probably not observably better for ↵oharboe1-1/+1
PC hosted OpenOCD. git-svn-id: svn://svn.berlios.de/openocd/trunk@647 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-25- rename log functions to stop conflicts under win32 (wingdi)ntfreak1-33/+32
git-svn-id: svn://svn.berlios.de/openocd/trunk@523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-10- LOG_SILENT can be used to silence the log(needed in upcoming patches)oharboe1-0/+7
- ERROR_FAIL - added to emphasize that information about what went wrong is contained in Error: log statements and not in a 32 bit return value. git-svn-id: svn://svn.berlios.de/openocd/trunk@481 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-07alloc_printf and alloc_vprintfoharboe1-1/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29Summary: passing of variable argument list reduced, strings sent to logging ↵oharboe1-30/+14
are now formatted just once - more efficient. As a result, ugly string malloc+strcpy are not needed anymore. git-svn-id: svn://svn.berlios.de/openocd/trunk@386 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-28fixed newline gaffe in OUTPUT()oharboe1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@382 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-28Pavel Chromy spotted duplicated newlines gaffe from yours sincerely.oharboe1-0/+5
git-svn-id: svn://svn.berlios.de/openocd/trunk@381 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-28- Added TARGET_REQ_DEBUGCHAR target_request debugmsg. This oharboe1-6/+15
provides a better impeadance match for debug output char fn's, e.g. eCos. - Line endings are now added at the caller site of command_print*(). command_print() still adds a line ending - echo of commands in scripts are now available via debug_level instead of forced echo - Added a USER_SAMELINE() for printing without a lineend. git-svn-id: svn://svn.berlios.de/openocd/trunk@364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25- convert all files to unix line-endingdrath1-113/+113
git-svn-id: svn://svn.berlios.de/openocd/trunk@347 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25Pavel Chromyoharboe1-99/+113
- multiple log listeners - added OUTPUT() to replace printf - fix formatting git-svn-id: svn://svn.berlios.de/openocd/trunk@346 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-18- Added a "User:" debug level. These are messages that are intended for the ↵ntfreak1-2/+15
user and are part of normal operation. - Faster DEBUG/INFO() when they are disabled - target_read/write_buffer() now uses 16 and 32 bit access for single word aligned requests. Other requests are serviced as quickly as possible. - *much* faster read/write GDB packets, removing timeout problems. - GDB read/write packets w/single word aligned 32/16 bit access now use 32/16 bit word access. - working area can now be changed on the fly. Provides a way to move working area about as MMU is enabled/disabled. - cleaned up error messages for verify_image. Thanks Øyvind Harboe git-svn-id: svn://svn.berlios.de/openocd/trunk@302 b42882b7-edfa-0310-969c-e2dbd0fdcd60