]> git.sur5r.net Git - openocd/blobdiff - src/target/target.h
marked infinite loop in code w/TODO and fixed warning.
[openocd] / src / target / target.h
index dae5f19e717ae7084787e764f14107239c6b7d3c..e028665043909984b886197ca093693b8d0b80b3 100644 (file)
@@ -116,7 +116,7 @@ typedef struct target_type_s
        /* target request support */
        int (*target_request_data)(struct target_s *target, u32 size, u8 *buffer);
 
-       /* target execution control */
+       /* halt will log a warning, but return ERROR_OK if the target is already halted. */
        int (*halt)(struct target_s *target);
        int (*resume)(struct target_s *target, int current, u32 address, int handle_breakpoints, int debug_execution);
        int (*step)(struct target_s *target, int current, u32 address, int handle_breakpoints);
@@ -127,7 +127,15 @@ typedef struct target_type_s
        int (*soft_reset_halt)(struct target_s *target);
        int (*prepare_reset_halt)(struct target_s *target);
        
-       /* target register access for gdb */
+       /* target register access for gdb.
+        * 
+        * Danger! this function will succeed even if the target is running
+        * and return a register list with dummy values.
+        * 
+        * The reason is that GDB connection will fail without a valid register
+        * list, however it is after GDB is connected that monitor commands can
+        * be run to properly initialize the target
+        */
        int (*get_gdb_reg_list)(struct target_s *target, struct reg_s **reg_list[], int *reg_list_size);
        
        /* target memory access 
@@ -270,7 +278,6 @@ int target_arch_state(struct target_s *target);
 #define ERROR_TARGET_INVALID   (-300)
 #define ERROR_TARGET_INIT_FAILED (-301)
 #define ERROR_TARGET_TIMEOUT   (-302)
-#define ERROR_TARGET_ALREADY_HALTED (-303)
 #define ERROR_TARGET_NOT_HALTED (-304)
 #define ERROR_TARGET_FAILURE   (-305)
 #define ERROR_TARGET_UNALIGNED_ACCESS  (-306)