Patchwork [U-Boot,v2,1/3] avr32: Print unrelocated PC on exception

login
register
mail settings
Submitter Haavard Skinnemoen
Date Aug. 12, 2010, 6:52 a.m.
Message ID <1281595974-32279-2-git-send-email-haavard.skinnemoen@atmel.com>
Download mbox | patch
Permalink /patch/71810/
State Accepted
Delegated to: Reinhard Meyer
Headers show

Comments

Haavard Skinnemoen - Aug. 12, 2010, 6:52 a.m.
In addition to the real PC value, also print the value of PC after
subtracting the relocation offset. This value will match the address in
the ELF file so it's much easier to figure out where things went wrong.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
 arch/avr32/cpu/exception.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Reinhard Meyer - Sept. 3, 2010, 11:51 a.m.
Hello Andreas,

did/can you test that one as well?
Then I can take all 3 of the series in.

Thanks,
Reinhard

> In addition to the real PC value, also print the value of PC after
> subtracting the relocation offset. This value will match the address in
> the ELF file so it's much easier to figure out where things went wrong.
> 
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> ---
>  arch/avr32/cpu/exception.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c
> index dc9c300..b21ef1f 100644
> --- a/arch/avr32/cpu/exception.c
> +++ b/arch/avr32/cpu/exception.c
> @@ -59,7 +59,8 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs)
>  {
>  	unsigned int mode;
>  
> -	printf("\n *** Unhandled exception %u at PC=0x%08lx\n", ecr, regs->pc);
> +	printf("\n *** Unhandled exception %u at PC=0x%08lx [%08lx]\n",
> +			ecr, regs->pc, regs->pc - gd->reloc_off);
>  
>  	switch (ecr) {
>  	case ECR_BUS_ERROR_WRITE:
Andreas Bießmann - Sept. 3, 2010, 1:19 p.m.
Dear Reinhard Meyer,

Am 03.09.2010 13:51, schrieb Reinhard Meyer:
> Hello Andreas,
> 
> did/can you test that one as well?
> Then I can take all 3 of the series in.

Well I have applied this patch but have never tested this till now. Yes
it works and shows correct information.

>> In addition to the real PC value, also print the value of PC after
>> subtracting the relocation offset. This value will match the address in
>> the ELF file so it's much easier to figure out where things went wrong.
>>
>> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>

Tested-by: Andreas Bießmann <biessmann@corscience.de>

regards

Andreas Bießmann
Reinhard Meyer (-VC) - Sept. 3, 2010, 2:37 p.m.
Haavard Skinnemoen schrieb:
> In addition to the real PC value, also print the value of PC after
> subtracting the relocation offset. This value will match the address in
> the ELF file so it's much easier to figure out where things went wrong.
> 
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> ---
>  arch/avr32/cpu/exception.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
Applied to u-boot-atmel/avr32
Thanks,
Reinhard

Patch

diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c
index dc9c300..b21ef1f 100644
--- a/arch/avr32/cpu/exception.c
+++ b/arch/avr32/cpu/exception.c
@@ -59,7 +59,8 @@  void do_unknown_exception(unsigned int ecr, struct pt_regs *regs)
 {
 	unsigned int mode;
 
-	printf("\n *** Unhandled exception %u at PC=0x%08lx\n", ecr, regs->pc);
+	printf("\n *** Unhandled exception %u at PC=0x%08lx [%08lx]\n",
+			ecr, regs->pc, regs->pc - gd->reloc_off);
 
 	switch (ecr) {
 	case ECR_BUS_ERROR_WRITE: