Adding Debug Symbol To U-Boot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Debug Symbol To U-Boot

yyurtcan
Hi,
I have p4080ds and lauterbach(T32) hardware debugger. As known, u-boot has written both assembly and C language. I can debug all u-boot code in assembly language(C code also converted to assembly). However, it is hard to follow. How can I debug u-boot C code in C language(not assembly)? What I mean is that at the beginning there is assembly part after that whole code is C language. I want to debug C code in C language not assembly language. Here is my script that is enable debugging u-boot in assembly language.(I have already load u-boot to Nor Flash). If it is not possible, I want to add debug symbols to assembly code for linking C code. To do that what are the requirement to rebuild uboot?

--------Script Start -------------------
SYStem.Reset
SYStem.CPU P4080
CORE.ASSIGN 1
MAP.BOnchip 0xFFFFF000--0xFFFFFFFF
SYStem.UP
Data.dump 0xFFFFF000--0xFFFFFFFF
--------Script End-------------------

Best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Adding Debug Symbol To U-Boot

Lukasz Majewski-5
On 07/12/2017 12:42 PM, yyurtcan wrote:

> Hi,
> I have p4080ds and lauterbach(T32) hardware debugger. As known, u-boot has
> written both assembly and C language. I can debug all u-boot code in
> assembly language(C code also converted to assembly). However, it is hard to
> follow. How can I debug u-boot C code in C language(not assembly)? What I
> mean is that at the beginning there is assembly part after that whole code
> is C language. I want to debug C code in C language not assembly language.
> Here is my script that is enable debugging u-boot in assembly language.(I
> have already load u-boot to Nor Flash). If it is not possible, I want to add
> debug symbols to assembly code for linking C code. To do that what are the
> requirement to rebuild uboot?

With T32 please pay attention to:

1. If the code is after or before relocation - u-boot relocates itself,
so the location of debugging symbols varies.

2. The C code before relocation is rather tiny, so for 99% you would
like to debug the "after" relocation part.

TO do that - please type 'bdinfo" and look into relocation offset.

This value should be added to T32's command to load symbols:

data.load.elf <elf with debugging symbols> <offset> /nocode



>
> --------Script Start -------------------
> SYStem.Reset
> SYStem.CPU P4080
> CORE.ASSIGN 1
> MAP.BOnchip 0xFFFFF000--0xFFFFFFFF
> SYStem.UP
> Data.dump 0xFFFFF000--0xFFFFFFFF
> --------Script End-------------------
>
> Best regards.
>
>
>
>
> --
> View this message in context: http://u-boot.10912.n7.nabble.com/Adding-Debug-Symbol-To-U-Boot-tp298352.html
> Sent from the U-Boot mailing list archive at Nabble.com.
> _______________________________________________
> U-Boot mailing list
> [hidden email]
> https://lists.denx.de/listinfo/u-boot
>


--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: Adding Debug Symbol To U-Boot

yyurtcan
Hi,
First of all thank you for reply. The board p4080ds hangs at uboot and could not go into to ddr relocation part. Therefore, there is no output from uart. So, I want to debug before relocation(at the begining start.s document). What procedure should I follow for this?

Best Regards.