diff mbox

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

Message ID 1439265774-17271-3-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Aug. 11, 2015, 4:02 a.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>
Reviewed-by: Tom Rini <trini@konsulko.com>
---

Changes in v3:
- Replace 'regs->eip' with 'eip'

Changes in v2:
- Tweak the dump_regs() output to say 'Original EIP'

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

Comments

Bin Meng Aug. 11, 2015, 5:49 a.m. UTC | #1
On Tue, Aug 11, 2015 at 12:02 PM, 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>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>
> Changes in v3:
> - Replace 'regs->eip' with 'eip'
>
> Changes in v2:
> - Tweak the dump_regs() output to say 'Original EIP'
>
>  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 9217307..addd26e 100644
> --- a/arch/x86/cpu/interrupts.c
> +++ b/arch/x86/cpu/interrupts.c
> @@ -103,6 +103,8 @@ static void dump_regs(struct irq_regs *regs)
>
>         printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
>                         (u16)cs, eip, eflags);
> +       if (gd->flags & GD_FLG_RELOC)
> +               printf("Original EIP :[<%08lx>]\n", eip - gd->reloc_off);
>
>         printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
>                 regs->eax, regs->ebx, regs->ecx, regs->edx);
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass Aug. 12, 2015, 3:55 a.m. UTC | #2
On 10 August 2015 at 23:49, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Tue, Aug 11, 2015 at 12:02 PM, 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>
>> Reviewed-by: Tom Rini <trini@konsulko.com>
>> ---
>>
>> Changes in v3:
>> - Replace 'regs->eip' with 'eip'
>>
>> Changes in v2:
>> - Tweak the dump_regs() output to say 'Original EIP'
>>
>>  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 9217307..addd26e 100644
>> --- a/arch/x86/cpu/interrupts.c
>> +++ b/arch/x86/cpu/interrupts.c
>> @@ -103,6 +103,8 @@ static void dump_regs(struct irq_regs *regs)
>>
>>         printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
>>                         (u16)cs, eip, eflags);
>> +       if (gd->flags & GD_FLG_RELOC)
>> +               printf("Original EIP :[<%08lx>]\n", eip - gd->reloc_off);
>>
>>         printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
>>                 regs->eax, regs->ebx, regs->ecx, regs->edx);
>> --
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-x86.
diff mbox

Patch

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