

This tutorial assumes you have Eclipse and the esp-idf set-up on Ubuntu 20.04.01 LTS. Debugging allows single stepping through your code, adding breakpoints and examining the contents of registers.īesides the rich debugging, programming over JTAG can also speed up development as the JTAG interface can be as fast as 20MHz as opposed to the serial download at a typical 460,800 bps. In addition to the UART Bootloader, the ESP32 can also be programmed and debugged via the JTAG interface. In short, to debug programs compiled by Mingw-w64 toolchain, use the mingw64 gdb.Developing ESP32 code by iteratively downloading code to your target via esptool can become laborious for anything but the smallest of projects. Moreover, it can only debug programs compiled for msys systems. So it'll only run on msys systems, which means you'll have to invoke it from inside the Msys2 shell (Otherwise it won't find the cygwin.dll and won't perform properly, if it does at all). The Msys2 gdb, on the other hand, has target and host set up to be x86_64-pc-msys. So it runs on Windows system and debugs programs compiled by Mingw-w64 toolchain. The mingw64 gdb has both target and host set up to be x86_64-w64-mingw32. So you can compile gcc/gdb to run on Windows system and compile/debug programs for Linux system. These GNU tools have compilation arguments called host and target. For simplicity, we'll concern ourselves only with gcc and gdb.īoth gcc and gdb has cross platform versions, so you can be on Linux/Windows and compile C programs for Windows/Linux.

You can use those to (kind of) build and debug programs for other platforms. So, is there a way I can set the source-code directory to Windows-style in MSYS2 for a session? Or maybe I can set the source-code directory to MSYS2-style when building the project? Native shell doesn't work well with my gdb config, which was built for my Linux environment and uses gef. I cannot use the gdb from the native Windows shell. f/projects/neovim.įor some personal reasons, I have to use the gdb from MSYS2 shell.

So I'm almost certain the problem is MSYS2 using unix filesytem, e.g. I ran gdb from a native shell (pwsh), from the MSYS2/MINGW64 bin directory, and from there I can see the source-code listing. The list command tells me the filename and linenumber but not the actual code. So, now when I invoke gdb from inside MSYS2 shell, most things work perfectly, except the source-code listing. # in MSYS2, but we cannot build inside the MSYS2 shell.Īnd since it was built from outside the MSYS2 shell, the debug info in the executable is set to native Windows filesystem, e.g. # MSYS2, this allows using all the dependencies and tools available # These are native MinGW builds, but they use the toolchain inside But the build script forces me to build it from a normal shell (cmd/pwsh). I built neovim with MSYS2 MINGW64 compiler.
