Forum Replies Created
-
AuthorPosts
-
supportKeymaster
Hi,
Thanks for confirming your license. The ESP32 builds are managed by the ESP-IDF build scripts, that indeed do not define separate debug/release macros on the C/C++ level.
You can work around it by adding the following line to the top-level CMakeLists.txt file of your project, before the first include() statement:
add_compile_definitions(${CMAKE_BUILD_TYPE})
supportKeymasterHi,
Thanks very much for pointing it out. We usually try to keep regular expressions and search strings in a separate file (%VISUALGDB_DIR%\Rules\RegularExpressions.xml) to facilitate exactly this kind of hotpatching, but the “(WSL)” rule wasn’t stored there yet.
Feel free to try this build: VisualGDB-6.0.4.5016.msi. We have updated the rule to match both new and old name, moved it to RegularExpression.xml (RegularExpressionCollection/Other/WSLInterfaceName), so it can be easily edited in case it changes again.
supportKeymasterSorry, we are not aware of any specific setting that would interfere with it. If one project works distinctly different from another one, you can try comparing the project files side-by-side and merging differences between them to see at which point the behavior changes.
supportKeymasterHi,
No problem, please find the answers below:
- You can use the View->Other Windows->VisualGDB Diagnostics Console window to see the exact low-level commands issued by VisualGDB.
- You can uncheck the “Automatically test the connection” checkbox at the bottom of the target selection page in the wizard. VisualGDB will still verify that the toolchain works (i.e. produces something), but won’t try to deploy it.
- You can do that fairly straight-forward with the Custom edition – change the GDB host to Windows, specify OpenOCD as the custom gdb stub, and add a custom pre-debug action that will copy the file (just “cp $(TargetPath) /mnt/c/deployment/dir”). If you are using a lower edition, you can upgrade it here. If you do not want to upgrade, you can create wrapper scripts on the Linux subsystem that would run commands on Windows (e.g. by running an SSH server on Windows) so from the VisualGDB’s point of view, everything still runs on the build machine, but it could be worthwhile to use the Custom edition that was specifically designed to handle such setups.
supportKeymasterHi,
Please let us know the email address associated with your license key so that we could link it to your forum account.
November 12, 2023 at 22:21 in reply to: RELEASE and DEBUG macros not defined CubeMX Advacned Wizard #34966supportKeymasterThanks, we have linked your license to your forum account.
We have rechecked the DEBUG/RELEASE flags for CMake projects and indeed they got broken when we added an option to select between size and speed optimization.
We have fixed it on our side and will include it in the next Beta. As a workaround until then, you can simply patch the C:\Program Files (x86)\Sysprogs\VisualGDB\CMake\embedded\root.cmake file as shown below:
if("${VISUALGDB_TOOLCHAIN_SUBTYPE}" STREQUAL "GCC") - set(CMAKE_C_FLAGS_DEBUG "-g3 -O0") + set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) #Add "OPTIMIZE_FOR_SIZE=1" to Extra CMake Configuration Variables in VisualGDB Project Properties in order to optimize the release build for size, rather than speed. if(OPTIMIZE_FOR_SIZE) - set(CMAKE_C_FLAGS_RELEASE "-g3 -Os") + set(CMAKE_C_FLAGS_RELEASE "-g3 -Os -DRELEASE") else() - set(CMAKE_C_FLAGS_RELEASE "-g3 -O3") + set(CMAKE_C_FLAGS_RELEASE "-g3 -O3 -DRELEASE") endif()
supportKeymasterHi,
Sure, this is already supported via the Visual Watch plugins. You can use the Debug->Visual Watch command to display arrays as graphs or images.
You can also create your own Visual Watch plugins to cover the cases not supported directly. E.g. you can fork our ImageWatch plugin and replace the version in “C:\Program Files (x86)\Sysprogs\VisualGDB\VisualWatchProviders” file, or place it under a different name to the same directory, or under %LOCALAPPDATA%\VisualGDB\LiveWatchProviders.
supportKeymasterHi,
You should be able to get it working by using the 3-machine setup shown here. You would need to import the custom RISC-V toolchains as a Linux-to-Linux cross-toolchain, disable the automatic deployment tests (you can configure to deploy the project to the same machine), and then override the debug setup.
As far as VisualGDB will be concerned, it will be a Linux-to-Linux project with a completely custom deployment and debugging sequence, so IntelliSense, build error messages and everything else related to build will work out-of-the-box.
To get debugging working, you would need to decide where do you want to run OpenOCD (or another similar program) and where to run GDB. E.g. you can add a custom pre-debug action to copy the built executable to the Windows machine, and then run both OpenOCD and GDB there. Or you could run OpenOCD on the Windows machine, and connect the gdb running on the Linux machine to it.
You can find some pointers and examples on this page; if you need further help, please make sure you can debug everything via command line, and share the details about your manual debugging setup, and we will help you configure VisualGDB to replicate it in the IDE.
supportKeymasterHi,
It mostly depends on what the device vendors do. VisualGDB supports FreeRTOS and ThreadX out-of-the-box (e.g. you can create a project from the wizards) because most device vendors provide FreeRTOS-based and ThreadX-based samples with their SDK, so all we need to do on our side is wrap these samples. If we see more device vendors provide out-of-the-box samples for Zephyr, we will certainly integrate them into VisualGDB.
So far, out of all major vendors, Zephyr is used by the nRFConnect framework, and VisualGDB supports it well. You can create projects via the wizards, VisualGDB will show the thread state via Zephyr thread plugin, etc.
If you want to use Zephyr with devices where the vendors don’t provide the samples, you can always setup the project manually. As far as VisualGDB is concerned, it’s just another CMake-based project, so you will be able to build and debug it as usual. You may need to adjust the thread plugin to accommodate a different stack layout, but that’s precisely the reason we publish sources for our RTOS integration plugins – so you can tweak them for use cases that are not directly supported out-of-the-box.
November 10, 2023 at 07:27 in reply to: VisualGDB trial not setting up ESP32 environment correctly? #34957supportKeymasterHi,
VisualGDB does not update the system-level variables in order to avoid interfering with other tools. Instead, it sets them for just the process it’s launching to configure and build the project.
You can actually dump the configuration and build command lines to batch files, that show all the environment set by VisualGDB, and can be executed manually in order to simplify troubleshooting things. See this page for details.
If changing the variable globally fixed the project, it could have been hardcoded somewhere else (e.g. by editing the Python scripts) and the value set by VisualGDB was conflicting with it. If in doubt, we always suggest doing a clean toolchain installation, using a clean Python environment and a clean ESP-IDF checkouts. We test them before releasing our toolchains, so they should work just fine out-of-the-box.
supportKeymasterHi,
Thanks for reporting this, looks like a bug on our side. Please try this build: VisualGDB-6.0.4.5003.msi
supportKeymasterHi,
Looks like something about your project breaks the linker. As far as VisualGDB is concerned, it starts the build, sees the error message and reports it as expected.
You can try enabling verbose mode, getting the exact gcc/linker command lines, and asking in the binutils mailing lists if you need further help.
supportKeymasterThanks, the assemblies on your machine do match our test setup, however, it looks like you are using a couple of extra VS extensions that could be interfering with the WPF.
Please try disabling all other extensions via the Extensions->Manage Extensions command in Visual Studio. If it solves the problem, please try checking if enabling a particular extension triggers the problem, so that we could try installing it on our side and reproducing this.
Edit: for what it’s worth, you can try this build: VisualGDB-6.0.3.4994.msi. It has RemoteHostSelector.Mode renamed to RemoteHostSelector.HostSelectorMode, so if the old name was triggering some strange name collision, it should not happen anymore.
supportKeymasterThanks for confirming this. It looks like a rather strange assembly load issue. Please try this build: VisualGDB-6.0.3.4993.msi
If the problem persists, please click Help->About VisualGDB while holding the Shift key. The About window will show one extra button called “Troubleshoot Assembly Errors”.
Once you click on it, VisualGDB will generate a detailed report showing possible conflicts. Please attach the report together with the updated call stack from the error message, and we will look further into it.
supportKeymasterHi,
Based on a quick look, the CCOUNT is indeed not mapped to memory, so reading it would involve patching the ESP32 OpenOCD to allow reading it via special command.
If you would like to get it working, we can offer 2 options:
- You can try convincing Espressif to add an OpenOCD monitor command for reading CCOUNT (it should be runnable via gdb), or implementing it yourself. If you can get it working, we can help you configure VisualGDB to use it, as long as you have an active VisualGDB license.
- If we see sufficient interest in this feature from other paid users, or if someone orders it as a custom feature, we can do the OpenOCD patching on our side. If you would like to get a quote for this as a custom feature, feel free to contact us via the support form.
-
AuthorPosts