Commit Graph

649 Commits

Author SHA1 Message Date
Spencer Oliver ff1108ad38 telnet: add telnet history support
adapted from Yoshinori Sato's patch:
2f07f4600a

Change-Id: I084b86d316b0aa6e9593f007c024961dbda805e9
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1310
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-04-21 07:28:32 +00:00
Spencer Oliver bf3f35092e helper: hexify correctly handle signed chars
The current implementation of hexify was not correctly handling signed chars.

This function is currently used by the ti-icdi driver and as such was causing
random write issues.

As a note perhaps a better long term fix would be to change to using uint8_t
buffers rather than char. This will require changes to the ti-icdi driver
aswell.

Change-Id: I572e69ff2b99227a7d412de056458c0393794b03
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1124
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-01-31 14:50:24 +00:00
Spencer Oliver 95025349fa helper: improve windows gdb pipe performance
Reducing the select and MsgWaitForMultipleObjects timeouts to 1ms makes
a 2-300+% increase in the step time of gdb when using pipes under windows OS.

Change-Id: Id7e52cfb2b206347a9caea61672885a3e2b186de
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1050
Tested-by: jenkins
2012-12-24 11:01:03 +00:00
Spencer Oliver adb8ec32dc icdi: add TI icdi interface
This is the new proprietary interface replacing the older FTDI based adapters.
It is currently fitted to the ek-lm4f232 and Stellaris LaunchPad.

Change-Id: I794ad79e31ff61ec8e9f49530aca9308025c0b60
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/922
Tested-by: jenkins
2012-12-23 21:46:20 +00:00
Spencer Oliver 27ad96e0d9 helper: fix code formatting
Change-Id: Ide2d704c9ef4f5563649d5db53bbdd3641868b70
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/995
Tested-by: jenkins
2012-12-03 16:37:03 +00:00
Aymeric Vincent 1a8223f28b Make NetBSD a recognized system
Change-Id: I7fcb540553da7833a8b6a82335a7296539a8f491
Signed-off-by: Aymeric Vincent <vincent.aymeric@gmail.com>
Reviewed-on: http://openocd.zylin.com/998
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: jenkins
2012-11-30 17:16:45 +00:00
Edgar Grimberg 6f65045b37 ioutil: make the file compile on MacOS
The meminfo command cannot exist if the malloc.h header is not
present.
Cannot get the mac address without sys/ioctl.h and SIOCGIFHWADDR
defined

Change-Id: Ifc0fb98c3a60c53ad2e19473e08b34c460529d0b
Signed-off-by: Edgar Grimberg <edgar.grimberg@gmail.com>
Reviewed-on: http://openocd.zylin.com/912
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-28 01:38:58 +00:00
Spencer Oliver 8a271d9dd1 build: remove unnecessary jim.h include
as well as not being required, as it is already included by jim-nvp.h.
It also makes the doxygen output a bit clearer to read.

Change-Id: Ia2bed7142b4a56b48b1ecf0734e63f860dcd1014
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/859
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02 11:36:39 +00:00
Freddie Chopin 07158a7f8a Add another scripts search path for Windows builds
Add single "scripts" folder to search path for Windows OpenOCD builds
that don't use cygwin
bin/openocd.exe
scripts/interface/dummy.cfg
scripts/target/at91eb40a.cfg

Do some refactoring of current code (thx to Andreas).

Change-Id: Idbb08d1368b06f25da44f4f9ab1511db992b1724
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/785
Tested-by: jenkins
2012-08-29 06:26:21 +00:00
Spencer Oliver 0e4dee1164 helper: command.c cleanup
Change-Id: I66643960e38625e843b5f54d1c072e4eee78284d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/772
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24 16:49:30 +00:00
Alan Bowman 8cf671ea7b Test the incoming debug_level, rather than the current.
The existing code tests the current debug_level for validity, allowing
the user to set it too high and never change it after that.  The new
behaviour is to test the debug_level that the user has requested.

Change-Id: I85726a2e606c8d137e9b1cfe76fee865084844b1
Signed-off-by: Alan Bowman <alan.michael.bowman@gmail.com>
Reviewed-on: http://openocd.zylin.com/764
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-07-27 09:50:34 +00:00
Alex Austin 10fd274cfe Revert "When calling openocd from a shell like this:"
This reverts commit e8641695c6

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-22 19:18:22 +00:00
Stian Skjelsad e8641695c6 When calling openocd from a shell like this:
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-07-11 08:16:04 +00:00
Andreas Fritiofson 6d639b09f0 Add a bit-level transfer queue
Interface drivers regularly need to keep track of where each part of a long
read buffer should be copied, once that data arrives. Both source and
destination are often at an arbitrary bit offset.

This queued bit-level copy can help with that, by allowing the driver to
perform postponed reads from the receive buffer already when building the
transmit buffer, and have those reads executed at a later time when data is
available.

For simplicity, it uses the linked list implementation list.h imported from
the Linux kernel.

Change-Id: I06862a0a6f057cbbcacfb021f17a795195faded2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/450
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-06 14:58:25 +00:00
Spencer Oliver 7bfcc10839 build: add helper/types.h to config.h
this header is used in numerous files and adding to config.h
simplifies its use globally.

Change-Id: Id724a9950b90504721233022c7fb5768e9bc5548
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/649
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-05-21 16:15:26 +00:00
Spencer Oliver 8cb0dae823 remote_bitbang: fix native windows build
Change-Id: Ied29ade0346c4595ffc1dafa788e2d5a595e0de3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/648
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-05-19 20:27:56 +00:00
Wim Lewis d40cb56d49 Add value "openbsd" for ocd_HOSTOS.
Change-Id: I9b0dd87d85c0792730f507176001d39c44da7117
Signed-off-by: Wim Lewis <wiml@hhhh.org>
Reviewed-on: http://openocd.zylin.com/547
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-03-31 04:02:24 +00:00
Øyvind Harboe 39650e2273 ecosboard: delete bit-rotted eCos code
Change-Id: Iff7943eb9da3f41dcc45492acd0f36cf63b3497f
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/503
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: jenkins
2012-03-13 19:11:11 +00:00
Øyvind Harboe ed12a6521f flash: retire unused eCos flash driver
even the AT91EB40a's flash is covered by CFI and nobody ever submitted
any other drivers based on eCos code. It's just possible that this
idea was missing documentation and "marketing", but it's in git if
somebody wants to resurrect it.

Change-Id: I66449aa6e0997301f9d67f28098789bfc891d6e9
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/502
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-03-11 21:14:21 +00:00
Spencer Oliver 7719e2188e doxygen: use correct comment syntax
This issue was caused by uncrustify not correctly converting the doxygen
comments.

Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Change-Id: Ie6dc3b057a08603b670cb27312e5f0d989426e6c
Reviewed-on: http://openocd.zylin.com/431
Tested-by: jenkins
2012-02-06 12:55:03 +00:00
Spencer Oliver 8b00e56e64 build: cleanup src/helper directory
Change-Id: I71a312df783995e9083c345c25e73902d5aef59e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/415
Tested-by: jenkins
2012-02-06 10:49:52 +00:00
Mathias K 16b6b5e7a8 Change return value on error.
On wrong parameters a error is signalized to the calling function.

Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960
Signed-off-by: Mathias K <kesmtp@freenet.de>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/282
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-04 17:56:46 +00:00
Øyvind Harboe 4668bd264c retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR
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>
2012-01-04 17:13:46 +00:00
Mathias K 54d6330b78 command: print BUG warning when usage is missing
These error messages will prompt patches to be submitted for missing
.usage or empty fields. All of the below must be resolved before next
release.

The Jim defined commands are excluded from this checklist because the
help text can be set later than during command registration.

strlen(.usage) == 0 means that the command expects no arguments.

Updates to this patch in Gerrit to fix problems below are most
welcome. Anyone can push updated versions of a patch to Gerrit. If
there are no further updates to this patch within a week, it will be
pushed to the master branch to prompt more fixes.

These were caught by launching OpenOCD.

Error: BUG: command 'command' does not have the '.usage' field filled out
Error: BUG: command 'script' does not have the '.usage' field filled out
Error: BUG: command 'power_restore' does not have the '.usage' field filled out
Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out
Error: BUG: command 'measure_clk' does not have the '.usage' field filled out
Error: BUG: command 'exit' does not have the '.usage' field filled out
Error: BUG: command 'shutdown' does not have the '.usage' field filled out
Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out
Error: BUG: command 'interface_list' does not have the '.usage' field filled out
Error: BUG: command 'target' does not have the '.usage' field filled out
Error: BUG: command 'target init' does not have the '.usage' field filled out
Error: BUG: command 'flash' does not have the '.usage' field filled out
Error: BUG: command 'flash init' does not have the '.usage' field filled out
Error: BUG: command 'flash banks' does not have the '.usage' field filled out
Error: BUG: command 'nand' does not have the '.usage' field filled out
Error: BUG: command 'nand drivers' does not have the '.usage' field filled out
Error: BUG: command 'nand init' does not have the '.usage' field filled out
Error: BUG: command 'pld' does not have the '.usage' field filled out
Error: BUG: command 'pld init' does not have the '.usage' field filled out
Error: BUG: command 'mflash' does not have the '.usage' field filled out
Error: BUG: command 'mflash init' does not have the '.usage' field filled out
Error: BUG: command 'dummy' does not have the '.usage' field filled out
Error: BUG: command 'dummy foo' does not have the '.usage' field filled out
Error: BUG: command 'scan_chain' does not have the '.usage' field filled out
Error: BUG: command 'jtag' does not have the '.usage' field filled out
Error: BUG: command 'jtag init' does not have the '.usage' field filled out
Error: BUG: command 'arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'etm' does not have the '.usage' field filled out
Error: BUG: command 'arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'target_request' does not have the '.usage' field filled out
^C
oyvind@fierce:~/openocd$ openocd -c "interface dummy" -f board/at91eb40a.cfg 2>&1 | grep -w BUG
Error: BUG: command 'command' does not have the '.usage' field filled out
Error: BUG: command 'script' does not have the '.usage' field filled out
Error: BUG: command 'power_restore' does not have the '.usage' field filled out
Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out
Error: BUG: command 'measure_clk' does not have the '.usage' field filled out
Error: BUG: command 'exit' does not have the '.usage' field filled out
Error: BUG: command 'shutdown' does not have the '.usage' field filled out
Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out
Error: BUG: command 'interface_list' does not have the '.usage' field filled out
Error: BUG: command 'target' does not have the '.usage' field filled out
Error: BUG: command 'target init' does not have the '.usage' field filled out
Error: BUG: command 'flash' does not have the '.usage' field filled out
Error: BUG: command 'flash init' does not have the '.usage' field filled out
Error: BUG: command 'flash banks' does not have the '.usage' field filled out
Error: BUG: command 'nand' does not have the '.usage' field filled out
Error: BUG: command 'nand drivers' does not have the '.usage' field filled out
Error: BUG: command 'nand init' does not have the '.usage' field filled out
Error: BUG: command 'pld' does not have the '.usage' field filled out
Error: BUG: command 'pld init' does not have the '.usage' field filled out
Error: BUG: command 'mflash' does not have the '.usage' field filled out
Error: BUG: command 'mflash init' does not have the '.usage' field filled out
Error: BUG: command 'dummy' does not have the '.usage' field filled out
Error: BUG: command 'dummy foo' does not have the '.usage' field filled out
Error: BUG: command 'scan_chain' does not have the '.usage' field filled out
Error: BUG: command 'jtag' does not have the '.usage' field filled out
Error: BUG: command 'jtag init' does not have the '.usage' field filled out
Error: BUG: command 'arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'etm' does not have the '.usage' field filled out
Error: BUG: command 'arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'target_request' does not have the '.usage' field filled out

Change-Id: I2c3e529530a15d2295a1950ffc59e8f2fc661012
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/299
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-04 17:13:03 +00:00
Spencer Oliver 4c11906241 helper: fix arm11 help text
This fixes a long standing bug: see Trac #4
Increased help text recursion limit and added LOG_DEBUG so we can
catch future errors like this.

Change-Id: I5fac95c4486eaddaf1e88a27ecb1835168f87711
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/291
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-03 09:30:14 +00:00
Spencer Oliver 7e2257663d build: fix mingw build issues
8901fca027 broke the build under mingw, this
fixes that.

Change-Id: I22b91e220dac3b68cc576b65a9f1b8711e64263a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/298
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-12-31 12:23:55 +00:00
Spencer Oliver 3dde0f47b2 binarybuffer: use strndup to allocate string
Change-Id: I65d8f37b18d5b5a798406b956f50ab7bb550e172
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/246
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-12-01 19:11:20 +00:00
Freddie Chopin ea10093422 Fix "Evaluate 'script' in the global scope"
This fixes commit Evaluate 'script' in the global scope. It caused
Windows builds behave differently than before because path was evaluated twice
and backslashes from Windows' paths got unescaped and effectively wiped out.
Configs could only be passed with "-f ../dir/config.cfg" or "-f
..\\dir\\config.cfg" instead of usual "-f dir/config.cfg" (or using backslash)
as previously.

Change-Id: I13b4abac6dbe6d770cc11a4e61c9421ef340da83
Author: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/40
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-24 17:40:52 +00:00
Spencer Oliver 7fe05ff330 jim: add missing jim license
Change-Id: Ib8e34739d92cd54655b9b47d07b856a82ff25f3c
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/39
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-21 09:29:44 +00:00
Steve Bennett ef885d3b2a jim-nvp is moving from jimtcl to openocd
The jim-nvp code is specific to openocd, so it belongs in openocd,
not in the core jimtcl.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-30 09:38:22 +02:00
Steve Bennett a62d8f2271 Evaluate 'script' in the global scope
Scripts sourced via 'script' should evaluate in the global
scope to make it easy to set and reference global variables.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-08-11 16:20:56 +02:00
Øyvind Harboe 5c739b148e ecos: add 64 bit types for sprintf/sscanf 2011-04-28 22:17:48 +02:00
Øyvind Harboe 68bd107c6d command: fix leak when executing commands
found via valgrind, not observed/reported.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-03-27 23:51:30 +02:00
Øyvind Harboe 95de667e24 log: debug level is between silent and debug output levels
It wasn't previously possible to silence the output.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-02-25 16:36:42 +01:00
Mathias K b21be6054a performance: committed wrong version of buf_set_buf optimization
oops...

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-02-08 11:06:56 +01:00
Mathias K 706284a8fd buf_set_buf around 30% speed increase
Also i have checked the input of this function and in many cases
a simple byte copy is possible.

I have added this check now and is it possible the buffer is
copied byte by byte and not bit by bit.

With byte boundary input the test looks like this:

buf_set_buf 0x02000000 iteration test:
runtime (seconds): old: 6.828559 new: 0.436191 diff: 6.392368
runtime (seconds): old: 6.853636 new: 0.430389 diff: 6.423247
runtime (seconds): old: 6.794985 new: 0.423065 diff: 6.371920

Without:

buf_set_buf 0x02000000 iteration test:
runtime (seconds): old: 6.370869 new: 5.552624 diff: 0.818245
runtime (seconds): old: 6.420730 new: 5.665887 diff: 0.754843
runtime (seconds): old: 6.583306 new: 5.599021 diff: 0.984285

Regards,

Mathias
2011-02-08 09:39:59 +01:00
Mathias K b0bdc4e2f2 24bit buffer support
Hello,

this patch add 24bit support to the target buffer functions and little/big endian functions.

Regards,

Mathias
2011-02-03 12:23:55 +01:00
Øyvind Harboe 859ccccd80 error: remove debug output when reporting errors
The user does not need to know or care about "command handlers".

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-01-31 12:09:46 +01:00
Eric Wetzel 0535531d27 nit: more LOG_* \n fixes
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
2011-01-09 21:35:23 +01:00
Eric Wetzel a665ef716a nit: do not add \n at end of LOG_ERROR
Fixed in many other places, and submitted in response to Øyvind's invitation.
2011-01-05 21:46:12 +01:00
Øyvind Harboe c69553cbc5 error handling: the error number is not part of the user interface
Do not propagate error number to user. This is for internal
programming purposes only. Error messages to the user is
reported as text via LOG_ERROR().

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-01-03 13:33:27 +01:00
Andrew MacIsaac 50e79d60ce Compilation Warnings on OS X 10.5
I received a number of "-Wshadow" related warnings (treated as errors) while
trying to build on OS X Leopard.  In addition, there were two miscellaneous
other warnings in the flash drivers.  Attached are two patches which correct
these issues and the commit messages to accompany them.

My system has the following configuration (taken from uname -a):

Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009;
root:xnu-1228.15.4~1/RELEASE_I386 i386

=== Werror_patch.txt Commit Message ===
compilation: fixes for -Wshadow warnings on OS X

These changes fix -Wshadow compilation warnings on OS X 10.5.8

Compiled with the following configure command:

../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink
--enable-ft2232_libftdi

=== flash_patch.txt Commit Message ===
compilation: fixes for flash driver warnings on OS X

These changes fix two compilation warnings on OS X 10.5.8:

../../../../src/flash/nor/at91sam3.c:2767: warning: redundant redeclaration
of 'at91sam3_flash'
../../../../src/flash/nor/at91sam3.c:101: warning: previous declaration of
'at91sam3_flash' was here

and

../../../../src/flash/nor/stmsmi.c:205: warning: format not a string literal
and no format arguments

Compiled with the following configure command:

../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink
--enable-ft2232_libftdi
===

Andrew
2010-12-29 22:16:28 +01:00
Øyvind Harboe 4f9a9b8eba warnings: use more 'const' for char *
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-29 22:07:39 +01:00
Øyvind Harboe c9544e411d script: support only Tcl comments
Only Tcl comments are now supported. For classic style
commands comments were supported at the end of the line.

Move in the direction of letting the script language
decide syntax, rather than have special rules for some
commands.

Before this patch goes in, the scripts should be updated
to use ;# instead of # for end of line comments.

> mdw 0 1 2
mdw ['phys'] address [count]
  zy1000.cpu mdw address [count]
Command handler execution failed
in procedure 'mdw'
> mdw 0 1 #2
mdw ['phys'] address [count]
  zy1000.cpu mdw address [count]
Command handler execution failed
in procedure 'mdw'
> mdw 0 1 ;#2
0x00000000: ffffffff
> mdw 0 1
0x00000000: ffffffff
> mdw 0
0x00000000: ffffffff

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-18 21:04:22 +01:00
Spencer Oliver 838cd58e24 build: add common.mk
Rather than specifying common makefile variables move
them all to a common.mk.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-11-18 14:05:56 +00:00
Antonio Borneo 4747af362d JIM: document "echo" command
Document "-n" option in manual;
Modify "echo" command definition as COMMAND_HANDLER to
easily add help message
Add help message aligned with manual.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-11-09 08:12:51 +01:00
Antonio Borneo d220e22e63 JIM: Add "-n" option to "echo"
With the new JIMTCL, "puts" only writes to stdout.
To write on telnet port too, "echo" must be used.
This patch gives to "echo" similar commandline option of "puts".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-11-09 08:12:51 +01:00
Øyvind Harboe 559d08c19e jim tests: use installed
Delete obsolete jim that comes with OpenOCD.
2010-10-29 15:10:51 +02:00
Øyvind Harboe 2ff1adfa79 help: help now works on configuration commands
help would not show help for commands when the command
interpreter was in the wrong mode, which means that
e.g. "help newtap" didn't work, it wouldn't show the
"jtag newtap" help as it was a configuration command.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-27 08:50:45 +02:00
Spencer Oliver ebe431879d gdbderver: fix gdb pipe startup overflow
When usng gdb pipes we need to keep openocd output at a minimum,
otherwise the gdb stdin will overflow and fail.
Make the calls to gdb_port and log_output synchronous to stop this.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-05 15:00:40 +01:00