Quantcast
Channel: User Jeremy - Stack Overflow
Viewing all articles
Browse latest Browse all 47

VSCode won't run batch file any more

$
0
0

I've been using VSCode on Windows for some years to debug Cortex-M microcontroller systems, using the cortex-debug extension and Arm's builds of the gcc development tools (including arm-none-eabi-gdb.exe).

For all that time I've used the "gdbPath" setting in launch.json to specify a small batch file to launch the above GDB executable.

Recently this has stopped working. Now it silently fails to launch the batch file. (And I do mean silent - the error messages and logs emitted by VSCode in this case are woeful, and in no way indicate that it simply hasn't run the batch file.)

Indeed, some experimentation using SysInternals ProcMon shows that if the filename extension is '.bat' or '.cmd', VSCode isn't even attempting to find the specified file, let alone run it. Only with extension '.exe' does it bother to search for the file.

So, my questions are:

(a) Is this due to a change in VSCode, or in cortex-debug, or perhaps even in Windows itself?

(b) Is there a workaround?

ADDED: Minimal Reproducible Example

  • Set up VSCode to debug a Cortex-M target with the cortex-debug extension, e.g. as per these instructions.
  • Add the entry "gdbPath": "${workspaceFolder}/gdb.exe"to the launch.json file.
  • Using a monitoring tool such as SysInternals Process Monitor, observe file system activity when starting debugging in VSCode (press F5).
  • Note that code.exe searches for (nonexistent) gdb.exe in the workspace directory.
  • Note also that VSCode pops up a message box "Could not start GDB process".
  • Change gdbPath to refer to gdb.bat instead of gdb.exe, and try debugging again.
  • Note that code.exe does not search for (nonexistent) gdb.bat at all.
  • Note also that VSCode does not show any error message box.

Viewing all articles
Browse latest Browse all 47

Trending Articles