[PATCH v4] improve the format of error reporting on i386

zack leung zakthertemsdev at gmail.com
Thu Sep 16 00:27:07 UTC 2021


printk("----------------------------------------------------------\n");
printk("Exception %" PRIu32 " caught at PC 0x%" PRIx32 " by thread 0x%"
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 = 0x%" PRIx32 " ECX = %" PRIx32 " EDX = %"
PRIx32 "\n",
ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
printk(" ESI = 0x%" PRIx32 " EDI = 0x%" PRIx32 " EBP = 0x%" PRIx32 " ESP =
0x%" PRIx32 "\n",
ctx->esi, ctx->edi, ctx->ebp, ctx->esp0);


Before I send my patch here is what i'll change . So i can do this for
example format the hex values with 0x and
have the thread id as a hex value.

On Wed, 15 Sept 2021 at 15:18, Gedare Bloom <gedare at rtems.org> wrote:

> On Mon, Sep 13, 2021 at 6:10 PM zack leung <zakthertemsdev at gmail.com>
> wrote:
> >
> > Gedare told me just to change the ID when I submitted the other I sent
> you
> > in discord. Sorry for things bouncing back and forth.
> >
>
> I said not to change the `type` of the register context variables from
> 32 to ptr. You can change their representation to hex that's fine by
> me, with the fixed width and 0x prepended.
>
> > On Mon, 13 Sept 2021 at 23:44, Joel Sherrill <joel at rtems.org> wrote:
> >
> > > On Sun, Sep 12, 2021 at 7:02 PM zack leung <zakthertemsdev at gmail.com>
> > > wrote:
> > > >
> > > > Thread id is now a Hex value.
> > > > Updates #4203
> > > > ---
> > > > cpukit/score/cpu/i386/cpu.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/cpukit/score/cpu/i386/cpu.c
> b/cpukit/score/cpu/i386/cpu.c
> > > > index 77b7a7161c..06af57418d 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 %" PRIx32 " by thread %"
> > > > PRIx32 "\n",
> > >
> > > PC and ID should use .... PC 0x%08" PRIx32.
> > >
> > > Prefixing with 0x to indicate that the number is hexadecimal. Printing
> > > it with leading zero's and 8 digits wide helps since the address and
> > > thread id are 32-bit (8 nibbles).  A thread id is usually printed like
> > > 0x0a010004
> > >
> > > Does this patch have all your other changes? I've slept since seeing
> > > this time and thought there were changes..
> > >
> > > --joel
> > >
> > > > ctx->idtIndex,
> > > > ctx->eip,
> > > > _Thread_Executing->Object.id);
> > > > --
> > > > 2.33.0
> > > > _______________________________________________
> > > > devel mailing list
> > > > devel at rtems.org
> > > > http://lists.rtems.org/mailman/listinfo/devel
> > >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>


More information about the devel mailing list