All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Debugging u-boot
@ 2010-03-11 14:48 Bjørnar Syverstad
  2010-03-11 15:41 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørnar Syverstad @ 2010-03-11 14:48 UTC (permalink / raw)
  To: u-boot

Hello,
I am trying to debug the u-boot with help of gdb + eclipse. Useing the phy3250_config.

The problem is that when debugging, the listed source code seems to be out of sync.
The debugger pointer in the source code, seems not to point to the correct source code.

The assembler windows shows typical this:

<source line is not available>
0x00013f0c <phy3250_get_board_info>:     ldr    r1, [pc, #480]   ; 0x140f4 <phy3250_get_board_info+488>
0x00013f14 <phy3250_get_board_info+8>:   ldr    r3, [r1, #120]                ; 0x78
0x00013f1c <phy3250_get_board_info+16>:  orr    r3, r3, #1
0x00013f20 <phy3250_get_board_info+20>:  str    r3, [r1, #120]               ; 0x78

It does miss the code in "<source line is not available>"

It is the same problem useing only gdb.

So it seems to me that some debug information is missing in the elf file u-boot.

I did look at u-boot.lds and did not find any debug sections.
I do find some debug information on the u-boot elf file in readelf/objdump.

Bellow is an output of some part of the compiling. And there it have -g and -Os flags.....

arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -fno-strict-aliasing  -fno-common -ffixed-r8  -D__KERNEL__ -DTEXT_BASE=0x00000000 -I/opt/ltib/ltib-10-1-1a-sv/rpm/BUILD/u-boot-2009.03-rc1/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv5te -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te   -Wall -Wstrict-prototypes -fno-stack-protector -c -o lowlevelsys_init.o lowlevelsys_init.c

Is there something parameters to make to add more debug information?

Best Regards
Bj?rnar Syverstad

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2010-03-11 14:48 Bjørnar Syverstad
@ 2010-03-11 15:41 ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2010-03-11 15:41 UTC (permalink / raw)
  To: u-boot

Dear =?iso-8859-1?Q?Bj=F8rnar_Syverstad?=,

In message <3F466DDF09A55D46858FC39B22DE56F23A30259045@pat.prediktor.no> you wrote:
>
> I am trying to debug the u-boot with help of gdb + eclipse. Useing the phy3250_config.
>
> The problem is that when debugging, the listed source code seems to be out of sync.
> The debugger pointer in the source code, seems not to point to the correct source code.

Did you read the manual, for example here:
http://www.denx.de/wiki/view/DULG/DebuggingTricks

> The assembler windows shows typical this:
>
> <source line is not available>
...
> It does miss the code in "<source line is not available>"

So what? Eventually the compiler optimized this code away, of shifted
it to some other place where you don;t expect it.

> I did look at u-boot.lds and did not find any debug sections.

The linker script has little to do with that.

> Is there something parameters to make to add more debug information?

I don't think that this is your problem.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Motto of the Electrical Engineer: Working computer hardware is a  lot
like an erect penis: it stays up as long as you don't fuck with it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
@ 2011-08-30 11:59 Mirko Banchi
  2011-08-30 12:09 ` Stefano Babic
  2011-08-30 12:55 ` Wolfgang Denk
  0 siblings, 2 replies; 9+ messages in thread
From: Mirko Banchi @ 2011-08-30 11:59 UTC (permalink / raw)
  To: u-boot

Hi all, could someone write briefly the steps needed to debug u-boot with BDI2000? I can-t find documentation about it. On-line docs specify only how to proceed with gdb after that the host bdi is up and configured.

Thank you all!

Mirko

--
Mirko Banchi

e-mail:    mk.banchi at gmail.com
id-jabber: mk.banchi at jabber.org

PGP key fingerprint:

308F BFB1 4E67 2522 C88E 
DC69 7631 52ED 32A5 6456

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2011-08-30 11:59 [U-Boot] Debugging u-boot Mirko Banchi
@ 2011-08-30 12:09 ` Stefano Babic
  2011-08-30 12:14   ` Mirko Banchi
  2011-08-30 12:55 ` Wolfgang Denk
  1 sibling, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2011-08-30 12:09 UTC (permalink / raw)
  To: u-boot

On 08/30/2011 01:59 PM, Mirko Banchi wrote:
> Hi all, could someone write briefly the steps needed to debug u-boot
> with BDI2000? I can-t find documentation about it. On-line docs
> specify only how to proceed with gdb after that the host bdi is up
> and configured.

http://www.denx.de/wiki/view/DULG/DebuggingUBoot

To set up the BDI2000 please refer to the Abatron manual.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2011-08-30 12:09 ` Stefano Babic
@ 2011-08-30 12:14   ` Mirko Banchi
  0 siblings, 0 replies; 9+ messages in thread
From: Mirko Banchi @ 2011-08-30 12:14 UTC (permalink / raw)
  To: u-boot


> To set up the BDI2000 please refer to the Abatron manual.


This was the missing step  :)

Thank you Stefano!

Mirko

--
Mirko Banchi

e-mail:    mk.banchi at gmail.com
id-jabber: mk.banchi at jabber.org

PGP key fingerprint:

308F BFB1 4E67 2522 C88E 
DC69 7631 52ED 32A5 6456

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2011-08-30 11:59 [U-Boot] Debugging u-boot Mirko Banchi
  2011-08-30 12:09 ` Stefano Babic
@ 2011-08-30 12:55 ` Wolfgang Denk
  2011-08-30 13:59   ` Mirko Banchi
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-08-30 12:55 UTC (permalink / raw)
  To: u-boot

Dear Mirko Banchi,

In message <659ACFBD-2B5D-4F28-89BF-5473D90ADFA5@gmail.com> you wrote:
> Hi all, could someone write briefly the steps needed to debug u-boot with BDI2000? I can-t find documentation about it. On-line docs specify only how to proceed with gdb after that the host bdi is up and configured.

Could you please explain which information you consider missing in
these sections of the manual?

10.1. Debugging of U-Boot

    10.1.1. Debugging of U-Boot Before Relocation
    10.1.2. Debugging of U-Boot After Relocation


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Philosophy is a game with objectives and no rules.
Mathematics is a game with rules and no objectives.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2011-08-30 12:55 ` Wolfgang Denk
@ 2011-08-30 13:59   ` Mirko Banchi
  2011-08-30 14:13     ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Mirko Banchi @ 2011-08-30 13:59 UTC (permalink / raw)
  To: u-boot


Il giorno 30/ago/2011, alle ore 14.55, Wolfgang Denk ha scritto:

> Dear Mirko Banchi,
> 
> In message <659ACFBD-2B5D-4F28-89BF-5473D90ADFA5@gmail.com> you wrote:
>> Hi all, could someone write briefly the steps needed to debug u-boot with BDI2000? I can-t find documentation about it. On-line docs specify only how to proceed with gdb after that the host bdi is up and configured.
> 
> Could you please explain which information you consider missing in
> these sections of the manual?
> 
> 10.1. Debugging of U-Boot
> 
>    10.1.1. Debugging of U-Boot Before Relocation
>    10.1.2. Debugging of U-Boot After Relocation
> 

In those sections of the manual there is explained only how to specify the remote target for gdb and the steps for debugging when the BDI is already configured. From those documents i think is not clear how to configure the environment  for bdi. Maybe a note about the existence of Abatron manual could be useful. 

Thank you.

Mirko

--
Mirko Banchi

e-mail:    mk.banchi at gmail.com
id-jabber: mk.banchi at jabber.org

PGP key fingerprint:

308F BFB1 4E67 2522 C88E 
DC69 7631 52ED 32A5 6456

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
  2011-08-30 13:59   ` Mirko Banchi
@ 2011-08-30 14:13     ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2011-08-30 14:13 UTC (permalink / raw)
  To: u-boot

Dear Mirko Banchi,

In message <857D4443-39B6-43B0-B269-BB6CE7C9AC4E@gmail.com> you wrote:
> 
> > Could you please explain which information you consider missing in
> > these sections of the manual?
> > 
> > 10.1. Debugging of U-Boot
> > 
> >    10.1.1. Debugging of U-Boot Before Relocation
> >    10.1.2. Debugging of U-Boot After Relocation
> 
> In those sections of the manual there is explained only how to specify
> the remote target for gdb and the steps for debugging when the BDI is
> already configured. From those documents i think is not clear how to
> configure the environment  for bdi. Maybe a note about the existence of
> Abatron manual could be useful. 

You mean you did not find the manual when unpacking your BDI3000?

Strange.


Sorry, but no, I don't think adding information on this level would be
appropriate here.  The DULG deals with U-Boot and Linux; configuration
of your JTAG debugger is a different topic which gets covered by the
manuals of your debugger's provider.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Debugging u-boot
@ 2014-10-07  6:30 Kantanu Kumar Mohapatra
  0 siblings, 0 replies; 9+ messages in thread
From: Kantanu Kumar Mohapatra @ 2014-10-07  6:30 UTC (permalink / raw)
  To: u-boot

Hi

In reply to this, can anyone please suggest me, how to debug the
fw_printenv code in u-boot?
I am using buildroot-2014.02, which used uboot-tools-2014.01. But I am
having few custom changes in uboot-2010.03, those I want to use, in
tools-2014.01 I can see as of now, the code fails on fw_printenv().

Thanks,
Kantanu

Dear Kantanu,

In message <
20141002235515.0f6337076cc849064921372b9de1c389.ce86d191f7.mailapi@email10.secureserver.net>
you wrote:
>
> I am Kantanu, working for U-Boot related stuff as a freelancer. Can
> you please suggest how to see the u-boot logs. I am using syslog to
> see the logs, but how to get these u-boot stderr logs to syslog?

It is always best to ask such questions on the U-Boot mailing list.

U-Boot does not support a file concept, and thus no file redirection
either. So there is no easy way to "redirect" console output to a log
buffer. You would have to implement such a redirecting driver.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"What if" is a trademark of Hewlett Packard, so stop using it in your
sentences without permission, or risk being sued.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-07  6:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30 11:59 [U-Boot] Debugging u-boot Mirko Banchi
2011-08-30 12:09 ` Stefano Babic
2011-08-30 12:14   ` Mirko Banchi
2011-08-30 12:55 ` Wolfgang Denk
2011-08-30 13:59   ` Mirko Banchi
2011-08-30 14:13     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2014-10-07  6:30 Kantanu Kumar Mohapatra
2010-03-11 14:48 Bjørnar Syverstad
2010-03-11 15:41 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.