1. 07 Apr, 2019 1 commit
  2. 06 Mar, 2019 1 commit
  3. 27 Jan, 2019 2 commits
  4. 16 Jan, 2019 1 commit
    • Antonio Borneo's avatar
      helper/command: check for malloc failure in __command_name · c4a7a622
      Antonio Borneo authored
      
      
      If malloc fails in __command_name, the following strcpy will
      segfault, thus preventing __command_name to return.
      The actual calls to command_name() implement the correct check
      for the NULL pointer, but propagate error -ENOMEM, that is not
      an error value coherent within OpenOCD. Plus, in one case it
      overwrites an already detected error.
      
      Check the pointer returned by malloc and, in case of failure,
      issue an error message and return the NULL pointer.
      Let the caller of command_name() to keep the already detected
      error or to return ERROR_FAIL in case of end of memory.
      
      Change-Id: I151a24569409777dd5bc09a3daf5dba2b8e2829b
      Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
      Reviewed-on: http://openocd.zylin.com/4838
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarTomas Vanek <vanekt@fbl.cz>
      c4a7a622
  5. 25 Dec, 2018 1 commit
  6. 03 Mar, 2018 1 commit
    • Tomas Vanek's avatar
      target: use correct target in target-prefixed commands and event handlers · bb9d9c60
      Tomas Vanek authored
      
      
      This change contains an alternative to Matthias Welwarsky's #4130
      (target-prefixed commands) and to #4293 (event handlers).
      
      get_current_target() must retrieve the target associated to the current
      command. If no target associated, the current target of the command
      context is used as a fallback.
      
      Many Tcl event handlers work with the current target as if it were
      the target issuing the event.
      
      current_target in command_context is a number and has to be converted
      to a pointer in every get_current_target() call.
      
      The solution:
      - Replace current_target in command_context by a target pointer
      - Add another target pointer current_target_override
      - get_current_target() returns current_target_override if set, otherwise
      	current_target
      - Save, set and restore current_target_override to the current prefix
      	in run_command()
      - Save, set and restore current_target_override to the event invoking
      	target in target_handle_event()
      
      While on it use calloc when allocating a new command_context.
      
      Change-Id: I9a82102e94dcac063743834a1d28da861b2e74ea
      Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
      Suggested-by: default avatarMatthias Welwarsky <matthias.welwarsky@sysgo.com>
      Reviewed-on: http://openocd.zylin.com/4295
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
      bb9d9c60
  7. 17 Jan, 2018 1 commit
  8. 23 Oct, 2017 1 commit
  9. 10 Feb, 2017 1 commit
    • Dongxue Zhang's avatar
      target: Add 64-bit target address support · 47b8cf84
      Dongxue Zhang authored
      
      
      Define a target_addr_t type to support 32-bit and 64-bit addresses at
      the same time. Also define matching TARGET_PRI*ADDR format macros as
      well as a convenient TARGET_ADDR_FMT.
      
      In targets that are 32-bit (avr32, nds32, arm7/9/11, fm4, xmc1000)
      be least invasive by leaving the formatting unchanged apart from the
      type;
      for generic code adopt TARGET_ADDR_FMT as unified address format.
      
      Don't silently change gdb formatting here, leave that to later.
      
      Add COMMAND_PARSE_ADDRESS() macro to abstract the address type.
      Implement it using its own parse_target_addr() function, in the hopes
      of catching pointer type mismatches better.
      
      Add '--disable-target64' configure option to revert to previous 32-bit
      target address behavior.
      
      Change-Id: I2e91d205862ceb14f94b3e72a7e99ee0373a85d5
      Signed-off-by: default avatarDongxue Zhang <elta.era@gmail.com>
      Signed-off-by: default avatarDavid Ung <david.ung.42@gmail.com>
      [AF: Default to enabling (Paul Fertser), rename macros, simplify]
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarMatthias Welwarsky <matthias.welwarsky@sysgo.com>
      47b8cf84
  10. 19 Jul, 2016 1 commit
  11. 24 May, 2016 1 commit
  12. 14 Apr, 2015 2 commits
  13. 22 Sep, 2014 1 commit
    • Andreas Fritiofson's avatar
      command: Fix confusing syntax error message · c0b8e605
      Andreas Fritiofson authored
      
      
      If the user executes a command with an invalid subcommand, the error
      message is extremely unhelpful:
      
      > flash write test.elf
      flash write test.elf: command requires more arguments
      
      This is because any command line that starts with a valid command group is
      classified as a group, triggering ocd_bouncer to print the confusing
      message.
      
      Fix by requiring that to be a command group, the command line must not
      contain any unknown tokens after the last valid (sub-)command group. That
      is OK because command groups don't have handlers defined and thus can't
      take any parameters.
      
      Also fix the error message for "unknown" type to be similar to the error
      message that is printed (by Jim) for non-existent primary commands.
      
      Change-Id: I26950349f0909fd3961c4f9ab9b198c221cea9fc
      Signed-off-by: default avatarAndreas Fritiofson <andreas.fritiofson@gmail.com>
      Reviewed-on: http://openocd.zylin.com/2285
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      c0b8e605
  14. 09 May, 2014 1 commit
  15. 09 Jan, 2014 1 commit
  16. 31 Oct, 2013 2 commits
  17. 08 Sep, 2013 1 commit
  18. 01 Jul, 2013 1 commit
  19. 05 Jun, 2013 1 commit
  20. 30 Nov, 2012 1 commit
  21. 24 Aug, 2012 1 commit
  22. 22 Jul, 2012 1 commit
  23. 11 Jul, 2012 1 commit
  24. 31 Mar, 2012 1 commit
  25. 13 Mar, 2012 1 commit
  26. 06 Feb, 2012 2 commits
  27. 04 Jan, 2012 2 commits
    • Øyvind Harboe's avatar
      retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR · 4668bd26
      Øyvind Harboe authored
      
      
      Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      Reviewed-on: http://openocd.zylin.com/300
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarØyvind Harboe <oyvindharboe@gmail.com>
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      4668bd26
    • Mathias K's avatar
      command: print BUG warning when usage is missing · 54d6330b
      Mathias K authored
      
      
      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: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      Signed-off-by: default avatarMathias K <kesmtp@freenet.de>
      Reviewed-on: http://openocd.zylin.com/299
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarØyvind Harboe <oyvindharboe@gmail.com>
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      54d6330b
  28. 03 Jan, 2012 1 commit
  29. 27 Mar, 2011 1 commit
  30. 09 Jan, 2011 1 commit
    • Eric Wetzel's avatar
      nit: more LOG_* \n fixes · 0535531d
      Eric Wetzel authored
      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
      0535531d
  31. 29 Dec, 2010 1 commit
  32. 18 Dec, 2010 1 commit
    • Øyvind Harboe's avatar
      script: support only Tcl comments · c9544e41
      Øyvind Harboe authored
      
      
      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: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      c9544e41
  33. 09 Nov, 2010 2 commits
  34. 29 Oct, 2010 1 commit