diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 441ac73135f..9e4b4088d8b 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -199,6 +199,10 @@ static void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -283,10 +287,6 @@ static void up_dumpstate(void) up_stackdump(sp, ustackbase); } - /* Then dump the registers (if available) */ - - up_registerdump(); - #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 66815078b06..56bcde7c9d3 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -236,6 +236,10 @@ static void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -336,10 +340,6 @@ static void up_dumpstate(void) } #endif - /* Then dump the registers (if available) */ - - up_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index d1e70277247..1c6acda57ca 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -240,6 +240,10 @@ static void up_dumpstate(void) uint32_t kstackbase = 0; #endif + /* Dump the CPU registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -364,10 +368,6 @@ static void up_dumpstate(void) _alert("CPU%d:\n", up_cpu_index()); #endif - /* Then dump the CPU registers (if available) */ - - up_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index b25e1c43795..96fef46dbf3 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -244,6 +244,10 @@ static void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -358,10 +362,6 @@ static void up_dumpstate(void) _alert("CPU%d:\n", up_cpu_index()); #endif - /* Then dump the registers (if available) */ - - up_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index 5eb11e58229..c4d7c169545 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -236,6 +236,10 @@ static void up_dumpstate(void) uint32_t kstackbase = 0; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -343,10 +347,6 @@ static void up_dumpstate(void) #endif } - /* Then dump the registers (if available) */ - - up_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/avr/src/avr/up_dumpstate.c b/arch/avr/src/avr/up_dumpstate.c index ba7e204621d..7893419d69b 100644 --- a/arch/avr/src/avr/up_dumpstate.c +++ b/arch/avr/src/avr/up_dumpstate.c @@ -169,6 +169,10 @@ void up_dumpstate(void) uint16_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -267,10 +271,6 @@ void up_dumpstate(void) up_stackdump(sp, ustackbase); } #endif - - /* Then dump the registers (if available) */ - - up_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/avr/src/avr32/up_dumpstate.c b/arch/avr/src/avr32/up_dumpstate.c index 39f18ea0699..13aa72c77f1 100644 --- a/arch/avr/src/avr32/up_dumpstate.c +++ b/arch/avr/src/avr32/up_dumpstate.c @@ -135,6 +135,10 @@ void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -233,9 +237,5 @@ void up_dumpstate(void) up_stackdump(sp, ustackbase); } #endif - - /* Then dump the registers (if available) */ - - up_registerdump(); } #endif diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index ad2cced573f..aea6a309556 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -193,6 +193,10 @@ static void up_dumpstate(void) uint16_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -267,10 +271,6 @@ static void up_dumpstate(void) up_stackdump(sp, ustackbase); } - /* Then dump the registers (if available) */ - - up_registerdump(); - #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ diff --git a/arch/mips/src/mips32/up_dumpstate.c b/arch/mips/src/mips32/up_dumpstate.c index f17bc9f2050..ba1d1ccfbec 100644 --- a/arch/mips/src/mips32/up_dumpstate.c +++ b/arch/mips/src/mips32/up_dumpstate.c @@ -148,6 +148,10 @@ void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -221,10 +225,6 @@ void up_dumpstate(void) { up_stackdump(sp, ustackbase); } - - /* Then dump the registers (if available) */ - - up_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/misoc/src/lm32/lm32_dumpstate.c b/arch/misoc/src/lm32/lm32_dumpstate.c index 08f30c4debf..96a25c323d7 100644 --- a/arch/misoc/src/lm32/lm32_dumpstate.c +++ b/arch/misoc/src/lm32/lm32_dumpstate.c @@ -144,6 +144,10 @@ void lm32_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -217,10 +221,6 @@ void lm32_dumpstate(void) { up_stackdump(sp, ustackbase); } - - /* Then dump the registers (if available) */ - - up_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/or1k/src/common/up_assert.c b/arch/or1k/src/common/up_assert.c index 15f60b32577..b01704a0b4e 100644 --- a/arch/or1k/src/common/up_assert.c +++ b/arch/or1k/src/common/up_assert.c @@ -241,6 +241,10 @@ static void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -341,10 +345,6 @@ static void up_dumpstate(void) } #endif - /* Then dump the registers (if available) */ - - up_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/renesas/src/m16c/m16c_dumpstate.c b/arch/renesas/src/m16c/m16c_dumpstate.c index 94be03186c1..5e67741aaca 100644 --- a/arch/renesas/src/m16c/m16c_dumpstate.c +++ b/arch/renesas/src/m16c/m16c_dumpstate.c @@ -160,6 +160,10 @@ void up_dumpstate(void) uint16_t istacksize; #endif + /* Dump the registers (if available) */ + + m16c_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -239,10 +243,6 @@ void up_dumpstate(void) { m16c_stackdump(sp, ustackbase); } - - /* Then dump the registers (if available) */ - - m16c_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/renesas/src/sh1/sh1_dumpstate.c b/arch/renesas/src/sh1/sh1_dumpstate.c index 5974aa0b9e1..84c512e7739 100644 --- a/arch/renesas/src/sh1/sh1_dumpstate.c +++ b/arch/renesas/src/sh1/sh1_dumpstate.c @@ -150,6 +150,10 @@ void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + sh1_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -223,10 +227,6 @@ void up_dumpstate(void) { sh1_stackdump(sp, ustackbase); } - - /* Then dump the registers (if available) */ - - sh1_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/risc-v/src/rv32im/up_dumpstate.c b/arch/risc-v/src/rv32im/up_dumpstate.c index 25942413a88..795f7933673 100644 --- a/arch/risc-v/src/rv32im/up_dumpstate.c +++ b/arch/risc-v/src/rv32im/up_dumpstate.c @@ -153,6 +153,10 @@ void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + up_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -226,10 +230,6 @@ void up_dumpstate(void) { up_stackdump(sp, ustackbase); } - - /* Then dump the registers (if available) */ - - up_registerdump(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 41ec9967884..c2182bba1c5 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -144,6 +144,20 @@ static void up_dumpstate(void) uint32_t istacksize; #endif + /* Dump the registers (if available) */ + + if (g_current_regs != NULL) + { + up_registerdump((uint32_t*)g_current_regs); + } + else + { + /* Capture and dump user registers by hand */ + + up_saveusercontext(s_last_regs); + up_registerdump(s_last_regs); + } + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -218,20 +232,6 @@ static void up_dumpstate(void) up_stackdump(sp, ustackbase); } - /* Then dump the registers (if available) */ - - if (g_current_regs != NULL) - { - up_registerdump((uint32_t*)g_current_regs); - } - else - { - /* Capture and dump user registers by hand */ - - up_saveusercontext(s_last_regs); - up_registerdump(s_last_regs); - } - #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index 0cb2a8215e6..bb34dedaeb5 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -208,6 +208,10 @@ void xtensa_dumpstate(void) _alert("CPU%d:\n", up_cpu_index()); #endif + /* Dump the registers (if available) */ + + xtensa_registerdump(); + /* Get the limits on the user stack memory */ if (rtcb->pid == 0) @@ -292,10 +296,6 @@ void xtensa_dumpstate(void) xtensa_stackdump(sp, ustackbase); } - /* Then dump the registers (if available) */ - - xtensa_registerdump(); - /* Dump the state of all tasks (if available) */ up_showtasks(); diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index d63aa405705..baabf551bc1 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -177,8 +177,8 @@ void up_assert(void) #endif #endif - up_stackdump(); up_registerdump(); + up_stackdump(); #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index 711aed53d4e..7df2e07889a 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -176,8 +176,8 @@ void up_assert(void) #endif #endif - up_stackdump(); REGISTER_DUMP(); + up_stackdump(); #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */