public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Using the abatron to debug an image in flash
@ 2003-08-07 15:00 Mark Doherty
  2003-08-07 15:22 ` Wolfgang Denk
  2003-08-07 15:23 ` Detlev Zundel
  0 siblings, 2 replies; 10+ messages in thread
From: Mark Doherty @ 2003-08-07 15:00 UTC (permalink / raw)
  To: u-boot

Hello Detlev, Wolfgang,

Thanks for your replies, you are completely correct, I should have realised!
I had some problems compiling with -O0, however building with -O1 was just
as good. 

Now I have another problem, one which I hope you may have come across
before, my debugger is failing to keep track of the updated addresses of
static variables after relocation, which makes displaying variables kinda
hard :)

Any ideas?

Mark.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [U-Boot-Users] Using the abatron to debug an image in flash
@ 2003-08-08 12:06 Mark Doherty
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Doherty @ 2003-08-08 12:06 UTC (permalink / raw)
  To: u-boot

Wolfgang, 

I've rebuilt u-boot using ELDK 2.0 and found that the problem doesn't exist,
I suspect that the combination of the MV toolchain and ELDK toolchain is a
bad idea, lession well and truely learned.

Thanks for your assistance.

Mark.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [U-Boot-Users] Using the abatron to debug an image in flash
@ 2003-08-08  8:33 Mark Doherty
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Doherty @ 2003-08-08  8:33 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang, 
> > 
> > $ ppc-linux-gdb
> 
> Is this really how you called GDB?
It is indeed.
> 
> > GNU gdb 5.1.1
> 
> Where did you get this GDB from?
> 
This version of gdb is actually the version you pointed me to a few weeks
ago when I asked about debugging start.S, it does the same with  the MVL
toolchain as well so I suspect that maybe I've broken something. 

<snip>
This is probably a known problem. If you like, you can  try  out  our
latest  patches;  you  can  find  a  test version of our cross GDB at
ftp://ftp.denx.de/pub/tmp/ppc-linux-gdb - don't  forget  to  set  the
CROSS_COMPILE  environment  variable  as  needed (= ppc_82xx- in your
case) as with all our ELDK tools.
<snip>

As you illustrated, it should work, I think I'll take a look at what happens
on our ep8260s. 

thanks

Mark.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [U-Boot-Users] Using the abatron to debug an image in flash
@ 2003-08-07 15:41 Mark Doherty
  2003-08-07 16:32 ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Doherty @ 2003-08-07 15:41 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang, 

> Accessing normal static variables should be  no  problem.  It's  just
> initialized  data  pointers  which  need  manual relocation. I try to
> avoid this data type whenever possible, or we need to relocate it. If
> you find unrelocated initialized pointers please let me know.
> 
> But accessing the variables itself should work just fine  -  if  they
> are pointers, they will just contain unrelocated addresses.
> 

I have loaded the symbol file as mentioned previously, however to my 
unexperienced eye it appears that some of the symbols for the static 
variables have not been loaded where I would have expected ...

$ ppc-linux-gdb
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux".
(gdb) bdi
0xff000100 in ?? ()
(gdb) ram
add symbol table from file "u-boot" at
        .text_addr = 0x7fc0000
(gdb) info address rtx
Symbol "rtx" is static storage at address 0xff0312d8.
(gdb)

In the unlikely case you are not aware rtx is defined in 
cpu/mpc8260/ether_fcc.c as ...

<snip>
/*
 * FCC Ethernet Tx and Rx buffer descriptors.
 * Provide for Double Buffering
 * Note: PKTBUFSRX is defined in net.h
 */

typedef volatile struct rtxbd {
    cbd_t rxbd[PKTBUFSRX];
    cbd_t txbd[TX_BUF_CNT];
} RTXBD;

/*  Good news: the FCC supports external BDs! */
#ifdef __GNUC__
static RTXBD rtx __attribute__ ((aligned(8)));
#else
#error "rtx must be 64-bit aligned"
#endif
<snip>

Is this what you would normally expect? When I scan the assembler the code 
uses the correct address, it appears that the gdb however is a bit lost.

Best wishes,

Mark.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [U-Boot-Users] Using the abatron to debug an image in flash
@ 2003-08-07 10:39 Mark Doherty
  2003-08-07 11:45 ` Detlev Zundel
  2003-08-07 12:30 ` Wolfgang Denk
  0 siblings, 2 replies; 10+ messages in thread
From: Mark Doherty @ 2003-08-07 10:39 UTC (permalink / raw)
  To: u-boot

Hi, 

Apologies for asking what I suspect is a very simple problem, I am
attempting 
to debug u-boot after relocation and have followed the simple instructions 
previously posted on this mailing-list, however I am having difficulty in 
getting the abatron to do as it is told!

First up is the target section of the bdi2000 config file :

[TARGET]
CPUTYPE	8260
BDIMODE	AGENT
STARTUP	RESET
JTAGCLOCK	0
BOOTADDR 	0x00000100
;WORKSPACE	0x00000000
BREAKMODE	HARD
STEPMODE 	HWBP
;VECTOR	CATCH
;DCACHE	NOFLUSH
;MMU		XLAT 0xC0000000
;PTBASE	0x000000F0

I'd like to be able to step through the eth_init routine and I am invoking
it 
through a tftpboot command on the console. A trace from gdb illustrates my 
problem, (note that I have some shortcuts programmed into my .gdbinit
routine 
to set the $pc and to load the symbol file). When the program has loaded
into 
RAM I stop the debugger (hence the SIGSTOP) to insert my breakpoint, for
some 
reason I have problems if I attempt to insert the breakpoint before the code

is in RAM (?).

$ ppc-linux-gdb
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux".
(gdb) bdi
0x00000100 in ?? ()
(gdb) resethi
(gdb) ram
add symbol table from file "u-boot" at
        .text_addr = 0x7fc0000
(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
0x07fdbb18 in serial_getc () at serial_scc.c:242
242             while (rbdf->cbd_sc & BD_SC_EMPTY)
(gdb) b eth_init
Breakpoint 1 at 0x7fdc278: file ether_fcc.c, line 201.
(gdb) c
Continuing.

Breakpoint 1, eth_init (bis=0x7fa0220) at ether_fcc.c:201
201         volatile cpm8260_t *cp = &(immr->im_cpm);
(gdb) step
227         rxIdx = 0;
(gdb) step
198     {
(gdb) step
212         immr->im_cpmux.cmx_uar = 0;
(gdb) step
228         txIdx = 0;
(gdb) step
212         immr->im_cpmux.cmx_uar = 0;
(gdb) step
221         immr->im_fcc[CONFIG_ETHER_INDEX-1].fcc_fpsmr = CFG_FCC_PSMR | 
FCC_PSMR_ENCRC;
(gdb) step
213         immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & 
~CFG_CMXFCR_MASK) |
(gdb) step
221         immr->im_fcc[CONFIG_ETHER_INDEX-1].fcc_fpsmr = CFG_FCC_PSMR | 
FCC_PSMR_ENCRC;
(gdb) step
227         rxIdx = 0;
(gdb) step
201         volatile cpm8260_t *cp = &(immr->im_cpm);
(gdb) step
213         immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & 
~CFG_CMXFCR_MASK) |
(gdb) step
228         txIdx = 0;
(gdb) step
213         immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & 
~CFG_CMXFCR_MASK) |
(gdb)

As you can see the code appears to jump around aimlessly, though the program

still appears to run ok. Just to finish off I am able to configure the ram 
such that I can debug the application in ram up to the point where
relocation 
occurs so I am fairly confident in my SDRAM setup.

Any thoughts or comments welcome, 

thanks

Mark.

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

end of thread, other threads:[~2003-08-08 12:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-07 15:00 [U-Boot-Users] Using the abatron to debug an image in flash Mark Doherty
2003-08-07 15:22 ` Wolfgang Denk
2003-08-07 15:23 ` Detlev Zundel
  -- strict thread matches above, loose matches on Subject: below --
2003-08-08 12:06 Mark Doherty
2003-08-08  8:33 Mark Doherty
2003-08-07 15:41 Mark Doherty
2003-08-07 16:32 ` Wolfgang Denk
2003-08-07 10:39 Mark Doherty
2003-08-07 11:45 ` Detlev Zundel
2003-08-07 12:30 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox