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

The Remote attach to process command has been reversed between Linux and Darwin #11328

Closed
rahiakil opened this issue Aug 16, 2023 · 1 comment · Fixed by #11329
Closed

The Remote attach to process command has been reversed between Linux and Darwin #11328

rahiakil opened this issue Aug 16, 2023 · 1 comment · Fixed by #11329
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available. regression A bug that didn't exist in a previous release
Milestone

Comments

@rahiakil
Copy link

Environment

  • OS and version:
  • VS Code:
  • C/C++ extension:
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version:

Bug Summary and Steps to Reproduce

Bug Summary:

Run a Linux container ( any Centos/RHEL/) and then run a program there from a Mac. When the debugger tries to attach, it will fail to attach because the attach commands have been switched. in the commit a7870fc

So the Darwin command is now getting run on Linux and that is causing the debugger to not attach

See attachtoprocess.ts

    return `${outerQuote}${shPrefix}sh -c ${innerQuote}uname && if [ ${parameterBegin}uname -o${parameterEnd} = ${escapedQuote}Toybox${escapedQuote} ] ; ` +
        `then ${PsProcessParser.psToyboxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Darwin${escapedQuote} ] ; ` +
        `then ${PsProcessParser.psLinuxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Linux${escapedQuote} ] ; ` +
        `then ${PsProcessParser.psDarwinCommand}; fi${innerQuote}${outerQuote}`;
}

This was the PR that made this issue
a7870fc

Debugger Configurations

"configurations": [
        {
            "name": "(lldb) modlog-Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "/Users/parag.paul/snc/modlog_reader/build/modlog_reader",
            "processId": "${command:pickRemoteProcess}",
            "MIMode": "gdb",
            "pipeTransport": {
                "pipeCwd": "${workspaceRoot}",
                "pipeProgram": "/Users/parag.paul/tembo/tembo/tools/docker_exec_last_container.sh",
                "pipeArgs": [
                    "sh", 
                    "-c"
                ],
                "debuggerPath": "/usr/bin/gdb"
            }
        },

Debugger Logs

No need for logs.

Other Extensions

No response

Additional Information

No response

@sean-mcmanus sean-mcmanus added this to the 1.17.3 milestone Aug 16, 2023
@michelleangela michelleangela added debugger regression A bug that didn't exist in a previous release labels Aug 16, 2023
@bobbrow bobbrow added fixed Check the Milestone for the release in which the fix is or will be available. bug labels Aug 17, 2023
@bobbrow
Copy link
Member

bobbrow commented Aug 17, 2023

version 1.17.3 was released and has a fix for this issue. Thanks again for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available. regression A bug that didn't exist in a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants