From ad4fed49e8bbde6c1e32948c23660aa54fae3262 Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 31 Dec 2015 13:21:45 +0100 Subject: [PATCH] Added lldb to README, install.md and fixed some minor compilation issues --- README.md | 2 ++ docs/install.md | 11 ++++++++--- src/debug.cc | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ef2e0f8..d1edf64 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ towards libclang with speed and ease of use in mind. ## Features * Platform independent +* Debug integration through lldb * Fast and responsive (written in C++) * Syntax highlighting for more than 100 different file types * C++ warnings and errors on the fly @@ -44,6 +45,7 @@ See [enhancements](https://github.com/cppit/jucipp/labels/enhancement) for plann * gtksourceviewmm-3.0 * aspell * libclang +* lldb * [libclangmm](http://github.com/cppit/libclangmm/) (downloaded directly with git --recursive, no need to install) * [tiny-process-library](http://github.com/eidheim/tiny-process-library/) (downloaded directly with git --recursive, no need to install) diff --git a/docs/install.md b/docs/install.md index 672e5f3..4263fbf 100644 --- a/docs/install.md +++ b/docs/install.md @@ -10,9 +10,11 @@ - [MSYS 2](#windows-with-msys2-httpsmsys2githubio) ## Debian/Ubuntu 15 +Note that if you use a different libclang version, be sure to install the same version of lldb (dev package). + Install dependencies: ```sh -sudo apt-get install git cmake make g++ libclang-dev pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev +sudo apt-get install git cmake make g++ libclang-dev liblldb-3.5-dev pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev sudo apt-get install clang-format-3.6 || sudo apt-get install clang-format-3.5 ``` @@ -66,9 +68,10 @@ make install ``` ## OS X with Homebrew (http://brew.sh/) -Install dependencies (installing llvm may take some time): +Install dependencies (installing llvm may take some time, and you need to follow the lldb code signing instructions): ```sh -brew install cmake --with-clang llvm pkg-config boost homebrew/x11/gtksourceviewmm3 aspell clang-format +brew install --with-clang --with-lldb llvm +brew install cmake pkg-config boost homebrew/x11/gtksourceviewmm3 aspell clang-format ``` Get juCi++ source, compile and install: @@ -82,6 +85,8 @@ make install ``` ##Windows with MSYS2 (https://msys2.github.io/) +Note that MSYS2 does not yet support lldb, but you can still compile juCi++ without debug support. + Install dependencies (replace `x86_64` with `i686` for 32-bit MSYS2 installs): ```sh pacman -S git mingw-w64-x86_64-cmake make mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceviewmm3 mingw-w64-x86_64-boost mingw-w64-x86_64-aspell mingw-w64-x86_64-aspell-en diff --git a/src/debug.cc b/src/debug.cc index 0a18dbb..a7c453b 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -16,7 +16,7 @@ using namespace std; //TODO: remove -extern const char **environ; +extern char **environ; void log(const char *msg, void *) { cout << "debugger log: " << msg << endl; @@ -47,7 +47,7 @@ void Debug::start(std::shared_ptr(new lldb::SBProcess(target.Launch(listener, nullptr, environ, nullptr, nullptr, nullptr, path.string().c_str(), lldb::eLaunchFlagNone, false, error))); + process = std::unique_ptr(new lldb::SBProcess(target.Launch(listener, nullptr, (const char**)environ, nullptr, nullptr, nullptr, path.string().c_str(), lldb::eLaunchFlagNone, false, error))); if(error.Fail()) { Terminal::get().async_print(std::string("Error (debug): ")+error.GetCString()+'\n', true); return; @@ -267,7 +267,7 @@ void Debug::remove_breakpoint(const boost::filesystem::path &file_path, int line auto breakpoint=target.GetBreakpointAtIndex(b_index); for(uint32_t l_index=0;l_index(line_nr_try)) { auto file_spec=line_entry.GetFileSpec(); boost::filesystem::path breakpoint_path=file_spec.GetDirectory(); breakpoint_path/=file_spec.GetFilename();