vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

[macOS Catalina] Unable to debug with 'externalConsole': true

Open sourav-dey opened this issue 4 years ago • 49 comments

Type: Debugger OS: MacOS Version: 10.15.3 Debugger: LLDB cpptools version: Version 0.27.0-insiders2

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/AmazLeet.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb",
            "logging": {
                "trace": true,
                "traceResponse": true,
                "engineLogging": true
            }
        }
    ]
}

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "Build with Clang",
        "type": "shell",
        "command": "clang++",
        "args": [
          "-std=c++17",
          "-stdlib=libc++",
          "AmazLeet.cpp",
          "-o",
          "AmazLeet.out",
          "--debug"
        ],
        "group": {
          "kind": "build",
          "isDefault": true
        }
      }
    ]
  }

Logs:

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (160) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n"},"seq":2}
1: (160) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (173) LaunchOptions  ExePath='/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out'\n"},"seq":4}
1: (173) LaunchOptions  ExePath='/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (173) LaunchOptions  WorkingDirectory='/Users/sodey/CLionProjects/amazon-leet'\n"},"seq":6}
1: (173) LaunchOptions  WorkingDirectory='/Users/sodey/CLionProjects/amazon-leet'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions  ExeArguments=''\n"},"seq":8}
1: (174) LaunchOptions  ExeArguments=''
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions  MIMode='lldb'\n"},"seq":10}
1: (174) LaunchOptions  MIMode='lldb'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions  MIDebuggerPath='/Users/sodey/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/debugAdapters/lldb-mi/bin/lldb-mi'\n"},"seq":12}
1: (174) LaunchOptions  MIDebuggerPath='/Users/sodey/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/debugAdapters/lldb-mi/bin/lldb-mi'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions  WaitDynamicLibLoad='false'\n"},"seq":14}
1: (174) LaunchOptions  WaitDynamicLibLoad='false'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions  ExternalConsole='true'\n"},"seq":16}
1: (174) LaunchOptions  ExternalConsole='true'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (174) LaunchOptions>\n"},"seq":18}
1: (174) LaunchOptions>
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (175) LaunchOptions</LocalLaunchOptions>\n"},"seq":20}
1: (175) LaunchOptions</LocalLaunchOptions>
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (306) Starting: \"/Users/sodey/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/debugAdapters/lldb-mi/bin/lldb-mi\" --interpreter=mi\n"},"seq":22}
1: (306) Starting: "/Users/sodey/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/debugAdapters/lldb-mi/bin/lldb-mi" --interpreter=mi
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (328) DebuggerPid=41251\n"},"seq":24}
1: (328) DebuggerPid=41251
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (773) ->(gdb)\n"},"seq":26}
1: (773) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (792) <-1001-interpreter-exec console \"version\"\n"},"seq":28}
1: (792) <-1001-interpreter-exec console "version"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (794) ->~\"lldb-1100.0.30.12\\nApple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)\\n\"\n"},"seq":30}
1: (794) ->~"lldb-1100.0.30.12\nApple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (796) ->(gdb)\n"},"seq":34}
1: (796) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (798) 1001: elapsed time 7\n"},"seq":36}
1: (798) 1001: elapsed time 7
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (801) <-1002-gdb-set auto-solib-add on\n"},"seq":38}
1: (801) <-1002-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (801) ->1002^done\n"},"seq":40}
1: (801) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (802) ->(gdb)\n"},"seq":42}
1: (802) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (802) 1002: elapsed time 0\n"},"seq":44}
1: (802) 1002: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (802) <-1003-gdb-set solib-search-path \"/Users/sodey/CLionProjects/amazon-leet:\"\n"},"seq":46}
1: (802) <-1003-gdb-set solib-search-path "/Users/sodey/CLionProjects/amazon-leet:"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (803) ->1003^done\n"},"seq":48}
1: (803) ->1003^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (803) 1003: elapsed time 0\n"},"seq":50}
1: (803) 1003: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (803) ->(gdb)\n"},"seq":52}
1: (803) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (803) <-1004-environment-cd /Users/sodey/CLionProjects/amazon-leet\n"},"seq":54}
1: (803) <-1004-environment-cd /Users/sodey/CLionProjects/amazon-leet
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (805) ->1004^done,path=\"/Users/sodey/CLionProjects/amazon-leet\"\n"},"seq":56}
1: (805) ->1004^done,path="/Users/sodey/CLionProjects/amazon-leet"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (805) ->(gdb)\n"},"seq":58}
1: (805) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (807) 1004: elapsed time 3\n"},"seq":60}
1: (807) 1004: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (807) <-1005-gdb-set new-console on\n"},"seq":62}
1: (807) <-1005-gdb-set new-console on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (808) ->1005^done\n"},"seq":64}
1: (808) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (808) 1005: elapsed time 0\n"},"seq":66}
1: (808) 1005: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (808) ->(gdb)\n"},"seq":68}
1: (808) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (808) <-1006-file-exec-and-symbols /Users/sodey/CLionProjects/amazon-leet/AmazLeet.out\n"},"seq":70}
1: (808) <-1006-file-exec-and-symbols /Users/sodey/CLionProjects/amazon-leet/AmazLeet.out
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1245) ->1006^done\n"},"seq":72}
1: (1245) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1246) 1006: elapsed time 437\n"},"seq":74}
1: (1246) 1006: elapsed time 437
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1246) ->(gdb)\n"},"seq":76}
1: (1246) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1246) <-1007-interpreter-exec console \"platform status\"\n"},"seq":78}
1: (1246) <-1007-interpreter-exec console "platform status"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1246) ->=library-loaded,id=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out\",target-name=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out\",host-name=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out\",symbols-loaded=\"1\",symbols-path=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out.dSYM/Contents/Resources/DWARF/AmazLeet.out\",loaded_addr=\"-\",size=\"409600\"\n"},"seq":80}
1: (1246) ->=library-loaded,id="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out",target-name="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out",host-name="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out",symbols-loaded="1",symbols-path="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out.dSYM/Contents/Resources/DWARF/AmazLeet.out",loaded_addr="-",size="409600"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1247) ->~\"  Platform: host\\n    Triple: x86_64h-apple-macosx\\nOS Version: 10.15.3 (19D76)\\n    Kernel: Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64\\n  Hostname: 127.0.0.1\\nWorkingDir: /Users/sodey/CLionProjects/amazon-leet\\n\"\n"},"seq":82}
1: (1247) ->~"  Platform: host\n    Triple: x86_64h-apple-macosx\nOS Version: 10.15.3 (19D76)\n    Kernel: Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64\n  Hostname: 127.0.0.1\nWorkingDir: /Users/sodey/CLionProjects/amazon-leet\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1248) ->1007^done\n"},"seq":84}
1: (1248) ->1007^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1248) ->(gdb)\n"},"seq":86}
1: (1248) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1249) 1007: elapsed time 3\n"},"seq":88}
1: (1249) 1007: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1250) <-1008-break-insert -f main\n"},"seq":90}
1: (1250) <-1008-break-insert -f main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1301) ->1008^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100012672\",func=\"main\",file=\"AmazLeet.cpp\",fullname=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.cpp\",line=\"2700\",pending=[\"main\"],times=\"0\",original-location=\"main\"}\n"},"seq":92}
1: (1301) ->1008^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100012672",func="main",file="AmazLeet.cpp",fullname="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.cpp",line="2700",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1301) ->(gdb)\n"},"seq":94}
1: (1301) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1302) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100012672\",func=\"main\",file=\"AmazLeet.cpp\",fullname=\"/Users/sodey/CLionProjects/amazon-leet/AmazLeet.cpp\",line=\"2700\",pending=[\"main\"],times=\"0\",original-location=\"main\"}\n"},"seq":96}
1: (1302) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100012672",func="main",file="AmazLeet.cpp",fullname="/Users/sodey/CLionProjects/amazon-leet/AmazLeet.cpp",line="2700",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1302) ->(gdb)\n"},"seq":98}
1: (1302) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1304) 1008: elapsed time 54\n"},"seq":100}
1: (1304) 1008: elapsed time 54
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"16.5.10303.1","VS.Diagnostics.Debugger.HostVersion":"16.5.10303.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":1215,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0,"VS.Diagnostics.Debugger.MIMode":null}},"seq":106}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":108}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":110}
<--   C (setFunctionBreakpoints-3): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
--> R (setFunctionBreakpoints-3): {"type":"response","request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":113}
<--   C (setExceptionBreakpoints-4): {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":4}
--> R (setExceptionBreakpoints-4): {"type":"response","request_seq":4,"success":true,"command":"setExceptionBreakpoints","body":{},"seq":116}
<--   C (configurationDone-5): {"command":"configurationDone","type":"request","seq":5}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1504) Send Event AD7LoadCompleteEvent\n"},"seq":120}
1: (1504) Send Event AD7LoadCompleteEvent
--> R (configurationDone-5): {"type":"response","request_seq":5,"success":true,"command":"configurationDone","body":{},"seq":119}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Warning: Debuggee TargetArchitecture not detected, assuming x86_64.\n"},"seq":123}
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
<--   C (threads-6): {"command":"threads","type":"request","seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1508) <-1009-exec-run\n"},"seq":126}
1: (1508) <-1009-exec-run
--> R (threads-6): {"type":"response","request_seq":6,"success":true,"command":"threads","body":{"threads":[]},"seq":128}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6832) ->1009^error,msg=\"process exited with status -1 (Error 1)\"\n"},"seq":130}
1: (6832) ->1009^error,msg="process exited with status -1 (Error 1)"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6833) ->(gdb)\n"},"seq":132}
1: (6833) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6833) 1009: elapsed time 5324\n"},"seq":134}
1: (6833) 1009: elapsed time 5324
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6845) Send Event AD7MessageEvent\n"},"seq":136}
1: (6845) Send Event AD7MessageEvent
--> E (output): {"type":"event","event":"output","body":{"category":"stderr","output":"ERROR: Unable to start debugging. Unexpected LLDB output from command \"-exec-run\". process exited with status -1 (Error 1)\n"},"seq":138}
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (Error 1)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6852) <--gdb-exit\n"},"seq":140}
1: (6852) <--gdb-exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6852) ->^exit\n"},"seq":142}
1: (6852) ->^exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6852) ->=thread-group-exited,id=\"i1\"\n"},"seq":144}
1: (6852) ->=thread-group-exited,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6853) ->(gdb)\n"},"seq":146}
1: (6853) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6854) <-logout\n"},"seq":148}
1: (6854) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6862) Send Event AD7ProgramDestroyEvent\n"},"seq":150}
1: (6862) Send Event AD7ProgramDestroyEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"The program '/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out' has exited with code 42 (0x0000002a).\r\n\n"},"seq":152}
The program '/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out' has exited with code 42 (0x0000002a).

--> E (exited): {"type":"event","event":"exited","body":{"exitCode":42},"seq":154}
--> E (terminated): {"type":"event","event":"terminated","body":{},"seq":156}
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"16.5.10303.1","VS.Diagnostics.Debugger.HostVersion":"16.5.10303.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0}},"seq":158}
<--   C (disconnect-7): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":7}
--> R (disconnect-7): {"type":"response","request_seq":7,"success":true,"command":"disconnect","body":{},"seq":161}

Opens up a external terminal window with log:

Launching: '/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out'
Working directory: '/Users/sodey/CLionProjects/amazon-leet'
1 arguments:
argv[0] = '/Users/sodey/CLionProjects/amazon-leet/AmazLeet.out'
/bin/bash: line 1: 41603 Trace/BPT trap: 5       arch -arch x86_64 /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/darwin-debug --unix-socket=/tmp/kkx3OS --arch=x86_64 --working-dir /Users/sodey/CLionProjects/amazon-leet --disable-aslr --env=OS_ACTIVITY_DT_MODE=enable -- /Users/sodey/CLionProjects/amazon-leet/AmazLeet.out
Process exited with status 133
So long and thanks for all the fish.
  -- Douglas Adams

[Process completed]

Followed: https://code.visualstudio.com/docs/cpp/config-clang-mac Now I need to run twice or thrice sometimes for the debugger to work properly with the same code.

sourav-dey avatar Mar 07 '20 01:03 sourav-dey

Can you run DevToolsSecurity -status in your terminal, and what does it output?

WardenGnaw avatar Mar 07 '20 01:03 WardenGnaw

> DevToolsSecurity -status                                                                                                                                                                        
> Developer mode is currently disabled.

sourav-dey avatar Mar 07 '20 02:03 sourav-dey

Thank you!

Can you enable DevToolsSecurity? You can do that by running DevToolsSecurity -enable. There will be an elevated prompt.

Do you still encounter the issue when you start debugging after that?

WardenGnaw avatar Mar 07 '20 02:03 WardenGnaw

> sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer DevToolsSecurity -enable                                                                                                                   
> Password:
> Developer mode is now enabled.
> DevToolsSecurity -status                                                                                                                                                                        
> Developer mode is currently enabled.

Yes, I am still having the same issue.

sourav-dey avatar Mar 07 '20 02:03 sourav-dey

@sourav-dey Thanks for all the info. I will need to grab a new machine and see if I can reproduce this issue.

What version of XCode are you using?

WardenGnaw avatar Mar 10 '20 20:03 WardenGnaw

Cool, sure. I am using XCode Version 11.3.1 (11C504)

sourav-dey avatar Mar 10 '20 21:03 sourav-dey

From @lmapii

any news on this one? can't debug anymore :( Unable to start debugging. Unexpected LLDB output from command "-exec-run". Command 'exec-run'. Invalid process during debug session Developer mode is already enabled.

@WardenGnaw no, this was on mac os catalina 10.15.4. i'm with @Ulchie on this one - this seems to be a timing issue. i know how ridiculous this sounds but the problem disappeared at some point (i haven't changed anything in the installation). meaning the famous sentence "i didn't do anything" seems to apply :/

WardenGnaw avatar May 06 '20 16:05 WardenGnaw

From @peza8

Exact same issue as @lmapii

@WardenGnaw Experiencing issue on Catalina 10.15.2. Sadly haven't had the same luck as Imapii. Happy to do any tests you need @WardenGnaw .

WardenGnaw avatar May 06 '20 16:05 WardenGnaw

@peza8 Could you provide some additional info for me?

What version of VS Code are you using? Version of the C/C++ extension? Version of XCode you have installed? Also can you share the logs from the debug console when you add following to your launch.json?

"logging": {
   "engineLogging": true
}

WardenGnaw avatar May 06 '20 16:05 WardenGnaw

Hey @WardenGnaw , here's the info:

1. VSCode version: Version: 1.44.2 Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd Date: 2020-04-16T17:07:18.473Z (2 wks ago) Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Darwin x64 19.2.0

2. Version of the C/C++ extension: 0.27.1

3. Xcode version: 11.3.1

4. Logs are attached: VSCode terminal non-launch issue debug logs.txt

Other [potentially] useful info:

  • I build my project with CMake
  • Debugging without external terminal works perfectly
  • Debugging with lldb directly (using the lldb command in a terminal also works perfectly.
  • Your suggestion of CodeLLDB does work for me - super happy about that. Thanks.

peza8 avatar May 06 '20 18:05 peza8

@peza8 Your issue is that you are using miDebuggerArgs and it is treating the first argument as your executable.

(866) ->-file-exec-and-symbols "set" 1: (879) ->^error,msg="Command 'file-exec-and-symbols'. Target binary 'set' is invalid. error: unable to find executable for 'set'"

You will want to use setupCommands for set startup-with-shell enable

WardenGnaw avatar May 07 '20 00:05 WardenGnaw

@WardenGnaw - This does cause an external terminal window to open, but the application still doesn't run. Updated logs attached. VSCode terminal non-start issue debug logs.txt

peza8 avatar May 07 '20 04:05 peza8

@peza8 I think can repro this.

The issue seems to be when we have "externalConsole": true it seems to hang and do nothing.

Can you hit a breakpoint in your main function if you set "externalConsole": false?

WardenGnaw avatar May 07 '20 05:05 WardenGnaw

Yes, that what I tried to indicate in my second bullet of the section Other [potentially] useful info: in this message above.

With "externalConsole": false the debugger works perfectly => Can indeed hit breakpoint in main.

peza8 avatar May 07 '20 06:05 peza8

Do you also have the update where your default shell is now zsh?

WardenGnaw avatar May 08 '20 02:05 WardenGnaw

The VScode update? or Catalina? Which default setting are you referring to? @WardenGnaw ?

Issue title change 👍 +1

peza8 avatar May 08 '20 06:05 peza8

The macOS Catalina update where it defaults the Terminal App to zsh.

I am investigating what is causing -exec-run to hang and trying to find the differences. I have a machine running macOS Catalina and XCode using the latest C/C++ extension that does not have the update where the default shell is zsh and works with externalConsole: true.

When LLDB launches the external console, it uses an apple script that calls into bash. https://github.com/llvm/llvm-project/blob/f203100ebe22bf97a4268a562cdbef22d14db915/lldb/source/Host/macosx/objcxx/Host.mm#L154. But lldb-mi does not hang on -exec-run if commands are given directly via a terminal.

WardenGnaw avatar May 08 '20 07:05 WardenGnaw

The issue is when VSCode launches the debug adapter, then the debug adapter launches lldb-mi, then lldb-mi launches Terminal. There is a prompt that should appear, but somehow the DebugAdapter is not forwarding this permissions request.

Screen Shot 2020-05-08 at 7 17 25 PM The work around is to have VS Code launch the terminal once. You can do this by adding and running this tasks in your `tasks.json`:
{
  "label": "Open Terminal",
  "type": "shell",
  "command": "osascript -e 'tell application \"Terminal\"\ndo script \"echo hello\"\nend tell'",
  "problemMatcher": []
}

You can run this specific task using Command + Shift + p. Type Tasks and look for Tasks: Run Tasks then select Open Terminal.

Once you allow this permission, then the external console should appear when you debug.

WardenGnaw avatar May 09 '20 02:05 WardenGnaw

@WardenGnaw There is a typo in your task, there is an extra a before \nendtask that breaks osascript. Workaround worked for me, thanks.

omcnoe avatar May 10 '20 04:05 omcnoe

Workaround works! Well done and thank you @WardenGnaw !

peza8 avatar May 11 '20 04:05 peza8

so useful, thanks

wenxuankou avatar Jun 12 '20 09:06 wenxuankou

I'm running into what appears to be the same issue, but the workaround suggested by @WardenGnaw doesn't work for me.

I ran the "Open Terminal" task as suggested, and I got the prompt as expected:

image

image

However, when I start the debugging session, I just get two empty terminal windows and the debugger doesn't stop at the breakpoint:

image

launch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "gcc - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": true,
      "MIMode": "lldb",
      "preLaunchTask": "C/C++: gcc build active file",
      "logging": {
        "trace": true,
        "traceResponse": true,
        "engineLogging": true
      }
    }
  ]
}

tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "shell",
      "label": "C/C++: gcc build active file",
      "command": "/usr/bin/gcc",
      "args": [
        "-g",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${workspaceFolder}"
      },
      "problemMatcher": ["$gcc"],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

Here's the output from the debug console:

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (163) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n"},"seq":2}
1: (163) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (187) LaunchOptions  ExePath='/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1'\n"},"seq":4}
1: (187) LaunchOptions  ExePath='/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (187) LaunchOptions  WorkingDirectory='/Users/chris/Projects/k_and_r'\n"},"seq":6}
1: (187) LaunchOptions  WorkingDirectory='/Users/chris/Projects/k_and_r'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (187) LaunchOptions  ExeArguments=''\n"},"seq":8}
1: (187) LaunchOptions  ExeArguments=''
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (187) LaunchOptions  MIMode='lldb'\n"},"seq":10}
1: (187) LaunchOptions  MIMode='lldb'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (188) LaunchOptions  MIDebuggerPath='/Users/chris/.vscode/extensions/ms-vscode.cpptools-0.29.0-insiders/debugAdapters/lldb-mi/bin/lldb-mi'\n"},"seq":12}
1: (188) LaunchOptions  MIDebuggerPath='/Users/chris/.vscode/extensions/ms-vscode.cpptools-0.29.0-insiders/debugAdapters/lldb-mi/bin/lldb-mi'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (188) LaunchOptions  WaitDynamicLibLoad='false'\n"},"seq":14}
1: (188) LaunchOptions  WaitDynamicLibLoad='false'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (188) LaunchOptions  ExternalConsole='true'\n"},"seq":16}
1: (188) LaunchOptions  ExternalConsole='true'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (188) LaunchOptions>\n"},"seq":18}
1: (188) LaunchOptions>
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (188) LaunchOptions</LocalLaunchOptions>\n"},"seq":20}
1: (188) LaunchOptions</LocalLaunchOptions>
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (283) Starting: \"/Users/chris/.vscode/extensions/ms-vscode.cpptools-0.29.0-insiders/debugAdapters/lldb-mi/bin/lldb-mi\" --interpreter=mi\n"},"seq":22}
1: (283) Starting: "/Users/chris/.vscode/extensions/ms-vscode.cpptools-0.29.0-insiders/debugAdapters/lldb-mi/bin/lldb-mi" --interpreter=mi
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) DebuggerPid=11970\n"},"seq":24}
1: (303) DebuggerPid=11970
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (316) ->(gdb)\n"},"seq":26}
1: (316) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (330) <-1001-interpreter-exec console \"version\"\n"},"seq":28}
1: (330) <-1001-interpreter-exec console "version"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (331) ->~\"lldb-1103.0.22.10\\nApple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)\\n\"\n"},"seq":30}
1: (331) ->~"lldb-1103.0.22.10\nApple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (332) ->1001^done\n"},"seq":32}
1: (332) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (332) ->(gdb)\n"},"seq":34}
1: (332) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (335) 1001: elapsed time 5\n"},"seq":36}
1: (335) 1001: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (337) <-1002-gdb-set auto-solib-add on\n"},"seq":38}
1: (337) <-1002-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (338) ->1002^done\n"},"seq":40}
1: (338) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (338) ->(gdb)\n"},"seq":42}
1: (338) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (338) 1002: elapsed time 0\n"},"seq":44}
1: (338) 1002: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) <-1003-gdb-set solib-search-path \"/Users/chris/Projects/k_and_r/exercises/exercise_1-1:\"\n"},"seq":46}
1: (339) <-1003-gdb-set solib-search-path "/Users/chris/Projects/k_and_r/exercises/exercise_1-1:"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) ->1003^done\n"},"seq":48}
1: (339) ->1003^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) ->(gdb)\n"},"seq":50}
1: (339) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) 1003: elapsed time 0\n"},"seq":52}
1: (339) 1003: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) <-1004-environment-cd /Users/chris/Projects/k_and_r\n"},"seq":54}
1: (339) <-1004-environment-cd /Users/chris/Projects/k_and_r
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340) ->1004^done,path=\"/Users/chris/Projects/k_and_r\"\n"},"seq":56}
1: (340) ->1004^done,path="/Users/chris/Projects/k_and_r"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340) ->(gdb)\n"},"seq":58}
1: (340) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) 1004: elapsed time 2\n"},"seq":60}
1: (342) 1004: elapsed time 2
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) <-1005-gdb-set new-console on\n"},"seq":62}
1: (342) <-1005-gdb-set new-console on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) ->1005^done\n"},"seq":64}
1: (342) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) ->(gdb)\n"},"seq":66}
1: (342) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) 1005: elapsed time 0\n"},"seq":68}
1: (342) 1005: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (342) <-1006-file-exec-and-symbols /Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1\n"},"seq":70}
1: (342) <-1006-file-exec-and-symbols /Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (622) ->1006^done\n"},"seq":72}
1: (622) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (622) 1006: elapsed time 279\n"},"seq":74}
1: (622) 1006: elapsed time 279
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (622) ->(gdb)\n"},"seq":76}
1: (622) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (622) <-1007-interpreter-exec console \"platform status\"\n"},"seq":78}
1: (622) <-1007-interpreter-exec console "platform status"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (622) ->=library-loaded,id=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1\",target-name=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1\",host-name=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1\",symbols-loaded=\"1\",symbols-path=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.dSYM/Contents/Resources/DWARF/exercise_1-1\",loaded_addr=\"-\",size=\"4096\"\n"},"seq":80}
1: (622) ->=library-loaded,id="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1",target-name="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1",host-name="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1",symbols-loaded="1",symbols-path="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.dSYM/Contents/Resources/DWARF/exercise_1-1",loaded_addr="-",size="4096"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (623) ->~\"  Platform: host\\n    Triple: x86_64h-apple-macosx\\nOS Version: 10.15.5 (19F101)\\n    Kernel: Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64\\n  Hostname: 127.0.0.1\\nWorkingDir: /Users/chris/Projects/k_and_r\\n\"\n"},"seq":82}
1: (623) ->~"  Platform: host\n    Triple: x86_64h-apple-macosx\nOS Version: 10.15.5 (19F101)\n    Kernel: Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64\n  Hostname: 127.0.0.1\nWorkingDir: /Users/chris/Projects/k_and_r\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (623) ->1007^done\n"},"seq":84}
1: (623) ->1007^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (624) ->(gdb)\n"},"seq":86}
1: (624) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (625) 1007: elapsed time 2\n"},"seq":88}
1: (625) 1007: elapsed time 2
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (626) <-1008-break-insert -f main\n"},"seq":90}
1: (626) <-1008-break-insert -f main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (627) ->1008^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000f48\",func=\"main\",file=\"exercise_1-1.c\",fullname=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c\",line=\"5\",pending=[\"main\"],times=\"0\",original-location=\"main\"}\n"},"seq":92}
1: (627) ->1008^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f48",func="main",file="exercise_1-1.c",fullname="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c",line="5",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (627) ->(gdb)\n"},"seq":94}
1: (627) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (627) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000f48\",func=\"main\",file=\"exercise_1-1.c\",fullname=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c\",line=\"5\",pending=[\"main\"],times=\"0\",original-location=\"main\"}\n"},"seq":96}
1: (627) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f48",func="main",file="exercise_1-1.c",fullname="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c",line="5",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (627) ->(gdb)\n"},"seq":98}
1: (627) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (629) 1008: elapsed time 2\n"},"seq":100}
1: (629) 1008: elapsed time 2
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (636) Send Event AD7EngineCreateEvent\n"},"seq":102}
1: (636) Send Event AD7EngineCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (638) Send Event AD7ProgramCreateEvent\n"},"seq":104}
1: (638) Send Event AD7ProgramCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"16.5.10612.1","VS.Diagnostics.Debugger.HostVersion":"16.5.10612.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":524,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0,"VS.Diagnostics.Debugger.MIMode":"lldb"}},"seq":106}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":108}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":110}
<--   C (setBreakpoints-3): {"command":"setBreakpoints","arguments":{"source":{"name":"exercise_1-1.c","path":"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c"},"lines":[6],"breakpoints":[{"line":6}],"sourceModified":false},"type":"request","seq":3}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (678) <-1009-break-insert -f exercise_1-1.c:6\n"},"seq":113}
1: (678) <-1009-break-insert -f exercise_1-1.c:6
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (679) ->1009^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000f56\",func=\"main\",file=\"exercise_1-1.c\",fullname=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c\",line=\"6\",pending=[\"exercise_1-1.c:6\"],times=\"0\",original-location=\"exercise_1-1.c:6\"}\n"},"seq":115}
1: (679) ->1009^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f56",func="main",file="exercise_1-1.c",fullname="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c",line="6",pending=["exercise_1-1.c:6"],times="0",original-location="exercise_1-1.c:6"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (679) ->(gdb)\n"},"seq":117}
1: (679) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (679) 1009: elapsed time 1\n"},"seq":119}
1: (679) 1009: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (679) ->=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000f56\",func=\"main\",file=\"exercise_1-1.c\",fullname=\"/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c\",line=\"6\",pending=[\"exercise_1-1.c:6\"],times=\"0\",original-location=\"exercise_1-1.c:6\"}\n"},"seq":121}
1: (679) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f56",func="main",file="exercise_1-1.c",fullname="/Users/chris/Projects/k_and_r/exercises/exercise_1-1/exercise_1-1.c",line="6",pending=["exercise_1-1.c:6"],times="0",original-location="exercise_1-1.c:6"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (679) ->(gdb)\n"},"seq":123}
1: (679) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (687) Send Event AD7BreakpointBoundEvent\n"},"seq":125}
1: (687) Send Event AD7BreakpointBoundEvent
--> R (setBreakpoints-3): {"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":6}]},"seq":127}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"line":6}},"seq":129}
<--   C (setFunctionBreakpoints-4): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
--> R (setFunctionBreakpoints-4): {"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":132}
<--   C (configurationDone-5): {"command":"configurationDone","type":"request","seq":5}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (730) Send Event AD7LoadCompleteEvent\n"},"seq":136}
1: (730) Send Event AD7LoadCompleteEvent
--> R (configurationDone-5): {"type":"response","request_seq":5,"success":true,"command":"configurationDone","body":{},"seq":135}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Warning: Debuggee TargetArchitecture not detected, assuming x86_64.\n"},"seq":139}
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (733) <-1010-exec-run\n"},"seq":141}
1: (733) <-1010-exec-run
<--   C (threads-6): {"command":"threads","type":"request","seq":6}
--> R (threads-6): {"type":"response","request_seq":6,"success":true,"command":"threads","body":{"threads":[]},"seq":144}

cdwilson avatar Jun 28 '20 22:06 cdwilson

The issue is when VSCode launches the debug adapter, then the debug adapter launches lldb-mi, then lldb-mi launches Terminal. There is a prompt that should appear, but somehow the DebugAdapter is not forwarding this permissions request.

Screen Shot 2020-05-08 at 7 17 25 PM

The work around is to have VS Code launch the terminal once. You can do this by adding and running this tasks in your tasks.json:

{
  "label": "Open Terminal",
  "type": "shell",
  "command": "osascript -e 'tell application \"Terminal\"\ndo script \"echo hello\"\nend tell'",
  "problemMatcher": []
}

You can run this specific task using Command + Shift + p. Type Tasks and look for Tasks: Run Tasks then select Open Terminal.

Once you allow this permission, then the external console should appear when you debug.

This one just solved my problem 😁

KingOfDuck avatar Aug 06 '20 03:08 KingOfDuck

Tried the proposed solution. I am not being prompted to allow terminal, instead the terminal opens up with just hello. No luck on my end. Any ideas?

Will-huynh13 avatar Sep 23 '20 18:09 Will-huynh13

Tried the proposed solution. I am not being prompted to allow terminal, instead the terminal opens up with just hello. No luck on my end. Any ideas?

change "externalConsole": false, to "externalConsole": true, in launch.json

this works for me with @KingOfDuck solution

bravosierrasierra avatar Oct 17 '20 11:10 bravosierrasierra

The issue is when VSCode launches the debug adapter, then the debug adapter launches lldb-mi, then lldb-mi launches Terminal. There is a prompt that should appear, but somehow the DebugAdapter is not forwarding this permissions request.

Screen Shot 2020-05-08 at 7 17 25 PM

The work around is to have VS Code launch the terminal once. You can do this by adding and running this tasks in your tasks.json:

{
  "label": "Open Terminal",
  "type": "shell",
  "command": "osascript -e 'tell application \"Terminal\"\ndo script \"echo hello\"\nend tell'",
  "problemMatcher": []
}

You can run this specific task using Command + Shift + p. Type Tasks and look for Tasks: Run Tasks then select Open Terminal.

Once you allow this permission, then the external console should appear when you debug.

This workaround doesn't work on macOS Big Sur , running on the new M1 arm chip.

kk-engineer avatar Dec 14 '20 16:12 kk-engineer

The issue is when VSCode launches the debug adapter, then the debug adapter launches lldb-mi, then lldb-mi launches Terminal. There is a prompt that should appear, but somehow the DebugAdapter is not forwarding this permissions request.

Screen Shot 2020-05-08 at 7 17 25 PM

The work around is to have VS Code launch the terminal once. You can do this by adding and running this tasks in your tasks.json:

{
  "label": "Open Terminal",
  "type": "shell",
  "command": "osascript -e 'tell application \"Terminal\"\ndo script \"echo hello\"\nend tell'",
  "problemMatcher": []
}

You can run this specific task using Command + Shift + p. Type Tasks and look for Tasks: Run Tasks then select Open Terminal.

Once you allow this permission, then the external console should appear when you debug.

Not working the workaround for me. Any update with this issue?

BigSamu avatar Jan 08 '21 18:01 BigSamu

thank you, this solved it for me!

The issue is when VSCode launches the debug adapter, then the debug adapter launches lldb-mi, then lldb-mi launches Terminal. There is a prompt that should appear, but somehow the DebugAdapter is not forwarding this permissions request.

Screen Shot 2020-05-08 at 7 17 25 PM

The work around is to have VS Code launch the terminal once. You can do this by adding and running this tasks in your tasks.json:

{
  "label": "Open Terminal",
  "type": "shell",
  "command": "osascript -e 'tell application \"Terminal\"\ndo script \"echo hello\"\nend tell'",
  "problemMatcher": []
}

You can run this specific task using Command + Shift + p. Type Tasks and look for Tasks: Run Tasks then select Open Terminal.

Once you allow this permission, then the external console should appear when you debug.

THANK YOU SO MUCH! This solved it for me

silkthyme avatar Jan 14 '21 18:01 silkthyme

For anyone still having this issue. After you follow the steps to make the terminal pop up. Make sure you have the configuration "externalConsole": true,

Beastandcool avatar Feb 20 '21 20:02 Beastandcool

same issue with MacBook m1, console opens but nothing appears, only that: Launching: '/Users/carlos/Documents/vscode/test/test' Working directory: '/Users/carlos/Documents/vscode/test' 1 arguments: argv[0] = '/Users/carlos/Documents/vscode/test/test'

cmcta82 avatar Feb 22 '21 10:02 cmcta82