From: Paul F. <fer...@gm...> - 2015-05-02 14:04:49
|
Hey Torsten, On Sat, May 02, 2015 at 03:29:29PM +0200, To...@Ro... wrote: > I try to reset the board and set a breakpoint at main.cpp:5 within my .gdbinit: > > target remote localhost:3333 I recommend to always use "extended-remote" instead of "remote". This way you'll get access to "start" and "run" commands which are very useful. > monitor reset Here you tell OpenOCD "reset the target and let it run" > symbol /Users/todi/ebtks/build/source/ebtks.elf You could have omitted this if you start gdb like this: arm-none-eabi-gdb ebtks.elf > break main.cpp:5 Too late, the target's already running. > Now, when I start the debugger: I get already some warnings: That's all fine. > When I try to start the program, I get an other warning and the program doesn’t stop: > > (gdb) c > Continuing. > Note: automatically using hardware breakpoints for read-only addresses. > WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt. Yes, because the target is already running. Were you using "reset halt" instead of "reset", it would work better. > When I interrupt the program, I end up in the startup code provided by ST: > > ^C > Program received signal SIGINT, Interrupt. > LoopFillZerobss () at /Users/todi/ebtks/source/startup_stm32l152xe.s:116 > 116 bx lr I'm not sure what happens when newlib program exits main, so can't tell you why you might be ending up here. > I can set a breakpoint at main.cpp:11 and can single step through > the code and see changing variables (with the same warnings as > above). If I try to set a breakpoint at main.cpp:5 or main.cpp:7, > than the debugger doesn’t stop at all. If you compile with optimisation enabled, debugging usually becomes funnier, but one can get used to it. HTH -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |