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


叶晓晖 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


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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