target/profiling: Use the correct method to access registers
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 18 Jan 2015 14:36:52 +0000 (15:36 +0100)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Wed, 11 Feb 2015 22:17:21 +0000 (22:17 +0000)
Change-Id: I6b8590dc9d07886b885013b1b767fe2f0739cd6a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2479
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
src/target/target.c

index c2408b27c584436320f2434f1ead3ad220ea5a6e..9f12704a5c2c767c2b8afe179458cc2eba289e5a 100644 (file)
@@ -1819,7 +1819,7 @@ static int target_profiling_default(struct target *target, uint32_t *samples,
        for (;;) {
                target_poll(target);
                if (target->state == TARGET_HALTED) {
-                       uint32_t t = *((uint32_t *)reg->value);
+                       uint32_t t = buf_get_u32(reg->value, 0, 32);
                        samples[sample_count++] = t;
                        /* current pc, addr = 0, do not handle breakpoints, not debugging */
                        retval = target_resume(target, 1, 0, 0, 0);