Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausing debugging uses incorrect path to kill #10124

Closed
expipiplus1 opened this issue Nov 8, 2022 · 2 comments · Fixed by microsoft/MIEngine#1373
Closed

Pausing debugging uses incorrect path to kill #10124

expipiplus1 opened this issue Nov 8, 2022 · 2 comments · Fixed by microsoft/MIEngine#1373

Comments

@expipiplus1
Copy link

Environment

  • OS and version: Linux (NixOS unstable)
  • VS Code: 1.71.2
  • C/C++ extension: vscode-cpptools
  • GDB / LLDB version: gdb 12.1

Bug Summary and Steps to Reproduce

Bug Summary:

On a machine with kill in $PATH but not in /bin/:

  • Start debugging a long-running program using gdb

  • Press the "pause" button to pause execution

    image

  • Observe that something somewhere is trying to use /bin/kill rather than finding kill in $PATH

    Stopping due to fatal error: Win32Exception: An error occurred trying to start process '/bin/kill' with working directory '/home/e/my-project'. No such file or directory
    

Debugger Configurations

{
    "version": "0.2.0",
    "configurations": [
      {
        "name": "C/C++: debug",
        "type": "cppdbg",
        "request": "launch",
        "program": "a.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "gdb",
        "logging": { "engineLogging": true },
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ],
        "preLaunchTask": "make debug"
      }
    ]
  }

Debugger Logs

...
1: (857) <--exec-continue
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (857) ->^running\n"},"seq":481}
1: (857) ->^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (857) ->*running,thread-id=\"all\"\n"},"seq":483}
1: (857) ->*running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (857) ->(gdb)\n"},"seq":485}
1: (857) ->(gdb)
<--   C (pause-12): {"command":"pause","arguments":{"threadId":68743},"type":"request","seq":12}
Stopping due to fatal error: Win32Exception: An error occurred trying to start process '/bin/kill' with working directory '/home/e/my-project'. No such file or directory


### Other Extensions

_No response_

### Additional Information

_No response_
@WardenGnaw
Copy link
Member

Thank you for reporting this issue.

Notes:
This code can be found at https://github.com/microsoft/MIEngine/blob/fd190c03bab7f332e522aa2bfb2f8b755206c787/src/MICore/UnixUtilities.cs#L262

@sean-mcmanus
Copy link
Collaborator

Your fix is available with 1.13.5 (pre-release, release candidate): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants