Giter Club home page Giter Club logo

basset's Introduction

basset Gitpod ready-to-code

A tool that generates a compilation database for clang tooling using ptrace and procfs.

summary

If you are reading this you probably know what compilation database is and what it can be used for. And you are probably unlucky to use a build system that can't generate compile_commands.json for you. Your build system may even be especially non-cooperative defeating tools like bear, clade and compiledb. For example, build system may not respect injected CC and CXX environment variables, may hard-code compiler paths, may use statically linked binaries rendering LD_PRELOAD tricks useless or may not pass make flags recursively making build logs incomplete. There is however a less known compile-db-gen, which uses strace to capture compiler invocations and should work even in these conditions.

This project aims to improve on this idea:

  • to reduce overhead ptrace is used directly instead of strace;
  • working directory, executable path and arguments are read from procfs reducing code complexity.

disclaimer

It has been developed and tested on Linux. Whether it works on other systems is an open question. Your feedback (both positive and negative) is highly appreciated!

prerequisites

You will need make and C++ compiler.

compile

Simply:

make

It should produce basset executable in the project root directory.

install

Copy basset executable to a desired location or create a symlink.

use

A typical use would be:

basset -- <your-build-command>

Extra options can precede -- if needed.

basset's People

Contributors

d3m3t3r avatar i-ky avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

d3m3t3r

basset's Issues

Integrate with Bear

As mentioned in #4 (comment):

It is an option to "simply" integrate basset with bear as a low-level intercept mechanism, this way all high level functionality (like support for partial builds) will be automatically provided by bear. basset will focus entirely on intercepting the commands. See the relevant discussion.

I think this may be the best way forward. Bear is the leader among compilation database capturing tools, it is packaged for many platforms, it is widely known and feature-rich.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.