summaryrefslogtreecommitdiff
path: root/src/target/register.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-07 18:04:14 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-07 18:04:14 +0000
commit3aef2f08589e46bbbce15a4534c4900bc2528998 (patch)
tree48a5ed64668e450a58b1ef79d15a6ee823f3e8b0 /src/target/register.c
parent2babd879165466517b3d5f0530794a3885b3eeaf (diff)
downloadopenocd+libswd-3aef2f08589e46bbbce15a4534c4900bc2528998.tar.gz
openocd+libswd-3aef2f08589e46bbbce15a4534c4900bc2528998.tar.bz2
openocd+libswd-3aef2f08589e46bbbce15a4534c4900bc2528998.tar.xz
openocd+libswd-3aef2f08589e46bbbce15a4534c4900bc2528998.zip
Fixes SEGFAULT when setting registers from GDB.
set $cpsr=1234 git-svn-id: svn://svn.berlios.de/openocd/trunk@1026 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/register.c')
-rw-r--r--src/target/register.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/target/register.c b/src/target/register.c
index 1a8f6ddd..cb80eff6 100644
--- a/src/target/register.c
+++ b/src/target/register.c
@@ -2,6 +2,9 @@
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
+ * Copyright (C) 2007,2008 Øyvind Harboe *
+ * oyvind.harboe@zylin.com *
+ * *
* 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 *
@@ -103,3 +106,27 @@ reg_arch_type_t* register_get_arch_type(int id)
exit(-1);
return NULL;
}
+
+
+
+static int register_get_dummy_core_reg(reg_t *reg)
+{
+ return ERROR_OK;
+}
+
+static int register_set_dummy_core_reg(reg_t *reg, u8 *buf)
+{
+ reg->dirty = 1;
+ reg->valid = 1;
+
+ return ERROR_OK;
+}
+
+void register_init_dummy(reg_t *reg)
+{
+ static int dummy_arch_type = -1;
+ if (dummy_arch_type == -1 )
+ register_reg_arch_type(register_get_dummy_core_reg, register_set_dummy_core_reg);
+
+ reg->arch_type = dummy_arch_type;
+}