Closed Kwizatz closed 4 years ago
The error is:
Unable to start debugging.
Program path 'C:\\Code\\AeonGUI\\mingw64\\bin\\OpenGLDemo.exe' is missing or invalid.
GDB failed with message: You can't do that when your target is `exec'
This may occur if the process's executable was changed after the process was started, such as when installing an update. Try re-launching the application or restarting the machine.
I just tested with MSYS2 x64 Ran:
pacman -Syu
pacman -Su gdb
pacman -Su gcc
and successfully debugged a simple program.
Couple of questions:
C:\\Code\\AeonGUI\\mingw64\\bin\\OpenGLDemo.exe
from the command line?Hi @WardenGnaw , Yes, the file exists and runs without issue provided that "C:/Code/AeonGUI/mingw64/bin;C:/msys64/mingw64/bin" is part of the path.
You can test this with my project, AeonGUI
clone it, move to the project root directory then run:
pacman -S --needed --noconfirm mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-python2 mingw-w64-x86_64-python2-pip flex bison mingw-w64-x86_64-libxml2 mingw-w64-x86_64-zlib mingw-w64-x86_64-libpng mingw-w64-x86_64-cairo mingw-w64-x86_64-v8
mkdir mingw64
cd mingw64
cmake -G"MSYS Makefiles" ..
Then open the folder with vscode, you can build using the build task or from the terminal with make, then run debug on the OpenGLDemo debug target (it is the only one there)
Thanks for looking this up. 😁
I'm running into issues building the project:
C:\Users\user\Projects\AeonGUI\build>cmake -G\"MSYS Makefiles\" ..
-- Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY)
-- Could NOT find Freetype (missing: FREETYPE_LIBRARY) (found version "2.10.2")
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY) (found version "2.9.10")
-- Parser code will be generated from Flex and Bison code.
-- Build the 'update-parser-code' target if you want to update the pre-generated code.
-- Generating debug launch configuration for OpenGLDemo
-- Up-to-date: C:/Users/user/Projects/AeonGUI/build/share/aeongui/copyright
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FREETYPE_LIBRARY
linked by target "AeonGUI" in directory C:/Users/user/Projects/AeonGUI/core
LIBXML2_LIBRARY (ADVANCED)
linked by target "AeonGUI" in directory C:/Users/user/Projects/AeonGUI/core
OPENGL_gl_LIBRARY (ADVANCED)
linked by target "OpenGLDemo" in directory C:/Users/user/Projects/AeonGUI/demos/OpenGL
OPENGL_glu_LIBRARY (ADVANCED)
linked by target "OpenGLDemo" in directory C:/Users/user/Projects/AeonGUI/demos/OpenGL
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
Are there additional packages that I need to install?
Are there additional packages that I need to install?
It does seem so, sorry:
pacman -S --needed --noconfirm mingw-w64-x86_64-libxml2 mingw-w64-x86_64-freetype
should take care of libxml2 and freetype, but the missing opengl lib is strange, it should be part of the winapi package, try installing freeglut which should have it as a dependency:
pacman -S --needed --noconfirm mingw-w64-x86_64-freeglut
Ok, apparently:
$ pacman -Qo /mingw64/x86_64-w64-mingw32/lib/libopengl32.a
/mingw64/x86_64-w64-mingw32/lib/libopengl32.a is owned by mingw-w64-x86_64-crt-git 8.0.0.5966.f5da805f-1
so the package to install to get OpenGL is mingw-w64-x86_64-crt-git? 🤔I never had to manually install it. weird.
Edit: It may be because you installed gcc (which is msys gcc) and not mingw-w64-x86_64-gcc? on that note make sure you install mingw-w64-x86_64-gdb as well.
I can also repro this with a simple hello world app.
What I can find so far is that the GDB 9.2 may be missing the load
command.
If your GDB does not have a load command, attempting to execute it gets the error message "You can't do that when your target is ..."
Running -file-exec-file ./bin/OpenGLDemo.exe
works, but -file-symbol-file ./bin/OpenGLDemo.exe
causes the "You can't do that when your target is 'exec'
Without loading the symbols, the debugger does not have the necessary information to show variables, set breakpoints, or show call stack.
This is with:
mingw-w64-x86_64-gcc-10.2.0-3
mingw-w64-x86_64-gdb-9.2-2
Repro steps:
Create a simple hello world app.
Compile g++ -g main.cpp -o a.exe
Debug with gdb --intepreter=mi
and in GDB
-file-exec-and-symbols ./a.exe
^error,msg="You can't do that when your target is `exec'"
This would be a bug for GDB. https://sourceware.org/bugzilla/
I thought that could be a possibility, I'll see what I can find out.
@WardenGnaw seems like it is a known issue and is being fixed at https://github.com/msys2/MINGW-packages/issues/7004, so I am closing this.
Thank you very much for your help!
Type: Debugger
Describe the bug
Version: 1.49.1 (user setup) Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf Date: 2020-09-16T23:27:51.792Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.19041
C/C++ Extension Version: v1.0.1
Other extensions you installed (and if the issue persists after disabling them):
code --install-extension 13xforever.language-x86-64-assembly code --install-extension austin.code-gnu-global code --install-extension bierner.markdown-preview-github-styles code --install-extension cheshirekow.cmake-format code --install-extension cschlosser.doxdocgen code --install-extension DavidAnson.vscode-markdownlint code --install-extension dracula-theme.theme-dracula code --install-extension foxundermoon.shell-format code --install-extension gerane.Theme-Batman code --install-extension GitHub.vscode-pull-request-github code --install-extension jeff-hykin.better-cpp-syntax code --install-extension mads-hartmann.bash-ide-vscode code --install-extension melak47.ninja-syntax code --install-extension ms-dotnettools.csharp code --install-extension ms-python.python code --install-extension ms-vscode-remote.remote-containers code --install-extension ms-vscode-remote.remote-ssh code --install-extension ms-vscode-remote.remote-ssh-edit code --install-extension ms-vscode-remote.remote-wsl code --install-extension ms-vscode-remote.vscode-remote-extensionpack code --install-extension ms-vscode.cmake-tools code --install-extension ms-vscode.cpptools code --install-extension ms-vscode.cpptools-extension-pack code --install-extension ms-vscode.cpptools-themes code --install-extension ms-vsliveshare.vsliveshare code --install-extension ms-vsliveshare.vsliveshare-audio code --install-extension ms-vsonline.vsonline code --install-extension npclaudiu.vscode-gn code --install-extension spadin.remote-x11-ssh code --install-extension twxs.cmake code --install-extension v8-torque.vscode-torque code --install-extension yzhang.markdown-all-in-one
Issue does persist after disabling all c++ related extensions
When running a debug session the process fails showing a message box saying that the executable is missing or invalid, but the file is there and I can run it manually from the shell.
This used to work 2 weeks ago and for a very long time before.
To Reproduce Please include a code sample and
launch.json
configuration.Steps to reproduce the behavior:
Additional context If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your
launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.