Type: Debugger
lldb-902.0.79.7
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Describe the bug
Unable to start debugging. Unable to establish a connection to LLDB. The following message was written to stderr:
lldb: unrecognized option `--interpreter=mi'
error: unknown or ambiguous option
Starting:` "/usr/bin/lldb" --interpreter=mi
lldb: unrecognized option `--interpreter=mi'
error: unknown or ambiguous option
@shinsei90 can you post your launch.json
?
It seems like you have MIMode
set to gdb
instead of lldb
and you are pointing to the wrong debugger executable. For lldb
we use the executable lldb-mi
which allows us to drive the debugger through protocol messages.
Also, we default to using our included lldb
when miDebuggerPath
is not specified. The version of lldb
we include specifically works with our extension and includes fixes to support it.
of course here is my 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}/build/myproject",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb"
},
{
"engineLogging": true,
"trace": true,
"traceResponse": true
}
]
}
@shinsei90 That's the launch.json
you are using when you got that error message? Our default is to use our version of lldb
which is not under /usr/bin/lldb
.
Yes, that was the launch.json
I used when I got the error message.
@pieandcakes and?? He said he wants to use custom lldb, not the default
@MuhsinFatih by default it should be using our lldb located in ~/.vscode/extensions/ms-vscode.cpptools-0.19.0/debugAdapters/lldb/
which is not what the error is saying.
You can also set miDebuggerPath
to point to lldb-mi
that is in that folder manually. I've tried using the latest on my Mac and I can't reproduce what you are running into with that launch.json
configuration.
how to solve it ? @pieandcakes
Unable to start debugging. Unable to establish a connection to LLDB. The following message was written to stderr:
lldb: unrecognized option `--interpreter=mi'
error: unknown or ambiguous option
the launch.json is generated by default
@joole can you confirm that you have lldb-mi
executable in your extensions folder? Are you specifying your own miDebuggerPath
? If so, you need lldb-mi
and not lldb
.
@pieandcakes yes,the path "~/.vscode/extensions/ms-vscode.cpptools-0.20.0/debugAdapters/lldb/bin/lldb-mi" has one, the other one in the xcode install path, even if i set the value of miDebuggerPath , that's the same error
@joole If you are setting miDebuggerPath
you need to find lldb-mi
and not lldb
as we use mi
mode to send and receive commands from lldb
. If you want to use the xcode version, you will need to figure out where that is.
@pieandcakes
here is the 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": "build/test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"miDebuggerPath": "/Users/xuweiquan/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/lldb/bin/lldb-mi",
"MIMode": "lldb"
}
]
}
but error as before~
@pieandcakes
I watch the log of output, find when debug the program the debugger alway the /usr/bin/lldb
,even if the set the value of miDebuggerPath
, how to fix it ? please help me
Can you turn on traceResponse logging and share the output?
@pieandcakes
only this message
Starting:` "/usr/bin/lldb" --interpreter=mi
lldb: unrecognized option `--interpreter=mi'
error: unknown or ambiguous option
anything useful information or log generated when add the logging
to the launch.json
by the way, I use the cmake-tools to config the cpp
I can't duplicate this on my current Mac. Which version of xcode do you have installed? I'll see if I can get an updated Mac and try this.
@pieandcakes
xcode3 on mac mini and xcode9 on mac pro,as I think, you can get the same result with the following step:
OK, I solved it by myself, Maybe useful to others:
add some config to settings.json:
"cmake.debugConfig": {
"stopAtEntry": false,
"MIMode": "lldb",
"miDebuggerPath": "/Users/xuweiquan/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/lldb/bin/lldb-mi",
"logging": {
"trace": true,
"engineLogging": true,
"traceResponse": true
}
}
@joole Thanks. Its interesting that the CMake extension is overwriting our debug path.....
@joole So I found the difference. If you use the CMake pane in VS Code and choose Run with debugger
, then it won't work until you add that block.
I have filed an issue with them as this is the CMake Tools extension that is sending us bad information. If you want to use what is in your launch.json
, then you need to use the Debug pane and use the Start Debugging
button or by pressing F5
.
I imagine that this is @shinsei90 's issue also.
To clarify for anyone watching: Using the Run with debugger
command, the "Debug" button in the status bar, and running the "CMake: Debug Target" command will generate a debugger configuration on-the-fly for the target you've selected, it won't consult the launch.json
at all. Here are my docs on debugging, and particularly the section on using launch.json
for debugging.
@vector-of-bool Thanks for the information!
OK, I solved it by myself, Maybe useful to others:
add some config to settings.json:"cmake.debugConfig": { "stopAtEntry": false, "MIMode": "lldb", "miDebuggerPath": "/Users/xuweiquan/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/lldb/bin/lldb-mi", "logging": { "trace": true, "engineLogging": true, "traceResponse": true } }
This solution does not work for me.
As an alternative solution, I build the project using the tool. And use this launch.js config to run the project via top debug button.
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/excuteable",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb"
}
]
@czyang That block uses our extension to kick off debugging whereas the above block you quoted is from @vector-of-bool 's CMake Tools Extension. If you can provide him more information, he might appreciate knowing what the cause is.
Engine Log
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (149) LaunchOptions
1: (163) LaunchOptions ExePath='/Users/zhushijie/Desktop/demo/vic/main'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (163) LaunchOptions WorkingDirectory='/Users/zhushijie/Desktop/demo/vic'n"},"seq":6}
1: (163) LaunchOptions WorkingDirectory='/Users/zhushijie/Desktop/demo/vic'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (163) LaunchOptions TargetArchitecture='x64'n"},"seq":8}
1: (163) LaunchOptions TargetArchitecture='x64'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (163) LaunchOptions ExeArguments='--interpreter=mi'n"},"seq":10}
1: (163) LaunchOptions ExeArguments='--interpreter=mi'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (164) LaunchOptions MIMode='lldb'n"},"seq":12}
1: (164) LaunchOptions MIMode='lldb'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (164) LaunchOptions MIDebuggerPath='/Users/zhushijie/.vscode/extensions/ms-vscode.cpptools-0.26.1/debugAdapters/lldb/bin/lldb-mi'n"},"seq":14}
1: (164) LaunchOptions MIDebuggerPath='/Users/zhushijie/.vscode/extensions/ms-vscode.cpptools-0.26.1/debugAdapters/lldb/bin/lldb-mi'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (164) LaunchOptions WaitDynamicLibLoad='false'n"},"seq":16}
1: (164) LaunchOptions WaitDynamicLibLoad='false'
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (164) LaunchOptions>n"},"seq":18}
1: (164) LaunchOptions>
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (164) LaunchOptionsn"},"seq":20}
1: (164) LaunchOptions
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (277) Starting: \"/Users/zhushijie/.vscode/extensions/ms-vscode.cpptools-0.26.1/debugAdapters/lldb/bin/lldb-mi\" --interpreter=min"},"seq":22}
1: (277) Starting: "/Users/zhushijie/.vscode/extensions/ms-vscode.cpptools-0.26.1/debugAdapters/lldb/bin/lldb-mi" --interpreter=mi
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (298) DebuggerPid=63544n"},"seq":24}
1: (298) DebuggerPid=63544
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (454) ->(gdb)n"},"seq":26}
1: (454) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (470) <-1001-gdb-set auto-solib-add onn"},"seq":28}
1: (470) <-1001-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (470) ->1001^donen"},"seq":30}
1: (470) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (471) ->(gdb)n"},"seq":32}
1: (471) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (472) 1001: elapsed time 3n"},"seq":34}
1: (472) 1001: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (473) <-1002-gdb-set solib-search-path \"/Users/zhushijie/Desktop/demo/vic:\"n"},"seq":36}
1: (473) <-1002-gdb-set solib-search-path "/Users/zhushijie/Desktop/demo/vic:"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (473) ->1002^donen"},"seq":38}
1: (473) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (473) ->(gdb)n"},"seq":40}
1: (473) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (473) 1002: elapsed time 0n"},"seq":42}
1: (473) 1002: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (474) <-1003-environment-cd /Users/zhushijie/Desktop/demo/vicn"},"seq":44}
1: (474) <-1003-environment-cd /Users/zhushijie/Desktop/demo/vic
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (474) ->1003^done,path=\"/Users/zhushijie/Desktop/demo/vic\"n"},"seq":46}
1: (474) ->1003^done,path="/Users/zhushijie/Desktop/demo/vic"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (474) ->(gdb)n"},"seq":48}
1: (474) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (478) 1003: elapsed time 4n"},"seq":50}
1: (478) 1003: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (478) <-1004-file-exec-and-symbols /Users/zhushijie/Desktop/demo/vic/mainn"},"seq":52}
1: (478) <-1004-file-exec-and-symbols /Users/zhushijie/Desktop/demo/vic/main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (589) ->1004^donen"},"seq":54}
1: (589) ->1004^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (589) ->(gdb)n"},"seq":56}
1: (589) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (589) 1004: elapsed time 111n"},"seq":58}
1: (589) 1004: elapsed time 111
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (590) ->=library-loaded,id=\"/Users/zhushijie/Desktop/demo/vic/main\",target-name=\"/Users/zhushijie/Desktop/demo/vic/main\",host-name=\"/Users/zhushijie/Desktop/demo/vic/main\",symbols-loaded=\"1\",symbols-path=\"/System/Volumes/Data/Users/zhushijie/Desktop/demo/vic/main.dSYM/Contents/Resources/DWARF/main\",loaded_addr=\"-\",size=\"4096\"n"},"seq":60}
1: (590) ->=library-loaded,id="/Users/zhushijie/Desktop/demo/vic/main",target-name="/Users/zhushijie/Desktop/demo/vic/main",host-name="/Users/zhushijie/Desktop/demo/vic/main",symbols-loaded="1",symbols-path="/System/Volumes/Data/Users/zhushijie/Desktop/demo/vic/main.dSYM/Contents/Resources/DWARF/main",loaded_addr="-",size="4096"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (591) <-1005-interpreter-exec console \"platform status\"n"},"seq":62}
1: (591) <-1005-interpreter-exec console "platform status"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (593) -> Platform: hostn"},"seq":64}
1: (593) -> Platform: host
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (593) -> Triple: x86_64h-apple-macosxn"},"seq":66}
1: (593) -> Triple: x86_64h-apple-macosx
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (593) ->OS Version: 10.15.1 (19B88)n"},"seq":68}
1: (593) ->OS Version: 10.15.1 (19B88)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (593) -> Kernel: Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64n"},"seq":70}
1: (593) -> Kernel: Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (594) -> Hostname: 127.0.0.1n"},"seq":72}
1: (594) -> Hostname: 127.0.0.1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (594) ->WorkingDir: /Users/zhushijie/Desktop/demo/vicn"},"seq":74}
1: (594) ->WorkingDir: /Users/zhushijie/Desktop/demo/vic
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (594) ->1005^donen"},"seq":76}
1: (594) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (594) ->(gdb)n"},"seq":78}
1: (594) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (596) 1005: elapsed time 4n"},"seq":80}
1: (596) 1005: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (597) <-1006-exec-arguments --interpreter=min"},"seq":82}
1: (597) <-1006-exec-arguments --interpreter=mi
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (598) ->1006^donen"},"seq":84}
1: (598) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (598) ->(gdb)n"},"seq":86}
1: (598) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (598) 1006: elapsed time 0n"},"seq":88}
1: (598) 1006: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (598) <-1007-break-insert -f on mainn"},"seq":90}
1: (598) <-1007-break-insert -f on main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (600) ->1007^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000ccf\",func=\"main\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"19\",pending=[\"main\"],times=\"0\",original-location=\"main\"}n"},"seq":92}
1: (600) ->1007^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000ccf",func="main",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="19",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (600) ->(gdb)n"},"seq":94}
1: (600) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (600) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000ccf\",func=\"main\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"19\",pending=[\"main\"],times=\"0\",original-location=\"main\"}n"},"seq":96}
1: (600) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000ccf",func="main",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="19",pending=["main"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (600) ->(gdb)n"},"seq":98}
1: (600) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (602) 1007: elapsed time 4n"},"seq":100}
1: (602) 1007: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (611) Send Event AD7EngineCreateEventn"},"seq":102}
1: (611) Send Event AD7EngineCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (614) Send Event AD7ProgramCreateEventn"},"seq":104}
1: (614) 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":"14.0.61023.1","VS.Diagnostics.Debugger.HostVersion":"14.0.61023.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":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 (setBreakpoints-3): {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/Users/zhushijie/Desktop/demo/vic/main.cpp"},"lines":[7,18],"breakpoints":[{"line":7},{"line":18}],"sourceModified":false},"type":"request","seq":3}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (670) <-1008-break-insert -f on main.cpp:7n"},"seq":113}
1: (670) <-1008-break-insert -f on main.cpp:7
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (671) ->1008^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000c87\",func=\"func(int)\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"7\",pending=[\"main.cpp:7\"],times=\"0\",original-location=\"main.cpp:7\"}n"},"seq":115}
1: (671) ->1008^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000c87",func="func(int)",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="7",pending=["main.cpp:7"],times="0",original-location="main.cpp:7"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (671) ->(gdb)n"},"seq":117}
1: (671) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (672) 1008: elapsed time 1n"},"seq":119}
1: (672) 1008: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (672) ->=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000c87\",func=\"func(int)\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"7\",pending=[\"main.cpp:7\"],times=\"0\",original-location=\"main.cpp:7\"}n"},"seq":121}
1: (672) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000c87",func="func(int)",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="7",pending=["main.cpp:7"],times="0",original-location="main.cpp:7"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (672) ->(gdb)n"},"seq":123}
1: (672) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (681) Send Event AD7BreakpointBoundEventn"},"seq":125}
1: (681) Send Event AD7BreakpointBoundEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (687) <-1009-break-insert -f on main.cpp:18n"},"seq":127}
1: (687) <-1009-break-insert -f on main.cpp:18
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (688) ->1009^done,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000ccf\",func=\"main\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"19\",pending=[\"main.cpp:18\"],times=\"0\",original-location=\"main.cpp:18\"}n"},"seq":129}
1: (688) ->1009^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000ccf",func="main",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="19",pending=["main.cpp:18"],times="0",original-location="main.cpp:18"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (688) ->(gdb)n"},"seq":131}
1: (688) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (688) 1009: elapsed time 0n"},"seq":133}
1: (688) 1009: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (688) Send Event AD7BreakpointBoundEventn"},"seq":135}
1: (688) Send Event AD7BreakpointBoundEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (688) ->=breakpoint-modified,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000100000ccf\",func=\"main\",file=\"main.cpp\",fullname=\"/Users/zhushijie/Desktop/demo/vic/main.cpp\",line=\"19\",pending=[\"main.cpp:18\"],times=\"0\",original-location=\"main.cpp:18\"}n"},"seq":137}
1: (688) ->=breakpoint-modified,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000ccf",func="main",file="main.cpp",fullname="/Users/zhushijie/Desktop/demo/vic/main.cpp",line="19",pending=["main.cpp:18"],times="0",original-location="main.cpp:18"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (689) ->(gdb)n"},"seq":139}
1: (689) ->(gdb)
--> R (setBreakpoints-3): {"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":7},{"id":2,"verified":true,"line":18}]},"seq":141}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"line":7}},"seq":143}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":2,"verified":true,"line":19}},"seq":145}
<-- 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":148}
<-- C (setExceptionBreakpoints-5): {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":5}
--> R (setExceptionBreakpoints-5): {"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints","body":{},"seq":151}
<-- C (configurationDone-6): {"command":"configurationDone","type":"request","seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (734) Send Event AD7LoadCompleteEventn"},"seq":155}
1: (734) Send Event AD7LoadCompleteEvent
--> R (configurationDone-6): {"type":"response","request_seq":6,"success":true,"command":"configurationDone","body":{},"seq":154}
<-- C (threads-7): {"command":"threads","type":"request","seq":7}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (739) <-1010-exec-runn"},"seq":159}
1: (739) <-1010-exec-run
--> R (threads-7): {"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[]},"seq":161}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1408) ->1010^runningn"},"seq":163}
1: (1408) ->1010^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1409) ->=thread-group-started,id=\"i1\",pid=\"63545\"n"},"seq":165}
1: (1409) ->=thread-group-started,id="i1",pid="63545"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1409) 1010: elapsed time 669n"},"seq":167}
1: (1409) 1010: elapsed time 669
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1409) ->(gdb)n"},"seq":169}
1: (1409) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1410) ->=thread-created,id=\"1\",group-id=\"i1\"n"},"seq":171}
1: (1410) ->=thread-created,id="1",group-id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1410) ->=thread-selected,id=\"1\"n"},"seq":173}
1: (1410) ->=thread-selected,id="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1410) ->(gdb)n"},"seq":175}
1: (1410) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1410) ->running,thread-id=\"all\"n"},"seq":177}
1: (1410) ->running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1411) ->(gdb)n"},"seq":179}
1: (1411) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1413) ->@\"55\r\n\"n"},"seq":181}
1: (1413) ->@"55\rn"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1413) ->(gdb)n"},"seq":183}
1: (1413) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1413) ->=thread-exited,id=\"1\",group-id=\"i1\"n"},"seq":185}
1: (1413) ->=thread-exited,id="1",group-id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1414) ->=thread-group-exited,id=\"i1\",exit-code=\"0\"n"},"seq":187}
1: (1414) ->=thread-group-exited,id="i1",exit-code="0"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1414) ->stopped,reason=\"exited-normally\"n"},"seq":189}
1: (1414) ->stopped,reason="exited-normally"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1414) ->(gdb)n"},"seq":191}
1: (1414) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1414) <-1011-thread-info 1n"},"seq":193}
1: (1414) <-1011-thread-info 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1415) ->1011^done,threads=[{id=\"1\",target-id=\"Thread 1\",frame={level=\"0\",addr=\"0xffffffffffffffff\",func=\"??\",args=[],file=\"??\",fullname=\"??\",line=\"0\"},state=\"running\"}]n"},"seq":195}
1: (1415) ->1011^done,threads=[{id="1",target-id="Thread 1",frame={level="0",addr="0xffffffffffffffff",func="??",args=[],file="??",fullname="??",line="0"},state="running"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1415) ->(gdb)n"},"seq":197}
1: (1415) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"=thread-selected,id=\"1\"n"},"seq":199}
=thread-selected,id="1"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"@\"55\r\n\"n"},"seq":201}
@"55\rn"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1420) 1011: elapsed time 6n"},"seq":203}
1: (1420) 1011: elapsed time 6
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1423) Send Event AD7ProcessInfoUpdatedEventn"},"seq":205}
1: (1423) Send Event AD7ProcessInfoUpdatedEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1423) Send Event AD7ThreadCreateEventn"},"seq":207}
1: (1423) Send Event AD7ThreadCreateEvent
--> E (thread): {"type":"event","event":"thread","body":{"reason":"started","threadId":1},"seq":209}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1429) <--gdb-exitn"},"seq":211}
1: (1429) <--gdb-exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1430) ->^exitn"},"seq":213}
1: (1430) ->^exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1430) ->=thread-group-exited,id=\"i1\"n"},"seq":215}
1: (1430) ->=thread-group-exited,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1430) ->(gdb)n"},"seq":217}
1: (1430) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1430) ->n"},"seq":219}
1: (1430) ->
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1430) ->n"},"seq":221}
1: (1430) ->
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1435) <-logoutn"},"seq":223}
1: (1435) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1438) Send Event AD7ProgramDestroyEventn"},"seq":225}
1: (1438) Send Event AD7ProgramDestroyEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"The program '/Users/zhushijie/Desktop/demo/vic/main' has exited with code 0 (0x00000000).\rnn"},"seq":227}
The program '/Users/zhushijie/Desktop/demo/vic/main' has exited with code 0 (0x00000000).
--> E (exited): {"type":"event","event":"exited","body":{"exitCode":0},"seq":229}
--> E (terminated): {"type":"event","event":"terminated","body":{},"seq":231}
--> 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":"14.0.61023.1","VS.Diagnostics.Debugger.HostVersion":"14.0.61023.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0}},"seq":233}
<-- C (disconnect-8): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":8}
--> R (disconnect-8): {"type":"response","request_seq":8,"success":true,"command":"disconnect","body":{},"seq":236}
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [
"--interpreter=mi"
],
"stopAtEntry": true,
"targetArchitecture": "x64",
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"osx": {
"MIMode": "lldb",
"miDebuggerPath": "/Users/zhushijie/.vscode/extensions/ms-vscode.cpptools-0.26.1/debugAdapters/lldb/bin/lldb-mi"
},
"logging": {
"trace": true,
"engineLogging": true,
"traceResponse": true
},
"preLaunchTask": "g++ build active file"
}]
}
I have the same problem, breakpoint doesn't work on vscode
@zhusjfaker Please reference pinned issue #3829. Yours is not this issue.
Type: Debugger
lldb-902.0.79.7
Apple LLVM version 9.1.0 (clang-902.0.39.2)Describe the bug
- OS and Version: Mac OS X 10.13.6
- VS Code Version: 1.26.1
- C/C++ Extension Version: 0.18.1
- CMAKE Tools
- I got the following message on a pop up windows:
Unable to start debugging. Unable to establish a connection to LLDB. The following message was written to stderr:
lldb: unrecognized option `--interpreter=mi'
error: unknown or ambiguous option
- and I got this error message on the debug console:
Starting:` "/usr/bin/lldb" --interpreter=mi lldb: unrecognized option `--interpreter=mi' error: unknown or ambiguous option
You shouldn't be targeting lldb
but rather lldb-mi
. For lldb
we require the lldb-mi
executable as it contains the mi
instructions we need to communicate with the debugger.
When I run lldb-mi
executable from the terminal, it loads gdb
. Any reason for that?
@sukuya It shouldn't unless you have it mapped. I know it "emulates" gdb's MI mode so it will say (gdb) as that was what is expected by all the tools out there when a debugger is running in mi mode. If you are saying that it is actually gdb then there might be a symlink somewhere.
It just says gdb
. Thanks @pieandcakes for the clarification.
Most helpful comment
OK, I solved it by myself, Maybe useful to others:
add some config to settings.json: