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

Remove escapes causing malformed scripts #906

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Remove escapes causing malformed scripts #906

merged 1 commit into from
Aug 15, 2019

Commits on Aug 6, 2019

  1. Remove escapes causing malformed scripts

    As mentioned is [this](microsoft/vscode-cpptools#3711) issue and others, the backslash- and doublequote-escape in this command is causing malformed scripts that will fail to run. This makes it impossible to attach to processes as gdb can't elevate it's permissions.
    
    The current implementation generates this file:
    ```bash
    echo $$ > /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 ; cd /home/jenkins/code/misc/c++_node_grpc_test/server ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-yfl0fzxv.e1q /tmp/Microsoft-MIEngine-Out-vbd9a98g.bjb /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 /tmp/Microsoft-MIEngine-Cmd-2md1t9rp.9ee' EXIT ; read -n 1 -p \"Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]\" yn; if [[ ! $yn =~ ^[Yy]$ ]] ; then exit 0; fi; /usr/bin/pkexec /sbin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-yfl0fzxv.e1q > /tmp/Microsoft-MIEngine-Out-vbd9a98g.bjb & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 ; wait $pid; 
    ```
    
    The proposed change will generate this file, which is valid:
    ```
    echo $$ > /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 ; cd /home/jenkins/code/misc/c++_node_grpc_test/server ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-yfl0fzxv.e1q /tmp/Microsoft-MIEngine-Out-vbd9a98g.bjb /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 /tmp/Microsoft-MIEngine-Cmd-2md1t9rp.9ee' EXIT ; read -n 1 -p "Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]" yn; if [[ ! $yn =~ ^[Yy]$ ]] ; then exit 0; fi; /usr/bin/pkexec /sbin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-yfl0fzxv.e1q > /tmp/Microsoft-MIEngine-Out-vbd9a98g.bjb & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-hp0n9b2a.oc4 ; wait $pid; 
    ```
    
    Disregard the file-system paths in the provided examples as they are only relevant to my file-system.
    ChristianJacobsen authored Aug 6, 2019
    Configuration menu
    Copy the full SHA
    7cb046e View commit details
    Browse the repository at this point in the history