[PATCH] improve the format error reporting on i386

zack leung zakthertemsdev at gmail.com
Wed Sep 8 00:27:37 UTC 2021


- thread id is printed as a hex value
- EBP ESP is now printed as a address pointer %p
- Program counter is printed as a pinter
Part of ticket #4203

On Wed, 8 Sept 2021 at 00:17, Zacchaeus Leung <zakthertemsdev at gmail.com>
wrote:

> ---
>  cpukit/score/cpu/i386/cpu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
> index 77b7a7161c..3c5b7db316 100644
> --- a/cpukit/score/cpu/i386/cpu.c
> +++ b/cpukit/score/cpu/i386/cpu.c
> @@ -215,7 +215,7 @@ 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 %p" " by thread 0x%" PRIx32
> "\n",
>          ctx->idtIndex,
>          ctx->eip,
>          _Thread_Executing->Object.id);
> @@ -224,7 +224,7 @@ void _CPU_Exception_frame_print (const
> CPU_Exception_frame *ctx)
>    printk("----------------------------------------------------------\n");
>    printk(" EAX = %" PRIx32 "   EBX = %" PRIx32 "       ECX = %" PRIx32 "
>      EDX = %" PRIx32 "\n",
>          ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
> -  printk(" ESI = %" PRIx32 "   EDI = %" PRIx32 "       EBP = %" PRIx32 "
>      ESP = %" PRIx32 "\n",
> +  printk(" ESI = %" PRIx32 "   EDI = %" PRIx32 "       EBP = %p" "
>  ESP = %p" "\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"PRIx32 " ",fp->pc);
>                         if ( ! (i&3) )
>                                 printk("\n");
>                 }
> --
> 2.33.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210908/71e577e0/attachment.html>


More information about the devel mailing list