8000 [macOS Catalina] Unable to debug with 'externalConsole': true · Issue #5079 · microsoft/vscode-cpptools · GitHub
[go: up one dir, main page]

Skip to content
[macOS Catalina] Unable to debug with 'externalConsole': true #5079
Open
@sourav-dey

Description

@sourav-dey

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.
8000
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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0