diff mbox

[U-Boot,RFC,6/7] arm: Show relocated PC/LR in the register dump

Message ID 1422644697-3735-7-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Simon Glass Jan. 30, 2015, 7:04 p.m. UTC
If we don't know the relocation address, the raw values are not very useful.
Show the pre-relocation values as well as these can be looked up in
System.map, etc.

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

 arch/arm/lib/interrupts.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Albert ARIBAUD Feb. 1, 2015, 8:45 a.m. UTC | #1
Hello Simon,

On Fri, 30 Jan 2015 12:04:56 -0700, Simon Glass <sjg@chromium.org>
wrote:
> If we don't know the relocation address, the raw values are not very useful.
> Show the pre-relocation values as well as these can be looked up in
> System.map, etc.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>

Simon, I think this one go straight into the ARM tree despite being an
RFC patch in a series -- it's useful, pretty much standalone and it
won't prevent any target from booting.

Amicalement,
Simon Glass Feb. 2, 2015, 4:42 p.m. UTC | #2
Hi Albert,

On 1 February 2015 at 01:45, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
> Hello Simon,
>
> On Fri, 30 Jan 2015 12:04:56 -0700, Simon Glass <sjg@chromium.org>
> wrote:
>> If we don't know the relocation address, the raw values are not very useful.
>> Show the pre-relocation values as well as these can be looked up in
>> System.map, etc.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
>
> Simon, I think this one go straight into the ARM tree despite being an
> RFC patch in a series -- it's useful, pretty much standalone and it
> won't prevent any target from booting.

Sure, I think it is safe.

Regards,
Simon
Albert ARIBAUD Feb. 3, 2015, 7:20 p.m. UTC | #3
Hello Simon,

On Fri, 30 Jan 2015 12:04:56 -0700, Simon Glass <sjg@chromium.org> wrote:
> If we don't know the relocation address, the raw values are not very useful.
> Show the pre-relocation values as well as these can be looked up in
> System.map, etc.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/arm/lib/interrupts.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
> index 4dacfd9..06f4679 100644
> --- a/arch/arm/lib/interrupts.c
> +++ b/arch/arm/lib/interrupts.c
> @@ -137,10 +137,15 @@ void show_regs (struct pt_regs *regs)
>  
>  	flags = condition_codes (regs);
>  
> -	printf ("pc : [<%08lx>]	   lr : [<%08lx>]\n"
> -		"sp : %08lx  ip : %08lx	 fp : %08lx\n",
> -		instruction_pointer (regs),
> -		regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
> +	printf("pc : [<%08lx>]	   lr : [<%08lx>]\n",
> +	       instruction_pointer(regs), regs->ARM_lr);
> +	if (gd->flags & GD_FLG_RELOC) {
> +		printf("reloc pc : [<%08lx>]	   lr : [<%08lx>]\n",
> +		       instruction_pointer(regs) - gd->reloc_off,
> +		       regs->ARM_lr - gd->reloc_off);
> +	}
> +	printf("sp : %08lx  ip : %08lx	 fp : %08lx\n",
> +	       regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
>  	printf ("r10: %08lx  r9 : %08lx	 r8 : %08lx\n",
>  		regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
>  	printf ("r7 : %08lx  r6 : %08lx	 r5 : %08lx  r4 : %08lx\n",
> -- 
> 2.2.0.rc0.207.ga3a616c
> 

Applied as a "bugfix" to u-boot-arm/master, thanks!

Amicalement,
diff mbox

Patch

diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
index 4dacfd9..06f4679 100644
--- a/arch/arm/lib/interrupts.c
+++ b/arch/arm/lib/interrupts.c
@@ -137,10 +137,15 @@  void show_regs (struct pt_regs *regs)
 
 	flags = condition_codes (regs);
 
-	printf ("pc : [<%08lx>]	   lr : [<%08lx>]\n"
-		"sp : %08lx  ip : %08lx	 fp : %08lx\n",
-		instruction_pointer (regs),
-		regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
+	printf("pc : [<%08lx>]	   lr : [<%08lx>]\n",
+	       instruction_pointer(regs), regs->ARM_lr);
+	if (gd->flags & GD_FLG_RELOC) {
+		printf("reloc pc : [<%08lx>]	   lr : [<%08lx>]\n",
+		       instruction_pointer(regs) - gd->reloc_off,
+		       regs->ARM_lr - gd->reloc_off);
+	}
+	printf("sp : %08lx  ip : %08lx	 fp : %08lx\n",
+	       regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
 	printf ("r10: %08lx  r9 : %08lx	 r8 : %08lx\n",
 		regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
 	printf ("r7 : %08lx  r6 : %08lx	 r5 : %08lx  r4 : %08lx\n",