microsoft / microsoft/vscode-cpptools

Empty string in args throws IndexOutOfRangeException since v1.1.0

Abierto
#6,522 1 comentario 5 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug debugger
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

Type: Debugger

Since version 1.1.0 having empty strings in the args array will give an IndexOutOfRangeException when trying to Start Debugging. This worked fine in version 1.0.1.
Issue: In launch.json "args":[ "a","","","b"]
Workaround: add extra escaped quotes in empty argument "args":[ "a","\"\"","\"\"","b"],

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.51.1
  • C/C++ Extension Version: 1.1.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

Running the debugger will give a popup with title "Visual Studio Code" and error:

Unable to start debugging. Internal error in MIEngine. Exception of type 'System.IndexOutOfRangeException' was thrown.

at MICore.LaunchOptions.QuoteArgument(String arg)
at MICore.LaunchOptions.ParseArguments(IEnumerable`1 arguments, Boolean quoteArguments)
at MICore.LaunchOptions.InitializeLaunchOptions(LaunchOptions launch)
at MICore.LocalLaunchOptions.CreateFromJson(JObject parsedOptions)
at MICore.LaunchOptions.GetInstance(HostConfigurationStore configStore, String exePath, String args, String dir, String options, Boolean noDebug, IDeviceAppLauncherEventCallback eventCallback, TargetEngine targetEngine, Logger logger)
at Microsoft.MIDebugEngine.AD7Engine.Microsoft.VisualStudio.Debugger.Interop.IDebugEngineLaunch2.LaunchSuspended(String pszServer, IDebugPort2 port, String exe, String args, String dir, String env, String options, enum_LAUNCH_FLAGS launchFlags, UInt32 hStdInput, UInt32 hStdOutput, UInt32 hStdError, IDebugEventCallback2 ad7Callback, IDebugProcess2& process)

To Reproduce

{
      "name": "classic 1",
      "type": "cppdbg",
      "request": "launch", 
      "program": "${fileDirname}/${fileBasenameNoExtension}",
      "args":[ "a","","","b"],
      "stopAtEntry": true,
      "cwd": "${workspaceFolder}",
      "externalConsole": true,
      "MIMode": "gdb",
    }

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el fallo con el array de args de launch.json mostrado en el issue e inspecciona los frames de la pila reportados MICore.LaunchOptions.QuoteArgument y ParseArguments. Compara el comportamiento con las versiones 1.0.1 y 1.1.1; se considera completado cuando los argumentos vacíos inician la depuración sin una IndexOutOfRangeException y se conservan los valores de argumentos existentes.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, vscode
Área
devtools
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.