endoli / lldb-sys.rs Goto Github PK
View Code? Open in Web Editor NEWLLDB bindings for Rust.
License: Apache License 2.0
LLDB bindings for Rust.
License: Apache License 2.0
Hi!
I'm a newbee to working on library-linked crates and my task is to make this package work in linux. Working on Ubuntu 16.04 64-bit I managed to make it work (still need some experience to send a good PR), however, main question is: why is this crate needs llvm source?
I mean there are bindings generated from LLDB API header files. These header files were taken from some version of LLDB. Is not it better to put all needed files (those are from lldb/include
, llvm/include
and build/include
). There is only one file (Compiler.h
from llvm
includes) that requires build/include
file and this include can be ignored.
What I did for the first time:
llvm
,lldb
into llvm/tools
clang
in llvm/tools
cmake
to generate /build
filesprintln!("cargo:rustc-link-lib=lldb-3.8");
instead of frameworks and setting needed env variables.What I did for the second time:
Compiler.h
In both cases I got working library that was used to run and close /bin/ls using LLDB (I had lldb 3.8 installed from http://apt.llvm.org/).
Are there reasons for llvm
header files to be excluded from this package?
Caveat: I'm used to using ptrace
and libdwarf
directly instead of using LLVM infrastructure, and am also a Rust newbie, so I could well be off the mark here.
Hi,
I've checked out and built LLVM, and set LLVM_ROOT
and LLVM_BUILD_ROOT
, essentially using the following abbreviated steps:
$ pwd
/Users/ntaylor/code
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm_project; mkdir build; cd build
$ cmake -DLLDB_INCLUDE_TESTS=OFF -DLLVM_ENABLE_PROJECTS="clang;lldb" -G "Unix Makefiles" ../llvm`
...
$ export LLVM_ROOT=~/code/llvm-project
$ export LLVM_BUILD_ROOT=~/code/llvm-project/build
However, I get the following lldb-sys
build error:
$ cargo build
Compiling lldb-sys v0.0.27
Compiling libc v0.2.107
The following warnings were emitted during compilation:
warning: In file included from src/lldb/UnityBuild.cpp:1:
warning: src/lldb/Bindings/SBAddressBinding.cpp:10:10: fatal error: 'lldb/API/LLDB.h' file not found
warning: #include "lldb/API/LLDB.h"
warning: ^~~~~~~~~~~~~~~~~
warning: 1 error generated.
error: failed to run custom build command for `lldb-sys v0.0.27`
A quick glance at where that header lives:
$ pwd
/Users/ntaylor/code/llvm-project
$ find . -name 'LLDB.h'
./lldb/include/lldb/API/LLDB.h
$
Not a problem to fix simply by copying that directory tree into my `build/ directory...
$ cp -r lldb/include/lldb build/include
$ find . -name 'LLDB.h'
./lldb/include/lldb/API/LLDB.h
./build/include/lldb/API/LLDB.h
$ cargo build
Compiling lldb-sys v0.0.27
Compiling lldb v0.0.10
Compiling ivydb v0.1.0 (/Users/ntaylor/code/ivydb)
Finished dev [unoptimized + debuginfo] target(s) in 1.43s
I wonder whether $LLVM_ROOT/build/include
should be passed to rustc to search for headers?
Thanks!
> lsb_release -a
Distributor ID: Pop
Description: Pop!_OS 20.10
Release: 20.10
Codename: groovy
> uname -a
Linux daniel-darter 5.11.0-7614-generic #15~1618626693~20.10~ecb25cd-Ubuntu SMP Thu Apr 22 16:00:45 UTC x86_64 x86_64 x86_64 GNU/Linux
> llvm-config --version
11.0.0
Reproduced on lldb-sys.rs HEAD, v0.0.21, and v0.0.20. Didn't check older.
> gh repo clone endoli/lldb-sys.rs
> cd lldb-sys.rs
> cargo build
src/lldb/Bindings/SBCommandInterpreterBinding.cpp: In function ‘SBCommandInterpreterRunOptionsOpaque* CreateSBCommandInterpreterRunOptions()’:
src/lldb/Bindings/SBCommandInterpreterBinding.cpp:22:99: error: invalid use of incomplete type ‘class lldb::SBCommandInterpreterRunOptions’
22 | return reinterpret_cast<SBCommandInterpreterRunOptionsRef>(new SBCommandInterpreterRunOptions());
| ^
In file included from /usr/lib/llvm-11/include/lldb/API/SBBreakpoint.h:12,
from src/lldb/Bindings/SBBreakpointBinding.h:15,
from src/lldb/Bindings/LLDBBinding.h:21,
from src/lldb/Bindings/SBCommandInterpreterBinding.cpp:10:
For functions which have been replaced by something else, should we still wrap the old versions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.