Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 05: Cannot see source code when starting gdb #511

Open
noiseOnTheNet opened this issue Feb 19, 2023 · 4 comments
Open

Chapter 05: Cannot see source code when starting gdb #511

noiseOnTheNet opened this issue Feb 19, 2023 · 4 comments

Comments

@noiseOnTheNet
Copy link

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?

@dunmengjun
Copy link

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

bors bot added a commit that referenced this issue Mar 30, 2023
520: Add a note regarding `target` dir location r=eldruin a=arr-ee

Closes #270, #495, #511.

Shout out to `@mike2ykme` for the original PR, not sure if I should mess with commit metadata to add credit.

Co-authored-by: Max Barnash <[email protected]>
@eldruin
Copy link
Member

eldruin commented Mar 30, 2023

Fixed in #520

@eldruin eldruin closed this as completed Mar 30, 2023
@noiseOnTheNet
Copy link
Author

noiseOnTheNet commented Apr 1, 2023

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::'

@eldruin eldruin reopened this Apr 3, 2023
@nocommentsgood
Copy link

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants