Skip to content

Commit c441aa5

Browse files
authored
[lldb] Add lldbutil.install_to_target() helper (#91944)
It can be used in tests #91918, #91931 and such.
1 parent 9837a1c commit c441aa5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lldb/packages/Python/lldbsuite/test/lldbutil.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,22 @@ def find_library_callable(test):
16541654
)
16551655

16561656

1657+
def install_to_target(test, path):
1658+
if lldb.remote_platform:
1659+
filename = os.path.basename(path)
1660+
remote_path = append_to_process_working_directory(test, filename)
1661+
err = lldb.remote_platform.Install(
1662+
lldb.SBFileSpec(path, True), lldb.SBFileSpec(remote_path, False)
1663+
)
1664+
if err.Fail():
1665+
raise Exception(
1666+
"remote_platform.Install('%s', '%s') failed: %s"
1667+
% (path, remote_path, err)
1668+
)
1669+
path = remote_path
1670+
return path
1671+
1672+
16571673
def read_file_on_target(test, remote):
16581674
if lldb.remote_platform:
16591675
local = test.getBuildArtifact("file_from_target")

0 commit comments

Comments
 (0)