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

05-led-roulette GDB problem. #495

Closed
houshilifeng opened this issue Dec 5, 2022 · 4 comments
Closed

05-led-roulette GDB problem. #495

houshilifeng opened this issue Dec 5, 2022 · 4 comments

Comments

@houshilifeng
Copy link

When I am debugging as the book said and entered "target remote :1337" in the gdb mode, here is the outcome:
Remote debugging using :1337
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x00000100 in ?? ()
Have I done something wrong?
Waiting for answers.
Thanks.

@Jzow
Copy link
Contributor

Jzow commented Dec 7, 2022

My judgment is that your console gdb is not loaded into the device target.

As stated in the book, you should select different devices according to the micro:bit version. In addition, the GDB command of cargo-embed is not very stable, and may not recognize all the commands sent to it by GDB

Is it convenient for you to send the shell command you entered?

@AlexanderRitter02
Copy link

AlexanderRitter02 commented Dec 9, 2022

Hope I'm not assuming too much, but I may be able to help.

Since I likely came across the same issue using the gdb command from the book, getting exactly the same output.
This happens if GDB doesn't find the executable.

Note that the section in the book is a bit unclear on which directory to switch to in the new shell:

Since cargo-embed is blocking our current shell we can simply open a new one and cd back into our project directory.

I initially assumed the "project directory" would be the same directory I ran cargo-embed in, e.g. microbit/src/05-led-roulette.
However for me, the program was compiled into microbit/target/thumbv7em-none-eabihf/debug/led-roulette.

Fixing this is very simple:

  1. In your debugging shell, go to the directory: discovery-master/microbit.
  2. Run the gdb command, e.g. gdb-multiarch target/thumbv7em-none-eabihf/debug/led-roulette
  3. Make sure GDB says something like:
    Reading symbols from target/thumbv7em-none-eabihf/debug/led-roulette..., otherwise it doesn't make sense running the next commands.

If you still have issues, you can always just use the absolute path. Cargo embed will tell you where it places the file in the output with "Target: <path>".

@dilnozacs
Copy link

thanks @AlexanderRitter02 it worked!!

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

5 participants