[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [microblaze-uclinux] Source level debug for Microblaze in Xilinx FPGA.



Hi Leonid,

I am using EDK 8.1, but my source code and build environment is on Fedora 5
machine (2.6.15-1.2054_FC5) with microblaze-elf-tools-20060213 toolchain.

Since my preference is command line interface, I don't usually use the
graphic interface.  I thought I tried it once, and it appeared to work the
same.  Maybe my memory is playing tricks on me.

Below is a sample log of my debug session.  I can list the source code, set
break points on routine name, step thru source code, and display both local
and global variables.

BTW, you are correct about "-symbols=u-boot.map".  I tried with and without
it, in both cases I can source debug my code without problem.  


[celia@projectserver uboot-mch.i2cmux]$ mb-gdb -nw -symbols=u-boot.map
u-boot
GNU gdb 5.3Xilinx EDK 8.1 Build EDK_I.17
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=i686-pc-linux-gnu --target=microblaze"...
(gdb) target remote 192.168.2.1:1234
Remote debugging using 192.168.2.1:1234
0x00004050 in ?? ()
(gdb) set $pc=0x2f000000
(gdb) list flash_protect
warning: Source file is more recent than executable.

42       * If necessary you have to map the second bank at lower addresses.
43       */
44      void
45      flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
46      {
47              ulong b_end = info->start[0] + info->size - 1;  /* bank end
address */
48              short s_end = info->sector_count - 1;   /* index of last
sector */
49              int i;
50
51              debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n",
(gdb) break flash_protect
Breakpoint 1 at 0x2f010460: file flash.c, line 48.
(gdb) cont
Continuing.

Breakpoint 1, flash_protect (flag=1, from=676593664, to=676724735,
    info=0x2f01b564) at flash.c:48
48              short s_end = info->sector_count - 1;   /* index of last
sector */
(gdb) s
46      {
(gdb) s
flash_protect (flag=1, from=676593664, to=676724735, info=0x2f01b564)
    at flash.c:47
47              ulong b_end = info->start[0] + info->size - 1;  /* bank end
address */
(gdb) s
48              short s_end = info->sector_count - 1;   /* index of last
sector */
(gdb) s
46      {
(gdb)
(gdb) info frame
Stack level 0, frame at 0x2ffffd80:
 rpc = 0x2f01047c in flash_protect (flash.c:47); saved rpc 0x2f009144
 called by frame at 0x2ffffd80
 source language c.
 Arglist at 0x2ffffd80, args: flag=1, from=676593664, to=676724735,
    info=0x2f01b564
 Locals at 0x2ffffd80, Previous frame's sp in r1
(gdb) info srgs
Undefined info command: "srgs".  Try "help info".
(gdb) info args
flag = 1
from = 676593664
to = 676724735
info = (flash_info_t *) 0x2f01b564
(gdb)



Best Regards
Celia 

 


-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of Leonid
Sent: Wednesday, February 07, 2007 11:13 PM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: RE: [microblaze-uclinux] Source level debug for Microblaze in
Xilinx FPGA.

On Monday, February 05, 2007 9:58 PM Celia Lee wrote:
> This is how I usually invoke mb-gdb for uboot:
> mb-gdb -nw -symbols=u-boot.map u-boot

> -nw option is not necessary. 

Celia, I've tried the same from cygwin shell of EDK (I use 8.1). I also
used the following command to connect to XMD where same u-boot ELF file
has been downloaded:

target remote localhost:1234

BTW, if I don't use -nw option, it runs graphical debugger from EDK,
which doesn't show source at all (Assembly only). From another side,
"-symbols=u-boot.map" doesn't make any difference - I tried both with
and without it.

In the first place, it doesn't show sources, though it provides lines in
the code so it's reasonably simple to see where we are, keeping source
open in some editor:

serial_getc () at serial_xuartlite.c:72
72      serial_xuartlite.c: No such file or directory.
        in serial_xuartlite.c
(gdb) list
67      in serial_xuartlite.c
(gdb) b main_loop
Breakpoint 1 at 0x23fc5638: file main.c, line 383.
(gdb) c
Continuing.

However after arriving to breakpoint next command makes GDB stall:

Breakpoint 1, main_loop () at main.c:383
383     main.c: No such file or directory.
        in main.c
(gdb) n
warning: Remote failure reply: E01

I also tried to use gdb from petalinux distribution, ruinning on real
Linux machine (remote target IP won't be localhost anymore). I could see
source all right, but same hang problem while trying "next" after
breakpoint. I thought it's some networking issue, but on local host
happens exactly the same...

What EDK version are you using?

Best Regards
Leonid.
 

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/