0

I'm trying to debug a Raspberry Pi Pico project using openOCD + Picoprobe. I go through the steps that appear to be correct to do all this from my Linux PC (the Get started with Pico and C++ guide is for the Raspberry Pi, but there are tutorials online for PC), but when trying to set breakpoints in gdb, it appears to be looking at a different file.
My steps are the following:
In a console, navigate to the openOCD folder and run:
sudo src/openocd -s tcl/ -f tcl/interface/picoprobe.cfg -f tcl/target/rp2040.cfg
I get only info messages, no errors, until it waits for the gdb to connect

Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections  

Then, in a different console, I navigate to what I want to debug, in this case the blink.c example. I stand inside the build folder with my .elf file and run

sudo gdb-multiarch blink.elf

    (gdb) target extended-remote localhost:3333
    (gdb) monitor reset init
    (gdb) break 15

where 15 is a relevant debuggable line. But the thing is, the breakpoints are said to be set in a different file:

Breakpoint 1 at 0x20000178: file ../../../../../../libgcc/config/arm/lib1funcs.S, line 1461

and then on, all breakpoints are also set there. Here's an example trying to set 3 different breakpoints:

(gdb) b 15
Breakpoint 1 at 0x20000178: file ../../../../../../libgcc/config/arm/lib1funcs.S, line 1461.
(gdb) b 16
Note: breakpoint 1 also set at pc 0x20000178.
Breakpoint 2 at 0x20000178: file ../../../../../../libgcc/config/arm/lib1funcs.S, line 1461.
(gdb) b 17
Note: breakpoints 1 and 2 also set at pc 0x20000178.
Breakpoint 3 at 0x20000178: file ../../../../../../libgcc/config/arm/lib1funcs.S, line 1461.

So that. I am totally lost on what's happening here. Could anyone point me to why this is happening, or what that file does?

Edit: Here's a pastebin of the code, to not clutter the post so much.
https://pastebin.com/pvGni6Fu
Lines 15, 16 and 17 have regular code that should be breakable.

5
  • Please edit your question and show the sourcecode where you want to set the breakpoint at line 15. I don't know what gdb considers as the file being debugged inthis situation. Assuming the line is in the file that contains the main function, I suggest to try something like break main run break 15
    – Bodo
    Jun 1 at 13:48
  • I've added the pastebin. Also, using break main or break main() produces the same line as using a numbered breakpoint, with the same file name. Jun 1 at 19:19
  • This code belongs into the question. Data on external servers may become unavailable. If you use break main and then run, does it break at the beginning of main()?
    – Bodo
    Jun 2 at 7:43
  • No, it never breaks no matter what method I use. Jun 2 at 22:23
  • Unfortunately I don't have a solution (yet). To make it easier for others, that might be able to help, you should edit your question and add all requested information, clarification or code to the question. Comments are for suggestions or to for asking for clarification, not for providing additional information. I suggest to show a [mre] including all commands you use to build and run/debug your program.
    – Bodo
    Jun 3 at 8:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.