diff mbox

[U-Boot,04/18] x86: Show the un-relocated IP address in exceptions

Message ID 1436222877-17548-5-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 6, 2015, 10:47 p.m. UTC
When trying to figure out where an exception has occured, the relocated
address is not a lot of help. Its value depends on various factors. Show
the un-relocated IP as well. This can be looked up in System.map directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/cpu/interrupts.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bin Meng July 7, 2015, 7:34 a.m. UTC | #1
Hi Simon,

On Tue, Jul 7, 2015 at 6:47 AM, Simon Glass <sjg@chromium.org> wrote:
> When trying to figure out where an exception has occured, the relocated
> address is not a lot of help. Its value depends on various factors. Show
> the un-relocated IP as well. This can be looked up in System.map directly.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>

Some nits below:

>  arch/x86/cpu/interrupts.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
> index c777d36..cff004e 100644
> --- a/arch/x86/cpu/interrupts.c
> +++ b/arch/x86/cpu/interrupts.c
> @@ -40,6 +40,8 @@ static void dump_regs(struct irq_regs *regs)
>
>         printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
>                         (u16)regs->xcs, regs->eip, regs->eflags);
> +       if (gd->flags & GD_FLG_RELOC)
> +               printf("reloc EIP : [<%08lx>]\n", regs->eip - gd->reloc_off);

Could it be 'Original EIP' instead of 'reloc EIP'? To me, 'reloc EIP'
sounds confusing. And the space followed immediately after ':' can be
removed?

>
>         printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
>                 regs->eax, regs->ebx, regs->ecx, regs->edx);
> --

Regards,
Bin
diff mbox

Patch

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index c777d36..cff004e 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -40,6 +40,8 @@  static void dump_regs(struct irq_regs *regs)
 
 	printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
 			(u16)regs->xcs, regs->eip, regs->eflags);
+	if (gd->flags & GD_FLG_RELOC)
+		printf("reloc EIP : [<%08lx>]\n", regs->eip - gd->reloc_off);
 
 	printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
 		regs->eax, regs->ebx, regs->ecx, regs->edx);