-
Notifications
You must be signed in to change notification settings - Fork 125
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
Enable python scripting in lldb #1362
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Package: python3-lldb-14 | ||
Section: Development | ||
Version: @DEB_LLVM_V@ | ||
Architecture: @DEB_ARCH@ | ||
Maintainer: @DEB_MAINTAINER@ | ||
Depends: python3.9 (= 3.9.9-1), libpython3.9 (= 3.9.9-1) | ||
Priority: optional | ||
Homepage: https://www.llvm.org/ | ||
Description: Next generation, high-performance debugger |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- llvm/lldb/bindings/interfaces.swig 2022-11-12 00:14:17.000000000 +0100 | ||
+++ llvm/lldb/bindings/interfaces.swig 2023-02-22 23:47:51.000000000 +0100 | ||
@@ -2,7 +2,6 @@ | ||
#define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ | ||
/* The ISO C99 standard specifies that in C++ implementations limit macros such | ||
as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ | ||
-#define __STDC_LIMIT_MACROS | ||
%include "stdint.i" | ||
|
||
%include "lldb/lldb-defines.h" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- llvm/lldb/bindings/python/python-typemaps.swig 2022-11-12 00:14:17.000000000 +0100 | ||
+++ llvm/lldb/bindings/python/python-typemaps.swig 2023-02-23 17:48:52.000000000 +0100 | ||
@@ -435,7 +435,7 @@ | ||
|
||
%typemap(out) lldb::FileSP { | ||
$result = nullptr; | ||
- lldb::FileSP &sp = $1; | ||
+ const lldb::FileSP &sp = $1; | ||
if (sp) { | ||
PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); | ||
if (!pyfile.IsValid()) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,6 +2,16 @@ ifneq ($(PROCURSUS),1) | |||||
$(error Use the main Makefile) | ||||||
endif | ||||||
|
||||||
#Checking if swig and python3 is installed | ||||||
HAS_COMMAND = $(shell type $(1) >/dev/null 2>&1 && echo 1) | ||||||
ifneq ($(call HAS_COMMAND,swig),1) | ||||||
$(error Install swig) | ||||||
endif | ||||||
ifneq ($(call HAS_COMMAND,python3),1) | ||||||
$(error Install python3) | ||||||
endif | ||||||
PYTHON3_PATH := $(shell which python3) | ||||||
|
||||||
#### Consider mlir/pstl/flang too | ||||||
|
||||||
SUBPROJECTS += llvm | ||||||
|
@@ -71,6 +81,8 @@ ifeq ($(wildcard $(BUILD_WORK)/../../native/llvm/.build_complete),) | |||||
touch $(BUILD_WORK)/../../native/llvm/.build_complete | ||||||
endif | ||||||
|
||||||
|
||||||
|
||||||
ifeq ($(wildcard $(BUILD_WORK)/llvm/build/.build_complete),) | ||||||
case $(MEMO_TARGET) in \ | ||||||
*"darwin"*) \ | ||||||
|
@@ -145,7 +157,8 @@ ifeq ($(wildcard $(BUILD_WORK)/llvm/build/.build_complete),) | |||||
-DLLDB_TABLEGEN_EXE="$(BUILD_WORK)/../../native/llvm/bin/lldb-tblgen" \ | ||||||
-DLLDB_BUILD_FRAMEWORK=OFF \ | ||||||
-DLLDB_ENABLE_LUA=OFF \ | ||||||
-DLLDB_ENABLE_PYTHON=OFF \ | ||||||
-DLLDB_PYTHON_RELATIVE_PATH="$(PYTHON3_PATH)" \ | ||||||
-DLLDB_ENABLE_PYTHON=ON \ | ||||||
-DSWIFT_DARWIN_DEPLOYMENT_VERSION_IOS="$(IPHONEOS_DEPLOYMENT_TARGET)" \ | ||||||
-DSWIFT_DARWIN_DEPLOYMENT_VERSION_OSX="$(MACOSX_DEPLYMENT_TARGET)" \ | ||||||
-DSWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS="$(WATCHOS_DEPLOYMENT_TARGET)" \ | ||||||
|
@@ -311,7 +324,7 @@ endif | |||||
# llvm.mk Prep liblldb-$(LLVM_MAJOR_V) | ||||||
mkdir -p $(BUILD_DIST)/liblldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib | ||||||
cp -a $(BUILD_STAGE)/llvm/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib/liblldb.$(LLVM_VERSION).dylib $(BUILD_DIST)/liblldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib | ||||||
|
||||||
# llvm.mk Prep liblldb-$(LLVM_MAJOR_V)-dev | ||||||
mkdir -p $(BUILD_DIST)/liblldb-$(LLVM_MAJOR_V)-dev/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/{include,lib} | ||||||
cp -a $(BUILD_STAGE)/llvm/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/include/lldb $(BUILD_DIST)/liblldb-$(LLVM_MAJOR_V)-dev/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/include | ||||||
|
@@ -332,10 +345,14 @@ endif | |||||
cp -a $(BUILD_STAGE)/llvm/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib/libLLVM.dylib $(BUILD_DIST)/libllvm$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib | ||||||
$(LN_S) libLLVM.dylib $(BUILD_DIST)/libllvm$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/lib/libLLVM-$(LLVM_MAJOR_V).dylib | ||||||
|
||||||
#llvm.mk Prep python3-lldb-$(LLVM_MAJOR_V) | ||||||
mkdir -p $(BUILD_DIST)/python3-lldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/local/lib/python3.9/dist-packages | ||||||
cp -a $(BUILD_STAGE)/llvm/opt/procursus/bin/python3/. $(BUILD_DIST)/python3-lldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/local/lib/python3.9/dist-packages/ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem correct... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They just didn't use the prefix variables. I don't like that period though.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it copying from bin to local/lib??? |
||||||
|
||||||
# llvm.mk Prep lldb-$(LLVM_MAJOR_V) | ||||||
mkdir -p $(BUILD_DIST)/lldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/bin | ||||||
cp -a $(BUILD_STAGE)/llvm/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/bin/lldb{,-argdumper,-instr,-server,-vscode} $(BUILD_DIST)/lldb-$(LLVM_MAJOR_V)/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/lib/llvm-$(LLVM_MAJOR_V)/bin | ||||||
|
||||||
# llvm.mk Prep lldb | ||||||
mkdir -p $(BUILD_DIST)/lldb/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/bin | ||||||
for bin in lldb{,-argdumper,-instr,-server,-vscode}; do \ | ||||||
|
@@ -415,8 +432,6 @@ endif | |||||
# llvm.mk Prep lld | ||||||
mkdir -p $(BUILD_DIST)/lld/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/bin | ||||||
$(LN_S) ../lib/llvm-$(LLVM_MAJOR_V)/bin/{ld.lld,ld64.lld,lld,lld-link,wasm-ld} $(BUILD_DIST)/lld/$(MEMO_PREFIX)$(MEMO_SUB_PREFIX)/bin/ | ||||||
|
||||||
|
||||||
# llvm.mk Sign | ||||||
$(call SIGN,clang-$(LLVM_MAJOR_V),general.xml) | ||||||
$(call SIGN,clangd-$(LLVM_MAJOR_V),general.xml) | ||||||
|
@@ -461,6 +476,7 @@ endif | |||||
$(call PACK,liblldb-$(LLVM_MAJOR_V),DEB_LLVM_V) | ||||||
$(call PACK,liblldb-$(LLVM_MAJOR_V)-dev,DEB_LLVM_V) | ||||||
$(call PACK,libllvm$(LLVM_MAJOR_V),DEB_LLVM_V) # Provides libllvm-polly | ||||||
$(call PACK,python3-lldb-$(LLVM_MAJOR_V),DEB_LLVM_V) | ||||||
$(call PACK,lldb-$(LLVM_MAJOR_V),DEB_LLVM_V) | ||||||
$(call PACK,lldb,DEB_LLVM_V) | ||||||
$(call PACK,swift-$(SWIFT_VERSION),DEB_SWIFT_V) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.