microsoft / MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
818 stars 219 forks source link

GDB and Executable: load file.elf in GDB impossible #1274

Open TomasDresler opened 2 years ago

TomasDresler commented 2 years ago

Dears, I am trying to debug STM32 project in Visual Studio Pro 2019 using stm32-gdb-server from STM32CubeIDE. So far so good, however I'd like to automate loading the .elf file into the target MCU. This raises few questions or suggestions:

The debug starts with Debug.MIDebugLaunch /Executable: /OptionsFile:, but it doesn't pass the executable filename to GDB itself to guarantee that a 'load file.elf' command can be launched, followed by 'monitor reset'. It could be added to GDB arguments via MIDebuggerArgs, only if the OptionsFile content was parsed and some strings replaced.

I suggest to introduce a macro $(Executable) and replace its content in the options file content, when launching the debug process, incl. path separator adjustments.