This is an automated email from Gerrit.

Hsiangkai Wang ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/1335

-- gerrit

commit 1a02c80521d594ade5189d635eced7b287e3894d
Author: Hsiangkai <[email protected]>
Date:   Tue Apr 16 13:48:17 2013 +0800

    nds32: save pc value to "pc" register
    
    As target is halted, save pc value to "pc" register.
    In Andes architecture, "pc" register just a pseudo
    register, the actual value is stored in $ir9 or $ir11
    depending on architecture. So, after target is halted, it
    needs to save the actual pc value to pseudo "pc" register.
    
    "profile" command needs "pc" register value to record
    profiling data.
    
    Change-Id: I59dfa79dcbede33b2fccbbc2fe5176bc3930e08b
    Signed-off-by: Hsiangkai <[email protected]>

diff --git a/src/target/nds32.c b/src/target/nds32.c
index 7a4e8b6..9482239 100644
--- a/src/target/nds32.c
+++ b/src/target/nds32.c
@@ -854,6 +854,10 @@ int nds32_arch_state(struct target *target)
                        value_pc,
                        nds32->virtual_hosting ? ", virtual hosting" : "");
 
+       /* save pc value to pseudo register pc */
+       struct reg *reg = register_get_by_name(target->reg_cache, "pc", 1);
+       buf_set_u32(reg->value, 0, 32, value_pc);
+
        return ERROR_OK;
 }
 

-- 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to