Skip to content

Running Python scripts inside LLDB on Ubuntu 20.04 is broken #4770

@adam-fowler

Description

@adam-fowler

When I try to run a simple python script in LLDB it fails in both Swift 5.6.1 and the latest nightly

Steps

  1. Open terminal and enter lldb
  2. Enter script print(lldb.SBHostOS.GetLLDBPath(lldb.ePathTypeLLDBShlibDir).fullpath)

Using Swift 5.5 I get the library path for lldb
Using Swift 5.6 I get the following output

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb'
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
error: python failed attempting to evaluate 'print(lldb.SBHostOS.GetLLDBPath(lldb.ePathTypeLLDBShlibDir).fullpath)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'lldb' is not defined

Using the latest nightly
After step 1 I get this output

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb'

And after step 2 I get pretty much the same output as Swift 5.6

Swift 5.6 and later also fail on even simpler scripts like script print("hi").

Environment

OS: 20.04.4 LTS (Focal Fossa)
Swift version: 5.6.1 and 2022-05-27-a nightly
Python version: 3.8.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions