[ECOS] RE: ctrl-c in GDB

Vikas K. Prasad vikas.prasad@ittiam.com
Thu Sep 30 10:08:00 GMT 2004


Thank you. I built  a small program (with eCos) (using the
standard libs) and downloaded it using redboot (built with
stubs). Redboot is built @ 0x4000000 and program is loaded
at 0x8000. The  program  is  simple  (only led on off in a
while loop). I am able  to  step  and debug as shown below
but ^C does not work. Any clues  regarding the port that I
have done.

Now that I have eliminated eCos, (only redboot and a small
pgm working fine, if left to itself)  I  hope you can help
me get closer to the ^c problem.

(gdb) load test.elf
0x04002ffc in ?? ()
Loading section .text, size 0x8c lma 0x8000
Start address 0x8000, load size 140
Transfer rate: 1120 bits in <1 sec, 140 bytes/write.
(gdb) b main
Breakpoint 1 at 0x8010: file test.c, line 4.
(gdb) c

Breakpoint 1, main () at test.c:4
4               unsigned int i = 1;
(gdb) n
7           unsigned int *led = (unsigned int*)0x20000008;
(gdb) n
11                      *led = i;
(gdb) n
12                      i <<= 1;
(gdb) c

< Upon a ^c - This is what happens.>
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y


-----Original Message-----
From: Nick Garnett [mailto:nickg@ecoscentric.com]
Sent: Thursday, September 30, 2004 2:20 PM
To: Vikas K. Prasad
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] RE: ctrl-c in GDB

"Vikas K. Prasad" <vikas.prasad@ittiam.com> writes:

> Nick,
> Thank you for giving me the direction. Here is what happens
> when I try to put the break point in 'start()'.
> (gdb) b *0x4100190
> Breakpoint 1 at 0x4100190
> (gdb) c
> Continuing.
> Breakpoint 1, 0x04100190 in start ()
> (gdb) s
> Single stepping until exit from function start,
> which has no line number information.
> >From this, I am doubting if the code generation is proper.

As Andrew points out, this is assembly code. You need to use the "si"
command to step through one instruction at a time. 

> Here is a snap shot of target.ld file. There is lots of
> stuff generated at 0 (where my SRAM is mapped) and the
> usual stuff at 0x4100000 (SDRAM from where I am running
> eCos). Please help me on this. I am not getting
> sufficient info to generate proper target.ld.

According to your initial message you are running on the
Excalibur/ARM922T. I suggest you make sure that everything is working
with the standard memory layout first before making changes. Bear in
mind that RedBoot will have set up the MMU to remap things to
different virtual addresses from the physical ones before your RAM
application is loaded.

Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts

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

More information about the Ecos-discuss mailing list