summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-03-30 13:32:47 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-03-31 09:30:48 +0200
commitb75bdb7b0428add602c2e4beb7e059da5d4a6c95 (patch)
treec91f17fb395f04902a04ba78b7874bcdf77b649a /src
parentac6f8f9616aada403c52254738096ec43888ca42 (diff)
downloadopenocd+libswd-b75bdb7b0428add602c2e4beb7e059da5d4a6c95.tar.gz
openocd+libswd-b75bdb7b0428add602c2e4beb7e059da5d4a6c95.tar.bz2
openocd+libswd-b75bdb7b0428add602c2e4beb7e059da5d4a6c95.tar.xz
openocd+libswd-b75bdb7b0428add602c2e4beb7e059da5d4a6c95.zip
target: add -dbgbase option to target configuration
Really a Cortex-A specific option, but there is no system in place to support target specific options currently and there has been no need for such a system until now. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src')
-rw-r--r--src/target/target.c18
-rw-r--r--src/target/target.h5
2 files changed, 23 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 00d4309c..df38c837 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3703,6 +3703,7 @@ enum target_cfg_param {
TCFG_VARIANT,
TCFG_COREID,
TCFG_CHAIN_POSITION,
+ TCFG_DBGBASE,
};
static Jim_Nvp nvp_config_opts[] = {
@@ -3716,6 +3717,7 @@ static Jim_Nvp nvp_config_opts[] = {
{ .name = "-variant", .value = TCFG_VARIANT },
{ .name = "-coreid", .value = TCFG_COREID },
{ .name = "-chain-position", .value = TCFG_CHAIN_POSITION },
+ { .name = "-dbgbase", .value = TCFG_DBGBASE },
{ .name = NULL, .value = -1 }
};
@@ -4006,6 +4008,22 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
Jim_SetResultString(goi->interp, target->tap->dotted_name, -1);
/* loop for more e*/
break;
+ case TCFG_DBGBASE:
+ if (goi->isconfigure) {
+ e = Jim_GetOpt_Wide(goi, &w);
+ if (e != JIM_OK) {
+ return e;
+ }
+ target->dbgbase = (uint32_t)w;
+ target->dbgbase_set = true;
+ } else {
+ if (goi->argc != 0) {
+ goto no_params;
+ }
+ }
+ Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->dbgbase));
+ /* loop for more */
+ break;
}
} /* while (goi->argc) */
diff --git a/src/target/target.h b/src/target/target.h
index d6e7431e..32fa87a1 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -155,6 +155,11 @@ struct target
* lots of halted/resumed info when stepping in debugger. */
bool halt_issued; /* did we transition to halted state? */
long long halt_issued_time; /* Note time when halt was issued */
+
+ bool dbgbase_set; /* By default the debug base is not set */
+ uint32_t dbgbase; /* Really a Cortex-A specific option, but there is no
+ system in place to support target specific options
+ currently. */
};
/** Returns the instance-specific name of the specified target. */