[ECOS] Problem about using gdb which is started form redboot

叶晓晖 yexh@wireless.mdc.tsinghua.edu.cn
Fri Mar 21 11:03:00 GMT 2003


Hi,

I have done some test by your suggestion.

First, I try to set breakpoint at 0x40040, 0x4007c still use the ROM based redboot to boot the board, 
0x40040 is at the beginning of warm_reset, and 0x4007c is at the beginning of start,
if the downloading program is run, it must first encounter this tow breakpoint.
But it was no use, after downloading the file, still all function in arm-elf-gdb 
cannot respond, and there are no more information in console window except the downloading info.

Compare with the above, I use a simple GDB stub program in ROM, that is programme gdb_module.bin 
into ROM and use it to boot the board. I also set breakpoint at 0x40040, 0x4007c, and this time 
after downloading the program, it stop at the first breakpoint--0x40040, the below is some 
information show in the console window:

(gdb) break *0x40040 ---------------------break is setting breakpoint command in console window
Breakpoint 1 at 0x40040

(gdb) break *0x4007c
Breakpoint 2 at 0x4007c ------------------below is the loading information
0x1801718 in ?? ()
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.

Breakpoint 1, 0x40040 in warm_reset () ------------stop at 0x40040 after downloading

Breakpoint 2, 0x4007c in start () 
cyg_libc_invoke_main

Breakpoint 3, main () at hello.c:8

So why when using the ROM based GDB stub, it can stop at the 0x40040 successfully, when useing 
the ROM based redboot, it cannot? 
I notice that in source code hal/.../common/.../src/stubrom/stubrom.c, in cyg_start function 
the codes are: 
for(;;) breakpoint();
and in redboot/.../src/main.c, in cyg_start function the corresponding codes are: 
#ifdef HAL_ARCH_PROGRAM_NEW_STACK
                HAL_ARCH_PROGRAM_NEW_STACK(breakpoint);
#else
                breakpoint();  // Get GDB stubs started, with a proper environment, etc.
#endif
for in my configuration of redboot, HAL_ARCH_PROGRAM_NEW_STACK is not defined, 
the breakpoint(); is in the use. Although before the gdb starting, both stay at the code 
breakpoint();, there is quite different after elf codes downloading into the RAM. 
What's the reason? 

Does after the redboot entering in GDB stub mode, it works in another mechanics different form 
a simple ROM based GDB stub, especially deal with the serial port? 

Hope the answer. 

Thanks

Xiaohui Ye



More information about the Ecos-discuss mailing list