|
From: Daniel K. <kow...@gm...> - 2016-05-25 00:43:12
|
On Tue, 24 May 2016 19:11:28 +0300 Paul Fertser <fer...@gm...> wrote: > Hello, > > On Tue, May 24, 2016 at 04:29:01PM +0200, Daniel Kowalski wrote: > > I tried debugging this with gdb (arm-none-eabi version). GDB > > attaches to openocd correctly, I can setup breakpoints, and program > > halts in correct spot, but I cannot get any stack trace - it just > > prints (gdb) bt > > #0 0x08000ca0 in Reset_Handler () > > Please share the complete debugging session output and the > corresponding openocd log. > > And, BTW, you can program easily from within GDB by using "load". > (I'm sending this second time, with shortened log (it was over 3MB - sorry about that, and did not pass througs list server). I cut out the boring part (flashing) and left only log after gdb connection) Here is sample debug session, openocd -d3 log is attached as file as it grew big (). I launched gdb, connected to already running openocd, halted target, set breakpoint on xfree function (could by any func, does not matter), typed continue, then I verified that CPU is running (it responds to UART commands), I called command which uses xfree function, CPU halted on breakpoint, but openocd and gdb missed this event completely (d3 log has something about setting breakpoint arount 47520 line, but there is nothing about halting on it) (plus it stopped responding to ctrl+c interrupt requests, I had to kill openocd and gdb session) here are gdb commands: [dk@lapek firmware] + descriptors$ arm-none-eabi-gdb build/MinSizeRel/firmware.elf GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-pc-linux-gnu --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"... Reading symbols from build/MinSizeRel/firmware.elf...done. (gdb) target extended-remote localhost:3333 Remote debugging using localhost:3333 0x08000ca0 in Reset_Handler () (gdb) monitor reset halt adapter speed: 300 kHz target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000ca0 msp: 0x20007ffc (gdb) b xfree Breakpoint 1 at 0x8007c20: file /home/dk/nasypy/nasypy-B003-mcu-mainboard/firmware/src/syscalls.c, line 65. (gdb) cont Continuing. Note: automatically using hardware breakpoints for read-only addresses. ^C ^CThe target is not responding to interrupt requests. Stop debugging it? (y or n) n ^C^CThe target is not responding to interrupt requests. Stop debugging it? (y or n) y Disconnected from target. (gdb) and my openocd script: telnet_port 4444 gdb_port 3333 # Jlink # source [find interface/jlink.cfg] # Jtag Lock Pick source [find interface/ftdi/jtag-lock-pick_tiny_2.cfg] # serial of debug adapter #ftdi_serial FTYHIMUW # transport select jtag transport select swd # JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz adapter_khz 1000 adapter_nsrst_delay 100 # only for JTAG # jtag_ntrst_delay 100 source [find target/stm32l1.cfg] program build/MinSizeRel/firmware.elf verify reset Daniel -- () ascii ribbon campaign - against html e-mail /\ - against proprietary attachments |