fix noise in gdb console when single stepping. Remove printing of log before processi...
[openocd.git] / src / target / target.h
index 968d7ab8afaeffd21c6a9eeb9b92ddac206960f0..5b160d1265b5ce7a8afe344d5cac2b60ce9539ee 100644 (file)
@@ -2,9 +2,12 @@
  *   Copyright (C) 2005 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
- *   Copyright (C) 2007,2008 Øyvind Harboe                                      *
+ *   Copyright (C) 2007,2008 Øyvind Harboe                                 *
  *   oyvind.harboe@zylin.com                                               *
  *                                                                         *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -199,10 +202,11 @@ typedef struct target_type_s
        /* target algorithm support */
        int (*run_algorithm_imp)(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
        int (*run_algorithm)(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
-       
-       int (*register_commands)(struct command_context_s *cmd_ctx);
+
+       int (*register_commands)(struct command_context_s *cmd_ctx);    
+
        /* called when target is created */
-       int (*target_jim_create)( struct target_s *target, Jim_Interp *interp );
+       int (*target_create)( struct target_s *target, Jim_Interp *interp );
 
        /* called for various config parameters */
        /* returns JIM_CONTINUE - if option not understood */
@@ -213,8 +217,6 @@ typedef struct target_type_s
        /* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
        int (*target_jim_commands)( struct target_s *target, Jim_GetOptInfo *goi );
 
-       /* old init function */
-       int (*target_command)(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
        /* invoked after JTAG chain has been examined & validated. During
         * this stage the target is examined and any additional setup is
         * performed.
@@ -245,7 +247,6 @@ typedef struct target_s
        int target_number;                  /* generaly, target index but may not be in order */
        int chain_position;                 /* where on the jtag chain is this */
        const char *variant;                /* what varient of this chip is it? */
-       enum target_reset_mode reset_mode;  /* how should this target be reset */
        target_event_action_t *event_action;
 
        int reset_halt;                                         /* attempt resetting the CPU into the halted mode? */
@@ -271,19 +272,44 @@ typedef struct target_s
 
 enum target_event
 {
+       // OLD historical names
+       //  - Prior to the great TCL change
+       //  - June/July/Aug 2008
+       //  - Duane Ellis
+       TARGET_EVENT_OLD_gdb_program_config,
+       TARGET_EVENT_OLD_pre_reset,
+       TARGET_EVENT_OLD_post_reset,
+       TARGET_EVENT_OLD_pre_resume,
+
+       /* allow GDB to do stuff before others handle the halted event,
+       this is in lieu of defining ordering of invocation of events,
+       which would be more complicated */
+       TARGET_EVENT_EARLY_HALTED,
        TARGET_EVENT_HALTED,            /* target entered debug state from normal execution or reset */
        TARGET_EVENT_RESUMED,           /* target resumed to normal execution */
        TARGET_EVENT_RESUME_START,
        TARGET_EVENT_RESUME_END,
 
        TARGET_EVENT_RESET_START,
-       TARGET_EVENT_RESET,                     /* target entered reset */
+       TARGET_EVENT_RESET_ASSERT_PRE,
+       TARGET_EVENT_RESET_ASSERT_POST,
+       TARGET_EVENT_RESET_DEASSERT_PRE,
+       TARGET_EVENT_RESET_DEASSERT_POST,
+       TARGET_EVENT_RESET_HALT_PRE,
+       TARGET_EVENT_RESET_HALT_POST,
+       TARGET_EVENT_RESET_WAIT_PRE,
+       TARGET_EVENT_RESET_WAIT_POST,
        TARGET_EVENT_RESET_INIT,
        TARGET_EVENT_RESET_END,
 
+
        TARGET_EVENT_DEBUG_HALTED,      /* target entered debug state, but was executing on behalf of the debugger */
        TARGET_EVENT_DEBUG_RESUMED, /* target resumed to execute on behalf of the debugger */
 
+       TARGET_EVENT_EXAMINE_START,
+       TARGET_EVENT_EXAMINE_END,
+       
+
        TARGET_EVENT_GDB_ATTACH,
        TARGET_EVENT_GDB_DETACH,
 
@@ -298,6 +324,7 @@ extern const Jim_Nvp nvp_target_event[];
 struct target_event_action_s {
        enum target_event event;
        Jim_Obj *body;
+       int      has_percent;
        target_event_action_t *next;
  };
 
@@ -392,7 +419,8 @@ int target_write_u8(struct target_s *target, u32 address, u8 value);
 /* Issues USER() statements with target state information */
 int target_arch_state(struct target_s *target);
 
-int target_invoke_script(struct command_context_s *cmd_ctx, target_t *target, char *name);
+void target_handle_event( target_t *t, enum target_event e);
+void target_all_handle_event( enum target_event e );
 
 
 #define ERROR_TARGET_INVALID   (-300)
@@ -407,12 +435,7 @@ int target_invoke_script(struct command_context_s *cmd_ctx, target_t *target, ch
 #define ERROR_TARGET_NOT_RUNNING (-310)
 #define ERROR_TARGET_NOT_EXAMINED (-311)
 
-#endif /* TARGET_H */
-
+extern const Jim_Nvp nvp_error_target[];
+extern const char *target_strerror_safe( int err );
 
-/*
- * Local Variables: ***
- * c-basic-offset: 4 ***
- * tab-width: 4 ***
- * End: ***
- */
+#endif /* TARGET_H */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)