rust-embedded/discovery

Chapter 05: Cannot see source code when starting gdb

noiseOnTheNet opened this issue · 4 comments

I tried to execute the code in GDB on Manjaro.
Compilation completes successfully and gdb-multiarch is installed
When I launch the gdb it writes:

Reading symbols from target/thumbv6m-none-eabi/debug/led-roulette...

so I guess it should be working.
It connects with "target remote :1337" but looks like it does not find symbols

Remote debugging using :1337
0xffffffff in ?? ()

When I try to use "list src" TUI writes "[No source available]"
Any suggestion?

The led-roulette elf file is not in 05-led-roulette folder, it's in microbit floder

\discovery\microbit> arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/led-roulette

Fixed in #520

I just downloaded the latest commit and still have the same problem.

Any ideas? I completely recompiled the binary by deleting the build directories

I tried with both paths: using symlink and with the two upper directories ../../

BTW
my GDB process writes

Remote debugging using :1337
0xffffffff in ?? ()

instead of what the book says.

The microbit embed process writes the following messages: are they suggesting you anything? Looks like some of the messages from GDB are not understood

    WARN probe_rs_gdb_server::worker > WORKING qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-tagging+;xmlRegisters=i386
    WARN probe_rs_gdb_server::worker > WORKING vMustReplyEmpty
    WARN probe_rs_gdb_server::worker > WORKING Hg0
    WARN probe_rs_gdb_server::worker > Unknown command: 'Hg0'
    WARN probe_rs_gdb_server::worker > WORKING qTStatus
    WARN probe_rs_gdb_server::worker > Unknown command: 'qTStatus'
    WARN probe_rs_gdb_server::worker > WORKING ?
    WARN probe_rs_gdb_server::worker > WORKING qfThreadInfo
    WARN probe_rs_gdb_server::worker > Unknown command: 'qfThreadInfo'
    WARN probe_rs_gdb_server::worker > WORKING qL1200000000000000000
    WARN probe_rs_gdb_server::worker > Unknown command: 'qL1200000000000000000'
    WARN probe_rs_gdb_server::worker > WORKING Hc-1
    WARN probe_rs_gdb_server::worker > Unknown command: 'Hc-1'
    WARN probe_rs_gdb_server::worker > WORKING qC
    WARN probe_rs_gdb_server::worker > Unknown command: 'qC'
    WARN probe_rs_gdb_server::worker > WORKING qAttached
    WARN probe_rs_gdb_server::worker > WORKING qOffsets
    WARN probe_rs_gdb_server::worker > Unknown command: 'qOffsets'
    WARN probe_rs_gdb_server::worker > WORKING g
    WARN probe_rs_gdb_server::worker > WORKING p8
    WARN probe_rs_gdb_server::worker > WORKING qL1200000000000000000
    WARN probe_rs_gdb_server::worker > Unknown command: 'qL1200000000000000000'
    WARN probe_rs_gdb_server::worker > WORKING qXfer:memory-map:read::0,1000
    WARN probe_rs_gdb_server::worker > WORKING qSymbol::
    WARN probe_rs_gdb_server::worker > Unknown command: 'qSymbol::'

Not sure about the noise you get after setting the debug target to port 1337, but I fixed this by using 'continue' after setting the breakpoint on main. After issuing 'continue' use 'layout src'.