[rtems commit] improve the format error reporting on i386

Joel Sherrill joel at rtems.org
Mon Oct 4 22:36:16 UTC 2021


Module:    rtems
Branch:    master
Commit:    4a5a41459a12c967b0eca6dfba2fc439e6d7984b
Changeset: http://git.rtems.org/rtems/commit/?id=4a5a41459a12c967b0eca6dfba2fc439e6d7984b

Author:    Zacchaeus Leung <zakthertemsdev at outlook.com>
Date:      Tue Sep 21 17:56:38 2021 -0400

improve the format error reporting on i386

---

 cpukit/score/cpu/i386/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index 77b7a71..f4e3e4d 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -215,16 +215,16 @@ void _CPU_Exception_frame_print (const CPU_Exception_frame *ctx)
 {
   unsigned int faultAddr = 0;
   printk("----------------------------------------------------------\n");
-  printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" PRId32 "\n",
+  printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" PRIx32 "\n",
 	 ctx->idtIndex,
 	 ctx->eip,
 	 _Thread_Executing->Object.id);
   printk("----------------------------------------------------------\n");
   printk("Processor execution context at time of the fault was  :\n");
   printk("----------------------------------------------------------\n");
-  printk(" EAX = %" PRIx32 "	EBX = %" PRIx32 "	ECX = %" PRIx32 "	EDX = %" PRIx32 "\n",
+  printk(" EAX =  0x%08" PRIx32 "	EBX =  0x%08" PRIx32 "	ECX =  0x%08" PRIx32 "	EDX =  0x%08" PRIx32 "\n",
 	 ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
-  printk(" ESI = %" PRIx32 "	EDI = %" PRIx32 "	EBP = %" PRIx32 "	ESP = %" PRIx32 "\n",
+  printk(" ESI = 0x%08" PRIx32 "	EDI =  0x%08" PRIx32 "	EBP =  0x%08" PRIx32 "	ESP =  0x%08" PRIx32 "\n",
 	 ctx->esi, ctx->edi, ctx->ebp, ctx->esp0);
   printk("----------------------------------------------------------\n");
   printk("Error code pushed by processor itself (if not 0) = %" PRIx32 "\n",
@@ -250,7 +250,7 @@ void _CPU_Exception_frame_print (const CPU_Exception_frame *ctx)
 	printk("Call Stack Trace of EIP:\n");
 	if ( fp ) {
 		for ( i=1; fp->up; fp=fp->up, i++ ) {
-			printk("0x%08" PRIx32 " ",fp->pc);
+			printk("0x%08" PRIxPTR " ",fp->pc);
 			if ( ! (i&3) )
 				printk("\n");
 		}



More information about the vc mailing list