This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem about using gdb which is started form redboot


Thanks for your reply.

The program is write in the main() function, and is a very simple standalone c program, 
the link library is the eCos_install generate by eCos configuration tool, the configuration is:
target: snds, template: minimal, and add with some libc packages.

First, I think it's not the problem of download. 
Because in the process of downloading the following information will upper in the console window:
Loading section .rom_vectors, size 0x40 lma 0x40000
Loading section .text, size 0x5898 lma 0x40040
Loading section .rodata, size 0x4bd lma 0x458d8
Loading section .data, size 0x534 lma 0x45d98
Start address 0x40040 , load size 25289
Transfer rate: 28901 bits/sec, 301 bytes/write.

The above shows download is correct, and Start address is right.  
In arm-elf-gdb I can see the downlonding codes is at the right place, from 0x40000, 
which is consistent with the link library. 
And from the redboot boot information, it show:
RAM: 0x00000000-0x00100000, 0x0002fd60-0x00100000 available
and when I load the bin type codes in redboot, 
I use the command: load -r -m xmodem -c 0 -b 0x40000,
then after download is finished, it shows in hyperteminal:
CRaw file loaded 0x00040000-0x000462cc, assumed entry at 0x00040000
xyzModem - CRC mode, 199(SOH)/0(STX)/0(CAN) packets, 3 retries
 
I also try to set breakpoint in cyg_start function in startup.cxx, but it cannot run to there. 
As in arm-elf-gdb, run command should first download the elf file and then run to the breakpoint 
setting in the programme, but in my operation after download the file, all function in arm-elf-gdb 
cannot respond, and there are no more information in console window except the downloading info.

When I substitude redboot with stub, the elf file can be downloaded and then it can run 
to the breakpoint setting in the main function, the infomation showed in console window is below:
Loading section .rom_vectors, size 0x40 lma 0x40000
Loading section .text, size 0x5898 lma 0x40040
Loading section .rodata, size 0x4bd lma 0x458d8
Loading section .data, size 0x534 lma 0x45d98
Start address 0x40040 , load size 25289
Transfer rate: 25289 bits/sec, 301 bytes/write.
cyg_libc_invoke_main
Breakpoint 3, main () at hello.c:8

So, I don't think it is the problem of the serial port and the program. Have all you 
ever encountered similar problem? I know something is wrong but I cannot know which, 
Can you give me more hint?

Thanks,

Xiaohui Ye

----- Original Message ----- 
From: "Jonathan Larmour" <jifl at eCosCentric dot com>
To: "叶晓晖" <yexh at wireless dot mdc dot tsinghua dot edu dot cn>
Cc: <ecos-discuss at sources dot redhat dot com>
Sent: Thursday, March 20, 2003 7:13 PM
Subject: Re: [ECOS] Problem about using gdb which is started form redboot


> 叶晓晖 wrote:
> > Hi all,
> > 
> > I use ROM based redboot on snds board and want to start arm-elf-gdb tool from redboot,
> >  then debug the app with the gdb environment, but it cannot work.
> > 
> > The detail is:
> > First the board is connected by serial port using hyperterminal and was started with redboot. 
> > After I enter "$",
> 
> You don't need to enter $ manually to start GDB mode - GDB will do that
> for you.
> 
> > disconnect the hyperterminal and start arm-elf-gdb tool,
> > it can connect with the board via serial port(using the same port that redboot just connect) 
> > and it can download elf file into the RAM,  
> > but when download process is completed, it cannot start with the downloading programme. 
> > 
> > The programme is ok because it can run when I directly download it with "load" command and
> >  then run it with "go" command in redboot. And when I use ROM based stub,
> >  it also can run and debug in arm-elf-gdb.
> 
> Does the program you're downloading definitely report the correct start
> address when you load it via GDB?
> 
> Are you _sure_ the program isn't running? Perhaps there is some issue with
> your port or configuration which means the program _output_ isn't getting
> seen by GDB, but the program isn't running.
> 
> Before you use "continue" in GDB, try setting a breakpoint yourself
> somewhere early in the startup, for example:
> b cyg_start
> or
> b cyg_hal_invoke_constructors
> 
> or something even earlier, depending on the specifics of your HAL.
> 
> Assuming this is an eCos program of course.
> 
> > I notice that if I substitude 
> > breakpoint();
> > with
> > for( ; ; ) breakpoint();
> > in source codes above,then after completely downloading the elf file, the gdb will generate interrupt 
> > and say: Program received signal SIGTRAP, Trace/breakpoint trap.
> 
> That implies breakpoint() is returning. Is this an eCos program or a
> newlib-based "standalone" program.
> 
> Jifl
> -- 
> eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
> --[ "You can complain because roses have thorns, or you ]--
> --[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
> 
> 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]