2016-11-14 04:50 AM
Hello,
I'm trying to start debugging of the program on my bare-metal board but program runs somewhere in arm-none-eabi libraries without source code (particularly in __divsi3 or __aeabi_dadd) and I cannot catch it with debugger in any reasonable point with source code. I tried to set break-points at Reset_Handler in startup_stm32f051x8.S, at SystemInit() in system_stm32f0xx.c from CMSIS, at main.c() - nothing works, after I start debugging - program runs continuously and if I stop it with debugger and do several steps then debugger says:Single stepping until exit from function __divsi3,which has no line number information.Single stepping until exit from function __aeabi_dadd,which has no line number information.Debugger shows me message No source available for ''(gdb[3].proc[42000].threadGroup[i1],gdb[3].proc[42000].OSthread[1]).thread[1].frame[0]''but I can stop program execution and do steps. As I understand this message telling me that the program is running in libs without source code available.So the question is how to debug in this situation and let program reach at least SystemInit() or main()?Also the question - can GDB stop the CPU in ResetHandler in start-up file? I'm thinking can program run somewhere in interrupt handler... but all interrupts from peripherals I use like USART should be disabled before peripheral configuration in main() (I use standard generated by Cube code) and program can't reach this.About HW and IDE:stm32f051C8 controller, Eclipse + GCC + arm-none-eabi lib + GDBIn the project I use startup_stm32f051x8.S and STM HAL drivers from STM Cube (project generated by Cube and adopted to IDE described above)I exclude basic HW problems because CPU is running and can be halted by HW debugger.2016-11-14 07:24 AM
Well, seems this is problem of IDE configuration or memory initialization. I simplified the program as much as I can and now it goes to absolutely different places. Eclipse highlights strings of code but it jumps absolutely wrong. Seems that the memory absolutely corrupted or GDB highlights wrong c-strings during execution. Also there is following output from GDB:
This GDB was configured as ''--host=i686-w64-mingw32 --target=arm-none-eabi''.Type ''show configuration'' for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type ''help''.Type ''apropos word'' to search for commands related to ''word''.Warning: the current language does not match this frame.Program received signal SIGTRAP, Trace/breakpoint trap.I'll continue to dig in GDB direction2016-11-14 07:57 AM
Problem solved. That were wrong GDB settings, I didn't configure device in GDB server. I thought it will get it from eclipse project settings but it didn't and GDB server was running with unknown device type making mess, trying to access not existing memory and so on. Now everything is fine.