Browse Source

Added lldb to README, install.md and fixed some minor compilation issues

merge-requests/365/head
eidheim 10 years ago
parent
commit
ad4fed49e8
  1. 2
      README.md
  2. 11
      docs/install.md
  3. 6
      src/debug.cc

2
README.md

@ -8,6 +8,7 @@ towards libclang with speed and ease of use in mind.
## Features ## Features
* Platform independent * Platform independent
* Debug integration through lldb
* Fast and responsive (written in C++) * Fast and responsive (written in C++)
* Syntax highlighting for more than 100 different file types * Syntax highlighting for more than 100 different file types
* C++ warnings and errors on the fly * 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 * gtksourceviewmm-3.0
* aspell * aspell
* libclang * libclang
* lldb
* [libclangmm](http://github.com/cppit/libclangmm/) (downloaded directly with git --recursive, no need to install) * [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) * [tiny-process-library](http://github.com/eidheim/tiny-process-library/) (downloaded directly with git --recursive, no need to install)

11
docs/install.md

@ -10,9 +10,11 @@
- [MSYS 2](#windows-with-msys2-httpsmsys2githubio) - [MSYS 2](#windows-with-msys2-httpsmsys2githubio)
## Debian/Ubuntu 15 ## 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: Install dependencies:
```sh ```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 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/) ## 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 ```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: Get juCi++ source, compile and install:
@ -82,6 +85,8 @@ make install
``` ```
##Windows with MSYS2 (https://msys2.github.io/) ##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): Install dependencies (replace `x86_64` with `i686` for 32-bit MSYS2 installs):
```sh ```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 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

6
src/debug.cc

@ -16,7 +16,7 @@
using namespace std; //TODO: remove using namespace std; //TODO: remove
extern const char **environ; extern char **environ;
void log(const char *msg, void *) { void log(const char *msg, void *) {
cout << "debugger log: " << msg << endl; cout << "debugger log: " << msg << endl;
@ -47,7 +47,7 @@ void Debug::start(std::shared_ptr<std::vector<std::pair<boost::filesystem::path,
} }
lldb::SBError error; lldb::SBError error;
process = std::unique_ptr<lldb::SBProcess>(new lldb::SBProcess(target.Launch(listener, nullptr, environ, nullptr, nullptr, nullptr, path.string().c_str(), lldb::eLaunchFlagNone, false, error))); process = std::unique_ptr<lldb::SBProcess>(new lldb::SBProcess(target.Launch(listener, nullptr, (const char**)environ, nullptr, nullptr, nullptr, path.string().c_str(), lldb::eLaunchFlagNone, false, error)));
if(error.Fail()) { if(error.Fail()) {
Terminal::get().async_print(std::string("Error (debug): ")+error.GetCString()+'\n', true); Terminal::get().async_print(std::string("Error (debug): ")+error.GetCString()+'\n', true);
return; return;
@ -267,7 +267,7 @@ void Debug::remove_breakpoint(const boost::filesystem::path &file_path, int line
auto breakpoint=target.GetBreakpointAtIndex(b_index); auto breakpoint=target.GetBreakpointAtIndex(b_index);
for(uint32_t l_index=0;l_index<breakpoint.GetNumLocations();l_index++) { for(uint32_t l_index=0;l_index<breakpoint.GetNumLocations();l_index++) {
auto line_entry=breakpoint.GetLocationAtIndex(l_index).GetAddress().GetLineEntry(); auto line_entry=breakpoint.GetLocationAtIndex(l_index).GetAddress().GetLineEntry();
if(line_entry.GetLine()==line_nr_try) { if(line_entry.GetLine()==static_cast<uint32_t>(line_nr_try)) {
auto file_spec=line_entry.GetFileSpec(); auto file_spec=line_entry.GetFileSpec();
boost::filesystem::path breakpoint_path=file_spec.GetDirectory(); boost::filesystem::path breakpoint_path=file_spec.GetDirectory();
breakpoint_path/=file_spec.GetFilename(); breakpoint_path/=file_spec.GetFilename();

Loading…
Cancel
Save