summaryrefslogtreecommitdiff
path: root/src/target/target.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve handle_md_command argument handling:zwelch2009-06-131-3/+10
| | | | | | | - Use parse_u32 and parse_uint for address and count, respectively. git-svn-id: svn://svn.berlios.de/openocd/trunk@2230 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_u32 in handle_resume_command and handle_step_command.zwelch2009-06-131-2/+10
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2229 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Cleanup and improve handle_halt_command:zwelch2009-06-131-11/+8
| | | | | | | | - Make argument check use parse_uint to ensure value parses properly. - Move variable declarations to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2228 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Cleanup and fi handle_wait_halt_command:zwelch2009-06-131-8/+10
| | | | | | | | | | - Use unsigned type for delay variable. - Use parse_uint to ensure delay argument parses properly. - Bug fix: Return syntax error if more than one argument is given. - Bug fix: Return syntax error when argument fails to parse. git-svn-id: svn://svn.berlios.de/openocd/trunk@2227 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_uint in handle_reg_command to ensure reg number parses properly.zwelch2009-06-131-3/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2226 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_uint in get_target to ensure target id is parsed properly.zwelch2009-06-131-5/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2225 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix ordering of arguments to fwrite()oharboe2009-06-111-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2197 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Factor handle_bp_command into pieces:zwelch2009-06-111-37/+49
| | | | | | | | | | - Bug fix: return a syntax error if the wrong number of arguments are given. - Add handle_bp_command_list() and handle_bp_command_set(). - Use temporary addr variable to eliminate redundant strtoul() calls. - Place variable declarations at their point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2196 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Factor target_timer_callbacks_check_time into pieces:zwelch2009-06-111-30/+40
| | | | | | | | | - Add target_timer_callback_periodic_restart and target_call_timer_callback. - Clean up and simplify logic that determines whether to call each callback. - Move variable declarations to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2195 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and clean handle_virt2phys_command:zwelch2009-06-111-18/+15
| | | | | | | | - Add a doxygen block to simplify logic. - Move declarations to point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix target handle_rwp_command routine:zwelch2009-06-111-3/+4
| | | | | | | | - Return syntax error unless exactly one argument is passed. - Move variable declaration to point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2193 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix handle_reset_command:zwelch2009-06-111-3/+5
| | | | | | | | - Return syntax error if more than one argument is given. - Move variables to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2192 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify handle_resume_command:zwelch2009-06-111-12/+11
| | | | | | | | | - Eliminate redundant calls to target_resume with addr temp variable. - Place variables at location of first use. - Fix minor whitespace issues. git-svn-id: svn://svn.berlios.de/openocd/trunk@2191 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix handle_step_command:zwelch2009-06-111-6/+9
| | | | | | | | | - Bug fix: return syntax error when more than one argument is given. - Eliminate redundant calls to step callback with addr temp variable. - Place variables at location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* disable polling continuous polling during resetoharboe2009-06-111-0/+9
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2183 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Move the documentation for the "poll" command up withzwelch2009-06-101-2/+4
| | | | | | | | | | | | | | other server configuration. Explain what it's about; reference the related "$target_name curstate" method. Update "poll" output to report whether background polling is enabled or not. Also fix a small typo; PC's have "complementary" tools. Some have also "complimentary" ones; but not all. git-svn-id: svn://svn.berlios.de/openocd/trunk@2178 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net> Bugfix: $target_name cget/configure ↵oharboe2009-06-081-1/+1
| | | | | | | | -work-area-backup commands should return the "is it backed up?" flag, not the work area size. git-svn-id: svn://svn.berlios.de/openocd/trunk@2108 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>oharboe2009-06-081-7/+26
| | | | | | | | | | | | | | | | - Don't let disabled TAPs be set as the current target - Improve "targets" output: * Remove undesirable "chain position" number; we discourage using them * TAP and Target column updates: + make them long enough for current usage + improve labels, removing guesswork + "TapName" label patches scan_chain output * Highlight the "current" target * Display "tap disabled" as a new pseudo-state * Update docs accordingly git-svn-id: svn://svn.berlios.de/openocd/trunk@2107 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-071-3/+19
| | | | | | | | | | | | | | | Let disabled targets be ignored during normal operation: - In target_examine(), ignore disabled TAPs - Reset handling must not poke at them either: * fail $target_name arp_* operations on disabled TAPs * in startup.tcl, don't even issue the arp_* wait ops ZW: removed superfluous braces from the patch to target.c. git-svn-id: svn://svn.berlios.de/openocd/trunk@2100 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fix regression in mdw output; identified by Magnus Lundin.zwelch2009-06-071-3/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2098 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unused include file: inttypes.hoharboe2009-06-051-2/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2071 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Eliminate MixedCaps symbol from public JTAG TAP API:zwelch2009-06-051-1/+1
| | | | | | | | - Purely mechanical transformations to the source files. - Rename 'jtag_TapByJimObj' as 'jtag_tap_by_jim_obj.' git-svn-id: svn://svn.berlios.de/openocd/trunk@2066 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix warning for a variable that GCC thought might be uninitialized(which it ↵oharboe2009-06-011-1/+1
| | | | | | can't be). git-svn-id: svn://svn.berlios.de/openocd/trunk@1979 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Final step in isolating target_type_s structure:zwelch2009-05-311-2/+1
| | | | | | | | | - Move definition of 'struct target_type_s' into new 'target_type.h' file. - Forward delclaration remains in target.h, with comment pointing to new file. - Replaces #define with #include in source files. git-svn-id: svn://svn.berlios.de/openocd/trunk@1971 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* First step in hiding target_type_s from public interface:zwelch2009-05-311-0/+2
| | | | | | | | - Add DEFINE_TARGET_TYPE_S symbol in files that need it defined. - Forward declare 'struct target_type_s' only, unless that symbol is defined. git-svn-id: svn://svn.berlios.de/openocd/trunk@1969 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_examine_one wrapper:zwelch2009-05-311-1/+6
| | | | | | | - replaces all calls to target->type->examine. git-svn-id: svn://svn.berlios.de/openocd/trunk@1968 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target breakpoint and watchpoint wrapper:zwelch2009-05-311-0/+21
| | | | | | | - replaces all calls to target->type->{add,remove}_{break,watch}point. git-svn-id: svn://svn.berlios.de/openocd/trunk@1967 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_get_name wrapper:zwelch2009-05-311-4/+8
| | | | | | | | - replaces all accesses to target->type->name. - add documentation in target_s to warn not to access field directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1966 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_step wrapper:zwelch2009-05-311-0/+6
| | | | | | | - replaces all calls to target->type->step. git-svn-id: svn://svn.berlios.de/openocd/trunk@1965 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_get_gdb_reg_list wrapper:zwelch2009-05-311-0/+6
| | | | | | | | - replaces all calls to target->type->get_gdb_reg_list. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1964 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_bulk_write_memory wrapper:zwelch2009-05-311-0/+6
| | | | | | | | - replaces all calls to target->type->bulk_write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1963 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add wrappers for target->type->examined:zwelch2009-05-311-20/+36
| | | | | | | | | | - replace all checks of target->type->examined with target_was_examined(). - replace all setting of target->type->examined with target_set_examined(). - replace clearing of target->type->examined with target_reset_examined(). - add documentation in target_s to warn not to access field directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1962 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_run_algorithm wrapper:zwelch2009-05-311-0/+11
| | | | | | | | - replaces all calls to target->type->run_algorithm. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_write_memory wrapper:zwelch2009-05-311-11/+18
| | | | | | | | - replaces all calls to target->type->write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1960 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_read_memory wrapper:zwelch2009-05-311-12/+18
| | | | | | | | - replaces all calls to target->type->read_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1959 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify the handle_md_command routine in target.c:zwelch2009-05-311-58/+61
| | | | | | | | | | | - fix buffer overrun in mdw; final '\0' would overflow the output buffer. - return ERROR_COMMAND_SYNTAX_ERROR instead of ERROR_OK if: - less than one argument is provided - the command is called with a name other than mdb, mdh, or mdw. - factor all command output into new handle_md_output function git-svn-id: svn://svn.berlios.de/openocd/trunk@1958 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Make nvp_target_event static; remove its external declaration.zwelch2009-05-311-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1957 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Make target_buffer_get_uXX interfaces work with constant buffers.zwelch2009-05-311-3/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1956 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Eliminate duplicated code in the handle_mw_command memory write loop.zwelch2009-05-301-20/+4
| | | | | | | | - wordsize will always be 1, 2, or 4 due to preceeding switch statement. - move call to keep_alive after successful writes, not upon failures git-svn-id: svn://svn.berlios.de/openocd/trunk@1953 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>: This patch adds annotations tozwelch2009-05-211-3/+5
| | | | | | | | | | the key command_*() helper functions, fixng the bugs that turned up. Several of these bugs were from misuse of PRIi64; that's for 64-bit integers, NOT for "long long" or "u64" (which work best with %lld). git-svn-id: svn://svn.berlios.de/openocd/trunk@1873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Øyvind Harboe <oyvind.harboe@zylin.com>kc8apf2009-05-211-0/+8
| | | | | | | - Allow target_read/write_buffer of size 0 git-svn-id: svn://svn.berlios.de/openocd/trunk@1870 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Consolidate target selection code into single get_target() that handles both ↵kc8apf2009-05-181-23/+32
| | | | | | names and numbers. Provided by David Brownell <david-b@pacbell.net> git-svn-id: svn://svn.berlios.de/openocd/trunk@1804 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix array2mem/mem2array when used as a "method" on a target.oharboe2009-05-171-14/+14
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1801 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* take #2: dump_image now works for addresses not divisible by 4 oharboe2009-05-141-6/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1786 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* dump_image now works for addresses not divisible by 4oharboe2009-05-141-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1785 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* propagate error in dump_image. If an error occurs during dump_image, a tcl ↵oharboe2009-05-141-2/+2
| | | | | | exception is thrown. git-svn-id: svn://svn.berlios.de/openocd/trunk@1782 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Audit and eliminate redundant #include directives in core target files.zwelch2009-05-111-18/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1713 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove redundant sys/types.h #include directives (now in types.h).zwelch2009-05-111-1/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Dirk Behme <dirk.behme@googlemail.com> Add minimalist Cortex A8 fileoharboe2009-05-041-0/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1602 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add static keywords to core target source file data and functions.zwelch2009-04-301-50/+48
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1579 b42882b7-edfa-0310-969c-e2dbd0fdcd60