Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when starting lldb.exe #913

Open
Drllap opened this issue Apr 23, 2023 · 8 comments
Open

Error when starting lldb.exe #913

Drllap opened this issue Apr 23, 2023 · 8 comments
Labels
need more info Investigation is blocked until more information is available. platform:windows The issue is specific to Windows. See https://github.com/vadimcn/vscode-lldb/wiki/Windows

Comments

@Drllap
Copy link

Drllap commented Apr 23, 2023

OS: Windows
VSCode version: 1.77.3
CodeLLDB version: v1.9.0
Compiler: N/A
Debuggee: N/A

  1. Open up the lldb.exe from terminal
  2. A python error is thrown:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/noob-destroyer/.vscode/extensions/vadimcn.vscode-lldb-1.9.0/lldb/lib/lldb-python\lldb\embedded_interprete
r.py", line 29, in <module>
    if 'libedit' in readline.__doc__:
TypeError: argument of type 'NoneType' is not iterable

It seems that this error results in the python environment not being probably setup. When I try to run the script command in the lldb REPL I get the following error:

(lldb) script
Traceback (most recent call last):    
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_python_interpreter' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'lldb' is not defined
(lldb)
@Drllap
Copy link
Author

Drllap commented Apr 23, 2023

In lldb/lib/lldb-python/lldb/embedded_interpreter.py the imported readline module is from my installed python:
print(type(readline)) gives C:\Users\<user>\AppData\Roaming\Python\Python39\site-packages\readline.py.

It appears that lldb is loading readline from a python outside the embedded one? Is this intended?

@Drllap
Copy link
Author

Drllap commented Apr 23, 2023

BTW, I don't get this error when using the vanilla LLVM LLDB and I am able to use the script command when in the REPL

@Drllap
Copy link
Author

Drllap commented Apr 23, 2023

I don't understand how lldb is finding my installed python. If I remove all python related things from my path, it still imports readline from my local installation.

@vadimcn
Copy link
Owner

vadimcn commented Apr 24, 2023

Do you have Python-specific environment variables (like PYTHONPATH) set up?

@Drllap
Copy link
Author

Drllap commented Apr 24, 2023

no, not that I can find. This is probably because I'm using miniconda and I don't have any environment active..

It is beyond me how lldb is still picking it up.

@vadimcn
Copy link
Owner

vadimcn commented Apr 24, 2023

Actually, can you please clarify what did you mean by "Open up the lldb.exe from terminal"?

@Drllap
Copy link
Author

Drllap commented Apr 24, 2023

Actually, can you please clarify what did you mean by "Open up the lldb.exe from terminal"?

So, I'm not using the "DEBUG CONSOLE" in vscode. When I did that I got some generic error about something not being right (basically don't remember what exactly it was). So I opened my terminal emulator (WezTerm) running PowerShell and cd to the lldb.exe file in the .~\vscode\extensions\valdimcn....

There I just run ./lldb.exe. There I can see the actual error where the "DEBUG CONSOLE" hides them.

@vadimcn
Copy link
Owner

vadimcn commented Apr 24, 2023

Sorry, I don't think I'll be much help in diagnosing this. This issue seems to be specific to your machine configuration, so you will need to do the detective work to figure out how lldb ends up finding your external Python installation. Once we know how this happens, we can discuss possible fixes.

@vadimcn vadimcn added need more info Investigation is blocked until more information is available. platform:windows The issue is specific to Windows. See https://github.com/vadimcn/vscode-lldb/wiki/Windows labels Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Investigation is blocked until more information is available. platform:windows The issue is specific to Windows. See https://github.com/vadimcn/vscode-lldb/wiki/Windows
Projects
None yet
Development

No branches or pull requests

2 participants