Commit Graph

293 Commits

Author SHA1 Message Date
oharboe
381f9a2e8a .cfg files are now executed as Jim Tcl. Commands that terminate script w/error message.
git-svn-id: svn://svn.berlios.de/openocd/trunk@790 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-11 09:06:36 +00:00
oharboe
66410d2537 "flash banks" is now implemented in Tcl on top of "flash_banks". openocd_throw prefix is no longer required when executing OpenOCD commands from tcl.
git-svn-id: svn://svn.berlios.de/openocd/trunk@779 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-09 15:22:05 +00:00
ntfreak
994396da59 - command_run_line will only search once for the command, and execute if found
git-svn-id: svn://svn.berlios.de/openocd/trunk@766 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-07 12:19:17 +00:00
ntfreak
97c4be68a0 - fix duplicate log entry
git-svn-id: svn://svn.berlios.de/openocd/trunk@762 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 23:49:05 +00:00
ntfreak
655e4f88a6 - fixed build issues with win32
- fixed build warnings for last commit
- set svn props for last commit

git-svn-id: svn://svn.berlios.de/openocd/trunk@760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 23:22:17 +00:00
oharboe
0bb7c9d109 fix a few compilation problems.
git-svn-id: svn://svn.berlios.de/openocd/trunk@758 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 19:56:15 +00:00
oharboe
dc796a2091 src/helper/configuration.h
- Log output handlers now get a "const char *line"
	- Added "const" to parameter.

src/helper/command.c
src/helper/command.h
	- New function:  'command_output_text()'
	- Log output handlers now get a "const char *line"
 
src/helper/options.c
	- Log output handlers now get a "const char *line"

src/server/telnet_server.c
	- DO not transmit NULL bytes via TELNET.
	- Log output handlers now get a "const char *line"
	
src/server/gdb_server.c
	- Log output handlers now get a "const char *line"
	
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try

src/target/target.c
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try
	
src/target/target.h
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try

src/openocd.c
    - **MAJOR** Work: New TCL/Jim function: mem2array
	- **MAJOR** Work: Redirect Tcl/Jim stdio output to remote users.
	- Previously: TCL output did not go to GDB.
	- Previously: TCL output did not go to TELNET
	- Previously: TCL output only goes to control console.
	- This fixes that problem.
	+ Created callbacks:
		+openocd_jim_fwrite()	
		+openocd_jim_fread()
		+openocd_jim_vfprintf()
		+openocd_jim_fflush()
		+openocd_jim_fgets()

src/Makefile.am
	- New TCL files.
	- Future note: This should be more automated.  As the list of
	  'tcl' files grows maintaning this list will suck.

src/Jim.c
	- ** THIS INCLUDES A PREVIOUS PATCH I SENT EARLIER **
	- that impliments many [format] specifies JIM did not support.
	- Jim_FormatString() - **MAJOR** work.
	- Previously only supported "%s" "%d" and "%c"
	- And what support existed had bugs.
	- NEW: *MANY* formating parameters are now supported.
	- TODO: The "precision" specifier is not supported.

	** NEW ** This patch.
	
	- Jim_StringToWide() test if no conversion occured.
	- Jim_StringToIndex() test if no conversion occured.
	- Jim_StringToDouble() test if no conversion occured.

	** NEW ** This Patch. Major Work.
	- Previously output from JIM did not get sent to GDB
	- Ditto: Output to Telnet session.
	- Above items are now fixed - By introducing callbacks
	  new function pointers in the "interp" structure.

	- Helpers that call the callbacks.
	
	- New function: Jim_fprintf()
	- New function: Jim_vfprintf()
	- New function: Jim_fwrite()
	- New function: Jim_fread()
	- New function: Jim_fflush()
	- New function: Jim_fgets()

	By default: the output is to STDIO as previous.
	The "openocd.c" - redirects the output as needed.
	
	- Jim_Panic() - Send panic to both STDERR and the interps
	specified STDERR output as a 2nd choice.

	- Now JIM's "stdin/stdout/stderr" paramters are "void *"
	and are no longer "FILE *".

src/Jim.h
	- **MAJOR**
	-  New JIM STDIO callbacks in the "interp" structure.
	-  change: "stdin/stdout/stderr" are now "void *" cookies.
	-  New JIM stdio helper functions.



git-svn-id: svn://svn.berlios.de/openocd/trunk@755 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 19:17:43 +00:00
ntfreak
71460ba9a5 - added search for libdl
- Thanks Charles Hardin

git-svn-id: svn://svn.berlios.de/openocd/trunk@754 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-05 09:57:19 +00:00
oharboe
269c6d8385 utility fn.
git-svn-id: svn://svn.berlios.de/openocd/trunk@742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-04 07:21:31 +00:00
oharboe
b754eac35a hooks to enable experimentation with scripting language support. Reduces patch size, but has no effect on OpenOCD otherwise.
git-svn-id: svn://svn.berlios.de/openocd/trunk@733 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-27 06:58:45 +00:00
oharboe
d52d7f69be GDB timeout fix. If a script takes a long time and does not produce any output, ping between every command.
git-svn-id: svn://svn.berlios.de/openocd/trunk@710 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-16 18:40:31 +00:00
ntfreak
3642616171 - remove error message on shutdown
git-svn-id: svn://svn.berlios.de/openocd/trunk@672 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-21 19:23:35 +00:00
oharboe
a197e759ff Edgar Grimberg plugged a leak found w/Valgrind.
git-svn-id: svn://svn.berlios.de/openocd/trunk@646 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-07 12:15:19 +00:00
oharboe
6510be8b8b added fast option.
git-svn-id: svn://svn.berlios.de/openocd/trunk@604 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-23 05:42:42 +00:00
oharboe
2b16509675 stop using variable sized arrays. That's something that belongs to C++ and not C.
git-svn-id: svn://svn.berlios.de/openocd/trunk@560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-10 19:44:56 +00:00
oharboe
2585fc3420 Don Porges fixed c99 issues.
git-svn-id: svn://svn.berlios.de/openocd/trunk@553 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-09 05:55:23 +00:00
oharboe
35b3c95299 - reverted some of the changes that possibly broke arm926ejs. Waiting
for a bit more info before I can tell with confidence whether or not
this would have any effect.
- worked on error propagation and output for flash

git-svn-id: svn://svn.berlios.de/openocd/trunk@539 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-04 13:47:38 +00:00
ntfreak
d47e1b8f36 - rename log functions to stop conflicts under win32 (wingdi)
git-svn-id: svn://svn.berlios.de/openocd/trunk@523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-25 15:45:17 +00:00
oharboe
d9ac6b1d09 alloc_printf and alloc_vprintf
git-svn-id: svn://svn.berlios.de/openocd/trunk@465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-07 10:55:59 +00:00
oharboe
6d95014674 * fixed malloc corruption in target->debug_reason
* GDB remote server will now remain online even if the target
	  is in a funny state, e.g. if it requires a reset, it is
	  running while GDB is not in the continue or step packet,
	  e.g. via monitor resume/halt commands in GDB script.
	* Added some _DEBUG_GDB_IO_ debug tools
	* Fixed a couple of GDB server lockups, e.g. when O packets
	  detect a severed connection
	* added ACK upon connection (send +).
	* added keep-alive messages to reset so GDB protocol remains happy.
	* fixed crash when timing out connection to GDB

git-svn-id: svn://svn.berlios.de/openocd/trunk@445 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-05 10:28:32 +00:00
oharboe
67e0aea258 Summary: passing of variable argument list reduced, strings sent to logging 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-29 11:16:38 +00:00
oharboe
881dddd84f Michael Bruck:
- fix indentation of multi-level commands
- make help command work with multi-level commands

git-svn-id: svn://svn.berlios.de/openocd/trunk@384 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 07:01:43 +00:00
oharboe
0689e3dd67 - Added TARGET_REQ_DEBUGCHAR target_request debugmsg. This
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-28 08:11:18 +00:00
drath
3d6bcf0792 - convert all files to unix line-ending
git-svn-id: svn://svn.berlios.de/openocd/trunk@347 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 17:48:04 +00:00
oharboe
7f1944a478 Pavel Chromy
- 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-25 17:32:53 +00:00
oharboe
b9bdac0251 - added time command
- changed syntax of time measurements to seconds, e.g. 1.2324s

git-svn-id: svn://svn.berlios.de/openocd/trunk@321 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-23 08:24:59 +00:00
ntfreak
5c0e8efa05 - Fixed bug in pathmove for XScale
- added virtual address to working_area.
- Improved error messages in a number of places
- Added ERROR_COMMAND_SYNTAX_ERROR that commands can return to have syntax printed
- Added help for some config commands
- Added verification of sw breakpoints with ERROR() message
- Removed a couple of exit()'s and replaced with error message
- cosmetic fix to armv4_5.c, easier to read
- added polymorphic(with default) virt2phys and mmu enable query function to target.h
- added virt2phys command that uses target->type->virt2phys() fn
Thanks to Øyvind Harboe

git-svn-id: svn://svn.berlios.de/openocd/trunk@310 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-19 19:26:17 +00:00
ntfreak
f2a5a1ce81 - arg list now correctly released on error. Thanks Øyvind Harboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@306 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-18 16:54:18 +00:00
ntfreak
e7084a0c87 - fix broken JTAG error handling
- Allow all commands to be executed during config stage
- Help now works for config commands
- make var args handling follow the rules more closely
Thanks Øyvind Harboe

git-svn-id: svn://svn.berlios.de/openocd/trunk@305 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-18 15:41:38 +00:00
mifi
2a0317e6f4 - added patch to Improving progress/error output for telnet & GDB monitor
(thanks to Øyvind for the patch)

git-svn-id: svn://svn.berlios.de/openocd/trunk@293 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-13 19:02:17 +00:00
ntfreak
5eedf3e1ce - added faster gdb packet handling (thanks to oyvind harboe for the patch)
- code reformat

git-svn-id: svn://svn.berlios.de/openocd/trunk@251 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-10 19:29:52 +00:00
mifi
64aac5f7e1 - added patch for faster start of OpenOCD
(thanks to oyvind harboe for the patch)

git-svn-id: svn://svn.berlios.de/openocd/trunk@250 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-10 19:10:55 +00:00
ntfreak
6c9b804d61 - minimum autoconf 2.59 is now required and verified - due to issues with AS_HELP_STRING
- native win32 now handles WSAECONNRESET - no longer exits openocd
- qCRC packet now works correctly under cygwin (gdb compare-sections command)
- removed __USE_GNU define from gdbserver.c
- gdb qSupported packet is now handled, with this we are able to tell gdb packet size, memory map of target
- added new target script gdb_program_config - called before gdb flash programming
- new gdb server command gdb_memory_map (enable|disable> - default is disable
- new gdb server command gdb_flash_program (enable|disable> - default is disable
- gdb flash programming supported - vFlash packets
- image_elf_read_section now does not clear any remaining data, this was causing the gdb checksum to fail with certain files
- reformat of usbprog.c
- memory leak in command_print fixed
- updated texi doc to include new commands
- added gdb programming section to docs

git-svn-id: svn://svn.berlios.de/openocd/trunk@246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-29 13:51:48 +00:00
mifi
02f3765351 - added patch for new flash functionality like:
flash verify_image and flash erase_address.
- added patch for new parport_write_on_exit command.
Even this patch will fix some memory leaks.

(thanks too oyvind and Spen for these patches)

git-svn-id: svn://svn.berlios.de/openocd/trunk@240 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-18 21:20:28 +00:00
mifi
9c999216b1 - Fixing two compiler warnings
- Reducing  stack usage for recursive scripts
- Do not exit on bogus arguments to reset_config. No longer exit the application upon bogus arguments to reset_config, but return errors.

thanks to Øyvind Harboe for these patches.

git-svn-id: svn://svn.berlios.de/openocd/trunk@226 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-10 19:46:04 +00:00
drath
22bc5194ae - added support for error handlers to JTAG scan commands (jtag_[plain_][ir|dr]_scan)
- catch apparently broken JTAG IR scan after ARM926EJ-S CP15 operations
- added "arm7_9 dump_etb" command


git-svn-id: svn://svn.berlios.de/openocd/trunk@142 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-04-25 20:15:59 +00:00
drath
5ed126c4f9 - fixed arm926 cp15 command bug (thanks to Vincent Palatin for this patch)
- fixed compiler warnings throughout the code (thanks to Vincent Palatin for this patch)
- added support for accessing ETB (embedded trace buffer) registers


git-svn-id: svn://svn.berlios.de/openocd/trunk@134 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-03-26 21:47:26 +00:00
drath
4fc97d3f27 - fix incorrect parsing of whitespace in command.c (thanks to Magnus Lundin)
- fix infinite recursion in target_init_handler (thanks to jw and Magnus Lundin)
- fix CFI flash handlign with buswidth < 32bit (thanks to Daniele Orio for reporting this)
- add support for reading JTAG device id (currently only as debug output on startup)
- cleaned up handling of EmbeddedICE registers. Supported functionality and register size now determined by EmbeddedICE version number.
- small cleanups/fixes


git-svn-id: svn://svn.berlios.de/openocd/trunk@124 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-01-22 14:47:00 +00:00
drath
83440065c0 - correctly enter debug state on a "soft_reset_halt" command
- several small fixes
- retry reading from a FT2232 device on incomplete reads


git-svn-id: svn://svn.berlios.de/openocd/trunk@110 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-11-05 17:38:35 +00:00
drath
82d2633b5f - Added support for native MinGW builds (thanks to Spencer Oliver and Michael Fischer) - you still need to install GiveIO (not part of OpenOCD)
- Added state-move support to ftd2xx and bitbang JTAG drivers (required for XScale, possibly useful for other targets, too)
- various fixes


git-svn-id: svn://svn.berlios.de/openocd/trunk@78 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-07-17 14:13:27 +00:00
drath
b9628accd6 - the 'help' command now takes an optional argument to display help only on a certain command (thanks to Andrew Dyer for this enhancement)
- OpenOCD now includes the ability to diassemble instructions on its own (only ARM for now, Thumb might follow). 
The command is "armv4_5 disassemble <address> <count> ['thumb']" (thumb is currently unsupported).
I've compared the produced disassembly against GDB/GNU Objdump output, and it seems to be correct, but there may still be some bugs left.


git-svn-id: svn://svn.berlios.de/openocd/trunk@68 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-06-12 16:49:49 +00:00
drath
335f667d44 - fixed some spelling errors (thanks to Andrew Dyer)
git-svn-id: svn://svn.berlios.de/openocd/trunk@67 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-06-05 14:36:39 +00:00
drath
8b4e882a16 - prepare OpenOCD for branching, created ./trunk/
git-svn-id: svn://svn.berlios.de/openocd/trunk@64 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-06-02 10:36:31 +00:00