Skip to content

Commit 8b96071

Browse files
committed
[lldb-with-tools] Add a new utility script called lldb-with-tools.
This is a simple tool that starts lldb, but before it runs your commands, uses the -O command to load lldbToolBox.py. This provide sthe llvm data formatters as well as potential future lldb extensions that we write for swift itself. A better name for this utility would be much appreciated, but I think for now the name "lldb-with-tools" is at least self explanatory.
1 parent 71b508e commit 8b96071

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

utils/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_subdirectory(vim)
2+
add_subdirectory(lldb)
23

34
swift_install_in_component(editor-integration
45
FILES swift-mode.el

utils/lldb/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
configure_file(
3+
${CMAKE_CURRENT_SOURCE_DIR}/lldb-with-tools.in
4+
${CMAKE_CURRENT_BINARY_DIR}/lldb-with-tools
5+
@ONLY)
6+
7+
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/lldb-with-tools
8+
DESTINATION "${SWIFT_RUNTIME_OUTPUT_INTDIR}"
9+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
10+
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

utils/lldb/lldb-with-tools.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
lldb -O 'command script import "@SWIFT_SOURCE_DIR@/utils/lldb/lldbToolBox.py"' -- $@

utils/lldbToolBox.py renamed to utils/lldb/lldbToolBox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111

1212
REPO_BASE = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir,
13-
os.pardir))
13+
os.pardir, os.pardir))
1414
SWIFT_REPO = os.path.join(REPO_BASE, "swift")
1515
LLVM_REPO = os.path.join(REPO_BASE, "llvm")
1616
LLVM_DATAFORMATTER_PATH = os.path.join(LLVM_REPO, "utils",

0 commit comments

Comments
 (0)