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

Wokwi GDB VSCode launch not working #227

Open
OliverRhyme opened this issue Aug 2, 2024 · 5 comments
Open

Wokwi GDB VSCode launch not working #227

OliverRhyme opened this issue Aug 2, 2024 · 5 comments

Comments

@OliverRhyme
Copy link

Bug description

Running wokwi debugger via vscode does not work with error Unable to start debugging. The value of miDebuggerPath is invalid

  • Would you like to work on a fix? n

To Reproduce

Steps to reproduce the behavior:

prerequisites:

  • Setup wokwi vscode extension with license
  1. run cargo generate esp-rs/esp-idf-template cargo
  2. use these options
✔ 🤷   Which MCU to target? · esp32
✔ 🤷   Configure advanced template options? · true
✔ 🤷   Enable STD support? · true
✔ 🤷   ESP-IDF version (master = UNSTABLE) · v5.2
✔ 🤷   Configure project to use Dev Containers (VS Code and GitHub Codespaces)? · true
✔ 🤷   Configure project to support Wokwi simulation with Wokwi VS Code extension? · true
✔ 🤷   Add CI files for GitHub Action? · false
  1. open project in vscode
  2. reopen in dev container
  3. run cargo build
  4. run launch in vscode the "Wokwi GDB"

Expected behavior

Should be able to run wokwi gdb

Screenshots

N/A

Environment

  • OS: MacOS Sonoma
  • How did you install the environment: dev container

Additional context

@SergioGasquez
Copy link
Member

Hi! Since esp-12.2.0_20230208, gdb is no longer part of the official release that espup install, it now lives here so it needs to be separately downloaded and extracted on top of the current GCC toolchain location (/home/esp/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928 in the container).

That being said, I dont think we will work on fixing this at the moment, sorry.

@tomassebestik tomassebestik removed the bug label Sep 22, 2024
@Manu343726
Copy link

@SergioGasquez Hi,

I'm working on a no_std project using esp-generate targeting esp32, but since the template structure is practically the same I stumbled upon this same issue. I hope you can help me figure this out.

After seeing your comment I patched the .devcontainer Dockerfile to download and install xtensa-esp-elf-gdb alongside the esp toolchain already in the container/Dockerfile. After that, only the no-python variant of gdb seems to work (I have seen issues talking about gdb not picking the python libs included in the toolchain in the esp-binutils project so I'll ignore this for now).

So, if I launch the Wikwi simulator followed by pressing F5 to run the debugger it looks like gdb is able to attach to the simulator, but I get the error "Remote 'g' packet reply is too long. Expected X bytes, got Y" which the Wokwi docs state it's usually related to using a gdb for the wrong architecture.

While setting up the Dockerfile to download xtensa-esp-elf-gdb I found a bit confusing that the triple used for naming the gdb release packages did not include the 32 bit suffix while the releases of esp toolchain are named xtensa-esp32-elf. Maybe I am picking the wrong debugger after all?

Thank you.

@SergioGasquez
Copy link
Member

Maybe I am picking the wrong debugger after all?

You'll need to download: https://github.com/espressif/binutils-gdb/releases/tag/esp-gdb-v15.2_20241112 for your target, unzip it and point to $DOWNLOAD_FOLDER/bin/xtensa-esp32-elf-gdb

@Manu343726
Copy link

Yeah, I was asking because as I said esp project releases for esp32 target are named xtensa-esp32-elf but I don't see that in binutils-gdb releases, only xtensa-esp-elf. Is the xtensa-esp-elf gdb package the correct one for the esp32 target? (That is the one I picked).

@SergioGasquez
Copy link
Member

Is the xtensa-esp-elf gdb package the correct one for the esp32 target?

I think the correct one is xtensa-esp32-elf-gdb, but tbh I havent played with Wokwi debugging in a while and I might be wrong

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

No branches or pull requests

4 participants