Open maane018 opened 6 years ago
@maane018 can you share how you compiled this and which version of the compiler you are using?
The error shows: 1: (741) <-1007-exec-run 1: (5253) ->1007^error,msg="Command 'exec-run'. Invalid process during debug session"
.
Also do you have python 2.7 installed? I'm showing this error from lldb also:
1: (601) STDERR: Traceback (most recent call last):
1: (601) STDERR: File "<input>", line 1, in <module>
1: (601) STDERR: File "/Users/hgarg/anaconda2/lib/python2.7/copy.py", line 52, in <module>
1: (601) STDERR: import weakref
1: (601) STDERR: File "/Users/hgarg/anaconda2/lib/python2.7/weakref.py", line 14, in <module>
1: (601) STDERR: from _weakref import (
1: (601) STDERR: ImportError: cannot import name _remove_dead_weakref
Hi @pieandcakes Here is my tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": [
"-g",
"main.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Code is running perfectly.
But when I am trying to debug the program using breakpoints:
and I debug the program, I got these logs:
1: (674) STDERR: Traceback (most recent call last):
1: (675) STDERR: File "<input>", line 1, in <module>
1: (675) STDERR: File "/Users/hgarg/anaconda2/lib/python2.7/copy.py", line 52, in <module>
1: (675) STDERR: import weakref
1: (675) STDERR: File "/Users/hgarg/anaconda2/lib/python2.7/weakref.py", line 14, in <module>
1: (675) STDERR: from _weakref import (
1: (675) STDERR: ImportError: cannot import name _remove_dead_weakref
1: (788) ->1004^done
1: (788) ->(gdb)
1: (788) 1004: elapsed time 120
1: (789) ->=library-loaded,id="/Users/hgarg/testing-vscode/a.out",target-name="/Users/hgarg/testing-vscode/a.out",host-name="/Users/hgarg/testing-vscode/a.out",symbols-loaded="1",symbols-path="/Users/hgarg/testing-vscode/a.out.dSYM/Contents/Resources/DWARF/a.out",loaded_addr="-",size="8192"
1: (791) <-1005-interpreter-exec console "platform status"
1: (792) -> Platform: host
1: (792) -> Triple: x86_64h-apple-macosx
1: (792) ->OS Version: 10.13.6 (17G65)
1: (792) -> Kernel: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
1: (792) -> Hostname: 127.0.0.1
1: (792) ->WorkingDir: /Users/hgarg/testing-vscode
1: (792) ->1005^done
1: (792) ->(gdb)
1: (794) 1005: elapsed time 3
1: (799) <-1006-break-insert main
1: (802) ->1006^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010ba",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="11",times="0",original-location="main"}
1: (803) ->(gdb)
1: (803) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010ba",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="11",times="0",original-location="main"}
1: (803) ->(gdb)
1: (804) 1006: elapsed time 4
1: (917) <-1007-break-insert -f on main.cpp:11
1: (918) ->1007^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010ba",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="11",pending=["main.cpp:11"],times="0",original-location="main.cpp:11"}
1: (918) ->(gdb)
1: (919) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010ba",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="11",pending=["main.cpp:11"],times="0",original-location="main.cpp:11"}
1: (919) ->(gdb)
1: (920) 1007: elapsed time 3
1: (939) <-1008-break-insert -f on main.cpp:12
1: (940) ->1008^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010bf",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="12",pending=["main.cpp:12"],times="0",original-location="main.cpp:12"}
1: (940) 1008: elapsed time 0
1: (940) ->(gdb)
1: (940) ->=breakpoint-modified,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010bf",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="12",pending=["main.cpp:12"],times="0",original-location="main.cpp:12"}
1: (940) ->(gdb)
1: (941) <-1009-break-insert -f on main.cpp:13
1: (942) ->1009^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010d5",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="13",pending=["main.cpp:13"],times="0",original-location="main.cpp:13"}
1: (943) 1009: elapsed time 1
1: (943) ->(gdb)
1: (943) ->=breakpoint-modified,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000010d5",func="main",file="main.cpp",fullname="/Users/hgarg/testing-vscode/main.cpp",line="13",pending=["main.cpp:13"],times="0",original-location="main.cpp:13"}
1: (943) ->(gdb)
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
1: (972) <-1010-exec-run
1: (2970) ->1010^error,msg="Command 'exec-run'. Invalid process during debug session"
1: (2970) ->(gdb)
1: (2970) 1010: elapsed time 1997
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". Command 'exec-run'. Invalid process during debug session
1: (2984) <--gdb-exit
1: (2984) ->^exit
1: (2984) ->=thread-group-exited,id="i1"
1: (2984) ->(gdb)
1: (2985) ->
1: (2985) ->
1: (2986) <-logout
The program '/Users/hgarg/testing-vscode/a.out' has exited with code 42 (0x0000002a).
Along with that, my terminal got opened and without asking for anything, it returned the following output:
Launching: '/Users/hgarg/testing-vscode/a.out'
Working directory: '/Users/hgarg/testing-vscode'
1 arguments:
argv[0] = '/Users/hgarg/testing-vscode/a.out'
Trace/BPT trap: 5
Process exited with status 133
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
and I am using G++ Compiler:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Also, I don't have Python 2.7 installed in this directory. Do you have any idea why it is looking for Python libraries during debugging?
@WardenGnaw Can you repro this for us?
@maane018
Also, I don't have Python 2.7 installed in this directory. Do you have any idea why it is looking for Python libraries during debugging?
We had requests to support Python Visualizers in our lldb so it requires python to be installed. Unfortunately this is a compile time option and we don't have an option currently to install lldb without python.
@pieandcakes Okay. I will try it again, by changing the python version. There are actually 2 errors during debugging. One is sometimes it fails to debug also ( which is I think is due to the Python libraries ) and second, it fails to get input from terminal. Do you have any idea why it fails to get input?
@maane018
Do you have any idea why it fails to get input?
If you type in the terminal that pops up it should get your input
Process exited with status 133
That shows in your terminal window so i'm wondering why your app is terminating with code 133
Any solution in here??
I have tried the simple calculator in this video: https://www.youtube.com/watch?v=X7CXjKGi_ro
and got the same error! When I don't try a prelaunchTask, debugging works just fine but when I use a preLaunchTask it will produce exactly the same errors!!
Thanks
I'm getting this same problem. For me, it looks to be a timing issue. The debugger invocation is occurring before the preLaunchTask has finished. Subsequent invocations of the debugger (via F5) work fine for me, but the initial invocation after a clean build always fails. I am admittedly working on a very small project, so it may be the case that other users have preLaunchTasks that are still in progress irrespective of whether a clean build occurred or not, and perhaps those tasks are affecting the binary the debugger is attempting to launch.
@aziabari and @Ulchie Thanks for the updated info. The cpptools extension does not handle the prelaunch task, and if VS Code launches the debugger without the prelaunch task finishing, that would be an issue on their end.
Another user is encountering this issue with the node debugger: https://github.com/Microsoft/vscode/issues/69151
@maane018 This might be a permission issue with the debugger executables.
Can you do ls -al
on ~/.vscode/extensions/ms-vscode.cpptools-<version>/debugAdapters/lldb/bin/
I am also having the same problem. I followed: https://code.visualstudio.com/docs/cpp/config-clang-mac I need to run it twice or thrice sometimes to make it run successfully.
❯ ls -al ~/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/debugAdapters/lldb-mi/bin [11:49:29] total 5576 drwxr-xr-x 3 sodey 600 96 Mar 5 15:43 . drwxr-xr-x 4 sodey 600 128 Mar 5 15:43 .. -rwxr-xr-x 1 sodey 600 2853804 Mar 5 15:43 lldb-mi
@sourav-dey Could you make another issue on this and also share your tasks.json and launch.json?
Sure. Here it is: https://github.com/microsoft/vscode-cpptools/issues/5079
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.
Exact same issue as @lmapii
@lmapii @peza8 Are you having issues debugging on macOS High Sierra?
@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 Experiencing issue on Catalina 10.15.2. Sadly haven't had the same luck as Imapii. Happy to do any tests you need @WardenGnaw .
@lmapii @peza8 Hiding comments here and moving them to https://github.com/microsoft/vscode-cpptools/issues/5079
Type: Debugger OS: MacOS Version: 10.13.6 Debugger: LLDB
launch.json:
Logs:
Folder Structure: