Giter Site home page Giter Site logo

kdab / codebrowser Goto Github PK

View Code? Open in Web Editor NEW
1.1K 53.0 158.0 1.1 MB

Woboq CodeBrowser

Home Page: http://woboq.com/codebrowser.html

License: Other

JavaScript 18.42% CSS 3.55% C++ 64.89% C 0.01% Shell 0.35% CMake 1.38% HTML 9.71% Python 1.70%
llvm clang woboq

codebrowser's Introduction

Logo

This is the generator for Code Browser, formerly created and maintained by Woboq, KDAB wants to thank Woboq to have made available such a great tool to the community in the first place. See https://codebrowser.dev/ for an example.

The announcement blog: https://woboq.com/blog/codebrowser-introduction.html

Introduction and Design

There is a pre-processing step on your code that generates static html and reference database. The output of this phase is just a set of static files that can be uploaded on any web hoster. No software is required on the server other than the most basic web server that can serve files.

While generating the code, you will give to the generator an output directory. The files reference themselves using relative path. The layout in the output directory will look like this: (Assuming the output directory is ~/public_html/mycode)

$OUTPUTDIR/../data/ or ~/public_html/data/ is where all javascript and css files are located. Those are static files shipped with the code browser, they are not generated.

$OUTPUTDIR/projectname or ~/public_html/mycode/projectname contains the generated html files for your project

$OUTPUTDIR/refs or ~/public_html/mycode/refs contains the generated "database" used for the tooltips

$OUTPUTDIR/include or ~/public_html/mycode/include contains the generated html files for the files in /usr/include

The idea is that you can have several project sharing the same output directory. In that case they will also share references and use searches will work between them.

Install via Arch User Repository (AUR)

Execute these commands in Arch Linux:

git clone https://aur.archlinux.org/woboq_codebrowser-git.git
cd woboq_codebrowser-git
makepkg -si

Compiling the generator on Linux

You need the clang libraries version 3.4 or later. You may want to sudo apt install llvm-7 clang-7 libclang-7-dev on Ubuntu if you ran into error like that clang says it cannot find "ClangConfig.cmake". More details in issues#74 .

Example:

mkdir build && cd build
cmake  -DCMAKE_BUILD_TYPE=Release ..
make

Compiling the generator on macOS

Install XCode and then the command line tools:

xcode-select --install

Install the clang libraries via homebrew:

brew install llvm --with-clang --rtti

Then compile the generator:

cmake . -DCMAKE_PREFIX_PATH=/usr/local/Cellar/llvm/<your_llvm_version> -DCMAKE_BUILD_TYPE=Release
make

Using the generator

Step 1: Generate the compile_commands.json (see chapter "Compilation Database" below) for your project

The code browser is built around the clang tooling infrastructure that uses compile_commands.json http://clang.llvm.org/docs/JSONCompilationDatabase.html

See the section "Compilation Database (compile_commands.json)" below.

Step 2: Create code HTML using codebrowser_generator

Before generating, make sure the output directory is empty or does not contains stale files from a previous generation.

Call the codebrowser_generator. See later for argument specification

Step 3: Generate the directory index HTML files using codebrowser_indexgenerator

By running the codebrowser_indexgenerator with the output directory as an argument

Step 4: Copy the static data/ directory one level above the generated html

Step 5: Open it in a browser or upload it to your webserver

Note: By default, browsers do not allow AJAX on file:// for security reasons. You need to upload the output directory on a web server, or serve your files with a local apache or nginx server. Alternatively, you can disable that security in Firefox by setting security.fileuri.strict_origin_policy to false in about:config (http://kb.mozillazine.org/Security.fileuri.strict_origin_policy) or start Chrome with the --allow-file-access-from-files option.

Full usage example

Let's be meta in this example and try to generate the HTML files for the code browser itself. Assuming you are in the cloned directory:

OUTPUT_DIRECTORY=~/public_html/codebrowser
DATA_DIRECTORY=$OUTPUT_DIRECTORY/../data
BUILD_DIRECTORY=$PWD
SOURCE_DIRECTORY=$PWD
VERSION=`git describe --always --tags`
cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
./generator/codebrowser_generator -b $BUILD_DIRECTORY -a -o $OUTPUT_DIRECTORY -p codebrowser:$SOURCE_DIRECTORY:$VERSION
./indexgenerator/codebrowser_indexgenerator $OUTPUT_DIRECTORY
cp -rv ./data $DATA_DIRECTORY

You can adjust the variables and try similar commands to generate other projects.

Arguments to codebrowser_generator

Compiles sources into HTML files

codebrowser_generator -a -o <output_dir> -b <buld_dir> -p <projectname>:<source_dir>[:<revision>] [-d <data_url>] [-e <remote_path>:<source_dir>:<remote_url>]
  • -a process all files from the compile_commands.json. If this argument is not passed, the list of files to process need to be passed
  • -o with the output directory where the generated files will be put
  • -b the "build directory" containing the compile_commands.json If this argument is not passed, the compilation arguments can be passed on the command line after --
  • -p (one or more) with project specification. That is the name of the project, the absolute path of the source code, and the revision separated by colons example: -p projectname:/path/to/source/code:0.3beta
  • -d specify the data url where all the javascript and css files are found. default to ../data relative to the output dir example: `-d https://codebrowser.dev/data/``
  • -e reference to an external project. example:-e clang/include/clang:/opt/llvm/include/clang/:https://codebrowser.dev/llvm

Arguments to codebrowser_indexgenerator

Generates index HTML files for each directory for the generated HTML files

codebrowser_indexgenerator <output_dir> [-d data_url] [-p project_definition]
  • -p (one or more) with project specification. That is the name of the project, the absolute path of the source code, and the revision separated by colons example: -p projectname:/path/to/source/code:0.3beta
  • -d specify the data url where all the javascript and css files are found. default to ../data relative to the output dir example: -d https://codebrowser.dev/data/

Compilation Database (compile_commands.json)

The generator is a tool which uses clang's LibTooling. It needs either a compile_commands.json or the arguments to be passed after '--' if they are the same for every file.

To generate the compile_commands.json:

  • For cmake, pass -DCMAKE_EXPORT_COMPILE_COMMANDS=ON as a cmake parameter
  • For qmake, configure/autoconf and others, follow the instructions in scripts/fake_compiler.sh or scripts/woboq_cc.js. These are fake compilers that append the compiler invocation to the json file and forward to the real compiler. Your real compiler is overriden using the CC/CXX environment variables Make sure to have the json file properly terminated.
  • If you use ninja, you can use ninja -t compdb
  • If you use qbs, you can use qbs generate --generator clangdb
  • There is also a project called Build EAR Bear that achieves a similar thing as our fake compilers but is using LD_PRELOAD to inject itself into the build process to catch how the compiler is invoked.

There is also some further information on https://sarcasm.github.io/notes/dev/compilation-database.html#clang

Getting help

No matter if you are a licensee or are just curious and evaulating, we'd love to help you. Ask us via e-mail on [email protected]

If you find a bug or incompatibility, please file a github issue: https://github.com/kdab/codebrowser/issues

Licence information

Licensees holding valid commercial licenses provided by Woboq may use this software in accordance with the terms contained in a written agreement between the licensee and Woboq.

Alternatively, this work may be used under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 (CC-BY-NC-SA 3.0) License. http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US

This license does not allow you to use the code browser to assist the development of your commercial software. If you intent to do so, consider purchasing a commercial licence.

codebrowser's People

Contributors

abigagli avatar arichardson avatar axel-naumann avatar azat avatar daniel-petrovic avatar driverczn avatar dschmidt avatar guruz avatar jissynacktiv avatar jsonn avatar jturcotte avatar knarf64 avatar krf avatar movie-travel-code avatar ogoffart avatar tempdban avatar txdv avatar waqar144 avatar yifu avatar yvbbrjdr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codebrowser's Issues

Make fails - error: no member named 'Adjust'

Woboq Codebrowser fails to build using the latest clang from git. Originally I thought the API had changed, but the documentation still reflects that

Steps to reproduce:

  1. Clone from github
  2. cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/home/jon/clang-llvm/build/bin/clang++ -DLLVM_CONFIG_EXECUTABLE=/home/jon/clang-llvm/build/bin/llvm-config
  3. make

Produces:
jon@shinkansen:~/code/woboq_codebrowser$ make
Scanning dependencies of target codebrowser_generator
[ 11%] Building CXX object generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
/home/jon/code/woboq_codebrowser/generator/main.cpp:238:77: error: no member named 'Adjust' in 'std::functionstd::vector<std::basic_string<char,
std::allocatorstd::basic_string > (const std::vectorstd::basic_string<char, std::allocatorstd::basic_string > &)>'
auto Ajust = [&](clang::tooling::ArgumentsAdjuster &&aj) { command = aj.Adjust(command); };
~~ ^
/home/jon/code/woboq_codebrowser/generator/main.cpp:239:27: error: no member named 'ClangSyntaxOnlyAdjuster' in namespace 'clang::tooling'; did you
mean 'getClangSyntaxOnlyAdjuster'?
Ajust(clang::tooling::ClangSyntaxOnlyAdjuster());
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
getClangSyntaxOnlyAdjuster
/usr/local/include/clang/Tooling/ArgumentsAdjusters.h:39:19: note: 'getClangSyntaxOnlyAdjuster' declared here
ArgumentsAdjuster getClangSyntaxOnlyAdjuster();
^
/home/jon/code/woboq_codebrowser/generator/main.cpp:240:27: error: no member named 'ClangStripOutputAdjuster' in namespace 'clang::tooling'; did you
mean 'getClangStripOutputAdjuster'?
Ajust(clang::tooling::ClangStripOutputAdjuster());
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
getClangStripOutputAdjuster
/usr/local/include/clang/Tooling/ArgumentsAdjusters.h:43:19: note: 'getClangStripOutputAdjuster' declared here
ArgumentsAdjuster getClangStripOutputAdjuster();
^
1 warning and 3 errors generated.
generator/CMakeFiles/codebrowser_generator.dir/build.make:54: recipe for target 'generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o' failed
make[2]: *** [generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:75: recipe for target 'generator/CMakeFiles/codebrowser_generator.dir/all' failed
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Replacing 'ClangSyntaxOnlyAdjuster' with 'getClangSyntaxOnlyAdjuster' and 'ClangStripOutputAdjuster' with 'getClangStripOutputAdjuster' sorts out the last 2 errors, but the first error about the 'Adjust' method should still exist on the 'ArgumentsAdjuster' class.

Only system header references get generated

I successfully built codebrowser_generator and codebrowser_indexgenerator using Xcode's clang with some minor tweaks (mainly adding -stdlib=libc++ flag to the indexgenerator's CMakeLists.txt). I tried, as in the example on the readme, to generate browse data for this same project, and everything seems to run fine, but I end up with just header files being browseable.
I.e. in my output folder I only have:
fileIndex
include
index.html
refs
And infact opening index.html in my browser I can only access all referenced (i.e. system) headers, not even the headers in the woboq project itself and no trace of any source file.
This happens with every other (small/medium/large) project I tried..
Any ideas?

Thanks,
Andrea.

CMake FindPackage error on Ubuntu 18.04.1 x64

When running "cmake . -DCMAKE_BUILD_TYPE=Release" it systematically halts with this error :
CMake Error at generator/CMakeLists.txt:7 (Find_Package):
Could not find a package configuration file provided by "Clang" with any of
the following names:

ClangConfig.cmake
clang-config.cmake

Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set
"Clang_DIR" to a directory containing one of the above files. If "Clang"
provides a separate development package or SDK, be sure it has been
installed.

I have packages clang + libllvm-6.0 + llvm-6.0 + llvm-6.0-runtime + libclang-6.0-dev + libclang1 + libclang-common-6.0-dev installed

building error with clang 8.0.0 / Arch

/usr/bin/ld: CMakeFiles/codebrowser_generator.dir/main.cpp.o: undefined reference to symbol '_ZN5clang22PCHContainerOperationsC1Ev'
/usr/bin/ld: /usr/lib/../lib/libclangSerialization.so.8: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [generator/CMakeFiles/codebrowser_generator.dir/build.make:212: generator/codebrowser_generator] Error 1
make[1]: *** [CMakeFiles/Makefile2:157: generator/CMakeFiles/codebrowser_generator.dir/all] Error 2

not sure if this was related to earlier clang issues.

build issue

I build your project on linux,clang 7.0.after type make,then some errors occurred.here is the the detail.
"generator/CMakeFiles/codebrowser_generator.dir/build.make:298: *** target pattern contains no '%'. Stop.
CMakeFiles/Makefile2:85: recipe for target 'generator/CMakeFiles/codebrowser_generator.dir/all' failed
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2"
can you help me with this?

Error: The file was not recognized as source code

Android NDK project: https://github.com/googlesamples/android-ndk/tree/66d64b4710291f289c05c52abdb0e2650af0f6f2/hello-jni
execute bear ndk-build to generate compile_commands.json, here is it's content:

[
    {
        "command": "cc -c -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -I/home/hsz/labs/test/cmake_android/hello-jni/jni -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security -I/home/hsz/App/android-ndk-r10e/platforms/android-3/arch-arm/usr/include -o /home/hsz/labs/test/cmake_android/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c", 
        "directory": "/home/hsz/labs/test/cmake_android/hello-jni/jni", 
        "file": "/home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c"
    }
]

then I execute these commands:

OUTPUTDIRECTORY=~/public_html/hello-jni
DATADIRECTORY=$OUTPUTDIRECTORY/../data
BUILDIRECTORY=~/labs/test/cmake_android/hello-jni/jni
VERSION=test
./generator/codebrowser_generator -b $BUILDIRECTORY -a -o $OUTPUTDIRECTORY -p codebrowser:$BUILDIRECTORY:$VERSION

and get this error:

Error: The file was not recognized as source code: /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c

what can I do to resolve this error?

generated files, located in build folder, are not part of a "project"

Hi,

when giving a project with -p <name>:<source_path>:<revision>, files generated during the build process (Qt for example does this) are not recognized by ProjectManager::projectForFile(). What I did locally is add a fourth option <builddir> to the -p` switch. Is this a way to go?

However this makes the exact location of the src-file in the build-tree visible in the generated Webpage....

Greetings.

Long file names issue

Some time ago I run into issue were linux prevented creating files that names were "too long".
As my project got over 3 milion lines of code and uses "some" of templates, problem were common.
I resolved it by changing some file names into md5 inside woboq.

Could something like this be implemented by default ? (or as a sommand line swich)

annotator.zip

compile error on OS X 10.10.5 Yosemite

[ 9%] Building CXX object generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o
In file included from /Users/Sumenia/Downloads/woboq_codebrowser-master/generator/main.cpp:39:
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:44:19: error:
unknown template name 'deque'
struct : std::deque<clang::Expr *> {
^
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:286:24: error:
no member named 'push_front' in 'BrowserASTVisitor::(anonymous struct at
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:44:5)'
expr_stack.push_front(e);
~~~~~~~~~~ ^
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:314:24: error:
no member named 'pop_front' in 'BrowserASTVisitor::(anonymous struct at
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:44:5)'
expr_stack.pop_front();
~~~~~~~~~~ ^
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:345:24: error:
invalid range expression of type 'BrowserASTVisitor::(anonymous struct at
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/browserastvisitor.h:44:5)';
no viable 'begin' function available
for (auto expr : expr_stack) {
^ ~~~~~~~~~~
/Users/Sumenia/Downloads/woboq_codebrowser-master/generator/main.cpp:333:50: error:
no member named 'fs' in namespace 'llvm::sys'
} else if (Sources.size() == 1 && llvm::sys::fs::is_directory(Source...
~~~~~~~~~~~^
5 errors generated.
make[2]: *** [generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o] Error 1
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
make: *** [all] Error 2

make error

I'm trying to build the 1.5 generator on ubuntu. I'm using clang 3.2 and gcc version 4.6.3. My cmake command is ...

cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_CONFIG_EXECUTABLE=/root/llvm32build/bin/llvm-config -DCMAKE_BUILD_TYPE=Release

The cmake seems to succeed. I'm getting this output on make ...

Scanning dependencies of target codebrowser_generator
[ 20%] Building CXX object CMakeFiles/codebrowser_generator.dir/main.cpp.o
cc1plus: error: unrecognized command line option รข-std=c++11รข
cc1plus: error: unrecognized command line option รข-std=c++11รข
make[2]: *** [CMakeFiles/codebrowser_generator.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/codebrowser_generator.dir/all] Error 2
make: *** [all] Error 2

What am I doing wrong?

.

fake_compiler works incorrectly on Bazel

I'm trying to create a doc for tensorflow.

First, it's hard to use a dummy gcc on Bazel. (you need to change a lot of things)

And, the simple scripts is not work for Bazel's complicated build command (like

  /home/yangff/woboq_codebrowser-master/scripts/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/home/yangff/woboq_codebrowser-master/scripts -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.d '-frandom-seed=bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.o' -fPIC -DEIGEN_MPL2_ONLY -iquote . -iquote bazel-out/local-py3-opt/genfiles -iquote external/eigen_archive -iquote bazel-out/local-py3-opt/genfiles/external/eigen_archive -iquote external/bazel_tools -iquote bazel-out/local-py3-opt/genfiles/external/bazel_tools -iquote external/protobuf -iquote bazel-out/local-py3-opt/genfiles/external/protobuf -iquote external/com_googlesource_code_re2 -iquote bazel-out/local-py3-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/local-py3-opt/genfiles/external/farmhash_archive -iquote external/gif_archive -iquote bazel-out/local-py3-opt/genfiles/external/gif_archive -iquote external/highwayhash -iquote bazel-out/local-py3-opt/genfiles/external/highwayhash -iquote external/jpeg_archive -iquote bazel-out/local-py3-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local-py3-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/local-py3-opt/genfiles/external/zlib_archive -isystem external/eigen_archive -isystem bazel-out/local-py3-opt/genfiles/external/eigen_archive -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/protobuf/src -isystem bazel-out/local-py3-opt/genfiles/external/protobuf/src -isystem external/farmhash_archive -isystem bazel-out/local-py3-opt/genfiles/external/farmhash_archive -isystem external/gif_archive -isystem bazel-out/local-py3-opt/genfiles/external/gif_archive -isystem external/highwayhash -isystem bazel-out/local-py3-opt/genfiles/external/highwayhash -isystem external/jpeg_archive -isystem bazel-out/local-py3-opt/genfiles/external/jpeg_archive -isystem external/png_archive -isystem bazel-out/local-py3-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/local-py3-opt/genfiles/external/zlib_archive -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/core/kernels/avgpooling_op.cc -o bazel-out/local-py3-opt/bin/tensorflow/core/kernels/_objs/pooling_ops/tensorflow/core/kernels/avgpooling_op.pic.o)

)

I've a idea for it, use --subcommands and recover compile info from it. I'm trying this and if I success I will post it here.

Cannot work properly with Glibc source code

I tried to achieve similiar effects like your official website showing..
The GNU C Library Source Code but the Source Code was configured to build with make instead of cmake.

I tried bear make to generate a compile_commands.json as well ,
but after the generation of html, I cannot view my source code properly..
All is just a simple index.html page generated by indexgenerator.
So.. What do I need to do to put my Glibc Source code into the Browser?
Oh, I tried to manually visit the generated html , it seems that it works just fun.
But I just wonder why the index.html cannot properly indicate the positions..
Just like this pic below:
_20180728204141

I used the following command:
codebrowser_generator -b /var/www/html/CodeBrow/glibc-2.23/build -a -o ../srcs -p glibc:/var/www/html/CodeBrow/glibc-2.23:2.23

codebrowser_indexgenerator /var/www/html/CodeBrow/glibc-2.23 && cp ./index.html ./srcs

and visit the /srcs/index.html, got the above result..

Cross compiler support

I've succeeded in browsing x86-linux with codebrowser. But when trying on arm-linux, I found only files that compiled by host gcc were indexed.
Those files compiled by cross compiler are recorded in compiler_commands.json but the generator skipped them during proccessing.
How can I use the codebrowser on cross-compiling project?

Crash in handleUrlsInComment

There is access to -1 index of string somwhere.
Had problem to track it down, but as workaround I added index checking:

280 static void handleUrlsInComment(Generator& generator, llvm::StringRef rawString, int commentStart)
281 {
282     std::size_t pos = 0;
283     while ((pos = rawString.find("http", pos)) != llvm::StringRef::npos) {
284         int begin = pos;
285         pos +=4;
286         if (begin != 0 && llvm::StringRef(" \t/*[]()<>|:\"'{}").find(rawString[begin-1]) == llvm::StringRef::npos) {
287             // the URL need to be the first character, or follow a space or one of the character
288             continue;
289         }
290         if (rawString[pos] == 's') pos++;
291         if (!rawString.substr(pos).startswith("://"))
292             continue;
293         pos+=3;
294         // We have an URL
295
296         llvm::StringRef urlChars = "-._~:/?#[]@!$&'()*+,;=%"; // chars valid in the URL
297         while(pos>=0 && (pos+1) < rawString.size() && (std::isalnum(rawString[pos]) ||
298                 urlChars.find(rawString[pos]) != llvm::StringRef::npos))
299             pos++;
300
301         // don't end with a period
302         if (pos>0 && rawString[pos-1]=='.') pos--;
303
304         // Don't end with a closing parenthese or bracket unless the URL contains an opening one
305         // (e.g. wikipedia urls)
306         auto candidate = rawString.substr(begin, pos-begin);
307         if (pos > 0 && rawString[pos-1]==')' && candidate.find('(') == llvm::StringRef::npos) pos--;
308         if (pos > 0 && rawString[pos-1]==']' && candidate.find('[') == llvm::StringRef::npos) pos--;
309
310         // don't end with a period
311         if (pos > 0 && rawString[pos-1]=='.') pos--;
312
313         auto len = pos - begin;
314         generator.addTag("a", "href=\"" % rawString.substr(begin, len) % "\"",
315                          commentStart+begin, len);
316     }
317
318 }

compiler error with clang 3.9 On Ubuntu

In file included from /mnt/opensource/woboq_codebrowser/generator/preprocessorcallback.cpp:22:
In file included from /mnt/opensource/woboq_codebrowser/generator/preprocessorcallback.h:24:
In file included from /usr/local/llvm/include/clang/Lex/PPCallbacks.h:18:
In file included from /usr/local/llvm/include/clang/Basic/DiagnosticIDs.h:18:
In file included from /usr/local/llvm/include/clang/Basic/LLVM.h:22:
In file included from /usr/local/llvm/include/llvm/Support/Casting.h:19:
In file included from /usr/local/llvm/include/llvm/Support/type_traits.h:17:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/type_traits:549:38: error: incomplete type 'clang::TagDecl' used in type trait
      expression
    : public integral_constant<bool, __is_abstract(_Tp)>
                                     ^
/usr/local/llvm/include/llvm/Support/AlignOf.h:28:35: note: in instantiation of template class 'std::is_abstract<clang::TagDecl>' requested
      here
template <typename T, bool = std::is_abstract<T>::value>
                                  ^
/usr/local/llvm/include/llvm/Support/AlignOf.h:79:22: note: in instantiation of default argument for 'AlignmentCalcImpl<clang::TagDecl>'
      required here
      sizeof(detail::AlignmentCalcImpl<T>) - sizeof(T));
                     ^~~~~~~~~~~~~~~~~~~~
/usr/local/llvm/include/llvm/Support/PointerLikeTypeTraits.h:45:48: note: in instantiation of template class 'llvm::AlignOf<clang::TagDecl>'
      requested here
    NumLowBitsAvailable = detail::ConstantLog2<AlignOf<T>::Alignment>::value
                                               ^
/usr/local/llvm/include/llvm/Support/PointerLikeTypeTraits.h:74:32: note: in instantiation of template class
      'llvm::PointerLikeTypeTraits<clang::TagDecl *>' requested here
  enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
                               ^
/usr/local/llvm/include/llvm/ADT/DenseMapInfo.h:38:13: note: in instantiation of template class 'llvm::PointerLikeTypeTraits<const
      clang::TagDecl *>' requested here
    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
            ^
/usr/local/llvm/include/llvm/ADT/DenseMap.h:344:22: note: in instantiation of member function 'llvm::DenseMapInfo<const clang::TagDecl
      *>::getEmptyKey' requested here
    return KeyInfoT::getEmptyKey();
                     ^
/usr/local/llvm/include/llvm/ADT/DenseMap.h:283:27: note: in instantiation of member function 'llvm::DenseMapBase<llvm::DenseMap<const
      clang::TagDecl *, unsigned long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const clang::TagDecl *, unsigned
      long> >, const clang::TagDecl *, unsigned long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const
      clang::TagDecl *, unsigned long> >::getEmptyKey' requested here
    const KeyT EmptyKey = getEmptyKey();
                          ^
/usr/local/llvm/include/llvm/ADT/DenseMap.h:614:20: note: in instantiation of member function 'llvm::DenseMapBase<llvm::DenseMap<const
      clang::TagDecl *, unsigned long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const clang::TagDecl *, unsigned
      long> >, const clang::TagDecl *, unsigned long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const
      clang::TagDecl *, unsigned long> >::initEmpty' requested here
      this->BaseT::initEmpty();
                   ^
/usr/local/llvm/include/llvm/ADT/DenseMap.h:554:5: note: in instantiation of member function 'llvm::DenseMap<const clang::TagDecl *, unsigned
      long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const clang::TagDecl *, unsigned long> >::init' requested
      here
    init(NumInitBuckets);
    ^
/usr/local/llvm/include/clang/AST/Mangle.h:62:12: note: in instantiation of member function 'llvm::DenseMap<const clang::TagDecl *, unsigned
      long, llvm::DenseMapInfo<const clang::TagDecl *>, llvm::detail::DenseMapPair<const clang::TagDecl *, unsigned long> >::DenseMap'
      requested here
  explicit MangleContext(ASTContext &Context,
           ^
/usr/local/llvm/include/clang/AST/Type.h:82:9: note: forward declaration of 'clang::TagDecl'
  class TagDecl;
        ^

(master) ฮป clang --version                                                                                   
clang version 3.9.0 (http://llvm.org/git/clang.git ec70889fd09a86cd8a2bca6f759569b13ba8eef5) (https://github.com/llvm-mirror/llvm 5fd06e2add51876b9f9d61a84397a8e68cce6970)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm/bin

cstdio, map and some other stl header files are not found

Hello, the woboq generator works fine with most files, it seems something wrong with stl headers.

I just get following errors:

FATAL Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./type_traits.h:11: 'type_traits' file not found
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:359: no member named 'unordered_map' in namespace 'std'
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:359: 'K' does not refer to a value
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:360: expected ';' at end of declaration
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:360: expected unqualified-id
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:364: no member named 'unordered_multimap' in namespace 'std'
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:364: 'K' does not refer to a value
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:365: expected ';' at end of declaration
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:365: expected unqualified-id
Error: /Users/superjom/mxnet/dmlc-core/include/dmlc/./serializer.h:369: no member named 'unordered_set' in namespace 'std'

I inserted -I /usr/include/c++/4.2.1 to all records lists in compile_commands.json , but that didn't work.

Multiple compilers

It seems that the generator look into /usr/include to search include files that is the path where the default compiler put header files. On the other hand in case I have a second compiler I did not find a way to redirect such include paths to the correct place.

Is there a way to do it ?

Adding general "search" option

I was wondering if it is possible (and if you had any plans) to add a general "search" option that can just search for things in the codebase. Examples might be searching in comments, or searching for things like someVariable->someFunction(), etc. It would be nice to use something like what Hound uses (the trigram index): https://github.com/etsy/hound

bad_alloc when reserving a string

Hi o/

I use woboq in a normal way and got this as output:

Program received signal SIGSEGV, Segmentation fault.
operator std::string (this=0x7fffffffc7f0) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/stringbuilder.h:11
11          s.reserve(size());
(gdb) bt
#0  operator std::string (this=0x7fffffffc7f0) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/stringbuilder.h:11
#1  tag (ref=..., range=..., className=..., this=0x7fffffffc930) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:230
#2  visitInlineCommandComment (C=0x65a3530, this=0x7fffffffc930) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:167
#3  clang::comments::CommentVisitorBase<clang::comments::make_const_ptr, CommentHandler::CommentVisitor, void>::visit (this=this@entry=0x7fffffffc930, 
    C=C@entry=0x65a3530) at /usr/lib/llvm-3.4/include/clang/AST/CommentNodes.inc:99
#4  0x00000000005b62a8 in visit (C=0x65a3530, this=0x7fffffffc930) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:159
#5  visit (C=0x65a35b0, this=0x7fffffffc930) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:161
#6  visit (C=0x65a3630, this=0x7fffffffc930) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:161
#7  CommentHandler::handleComment (this=0x135dfe0, A=..., generator=..., Sema=..., 
    bufferStart=bufferStart@entry=0x13a7810 "// Standard iostream objects -*- C++ -*-\n\n// Copyright (C) 1997-2013 Free Software Foundation, Inc.\n//\n// This file is part of the GNU ISO C++ Library.  This library is free\n// software; you can redis"..., commentStart=commentStart@entry=1082, len=len@entry=130, 
    searchLocBegin=..., searchLocEnd=..., commentLoc=...) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/commenthandler.cpp:267
#8  0x00000000005a1ccb in Annotator::syntaxHighlight (this=this@entry=0x135deb8, generator=..., FID=..., FID@entry=..., Sema=...)
    at /home/opennao/woboq/woboq_codebrowser-1.7/generator/annotator.cpp:906
#9  0x00000000005a6ddc in Annotator::generate (this=this@entry=0x135deb8, Sema=..., WasInDatabase=true)
    at /home/opennao/woboq/woboq_codebrowser-1.7/generator/annotator.cpp:236
#10 0x000000000059ef5b in BrowserASTConsumer::HandleTranslationUnit (this=0x135dea0, Ctx=...)
    at /home/opennao/woboq/woboq_codebrowser-1.7/generator/main.cpp:169
#11 0x0000000000b375ab in clang::ParseAST(clang::Sema&, bool, bool) ()
#12 0x00000000005ba1a9 in clang::FrontendAction::Execute() ()
#13 0x00000000005d7202 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#14 0x0000000000d08150 in clang::tooling::FrontendActionFactory::runInvocation(clang::CompilerInvocation*, clang::FileManager*, clang::DiagnosticConsumer*) ()
#15 0x0000000000d07120 in clang::tooling::ToolInvocation::run() ()
#16 0x000000000058b0b0 in proceedCommand (command=..., Directory=..., FM=FM@entry=0x7fffffffe080, MainExecutable=..., WasInDatabase=WasInDatabase@entry=true)
    at /home/opennao/woboq/woboq_codebrowser-1.7/generator/main.cpp:247
#17 0x0000000000587d73 in main (argc=8, argv=<optimized out>) at /home/opennao/woboq/woboq_codebrowser-1.7/generator/main.cpp:352

I use a cross toolchain and I got (but doesn't seems related):

FATAL Error: /usr/include/limits.h:123: 'limits.h' file not found

Thanks ;)

Make woes on OS X

make
-- LLVM CXX flags: -I/usr/local/Cellar/llvm/3.1/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3  -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual
-- LLVM LD flags: -L/usr/local/Cellar/llvm/3.1/lib  -lpthread -lm
-- LLVM core libs: -lLLVMAsmParser -lLLVMTableGen -lLLVMDebugInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInstrumentation -lLLVMInterpreter -lLLVMCodeGen -lLLVMipo -lLLVMVectorize -lLLVMScalarOpts -lLLVMInstCombine -lLLVMLinker -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMArchive -lLLVMBitReader -lLLVMBitWriter -lLLVMMCJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport
-- LLVM JIT libs: -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport
-- LLVM JIT objs: 
-- Found LLVM: /usr/local/Cellar/llvm/3.1/include
-- Clang libs: /usr/local/lib/libclangFrontend.a/usr/local/lib/libclangDriver.a/usr/local/lib/libclangCodeGen.a/usr/local/lib/libclangSema.a/usr/local/lib/libclangAnalysis.a/usr/local/lib/libclangRewrite.a/usr/local/lib/libclangAST.a/usr/local/lib/libclangParse.a/usr/local/lib/libclangLex.a/usr/local/lib/libclangBasic.a/usr/local/lib/libclangARCMigrate.a/usr/local/lib/libclangEdit.a/usr/local/lib/libclangFrontendTool.a/usr/local/lib/libclangRewrite.a/usr/local/lib/libclangSerialization.a/usr/local/lib/libclangTooling.a/usr/local/lib/libclangStaticAnalyzerCheckers.a/usr/local/lib/libclangStaticAnalyzerCore.a/usr/local/lib/libclangStaticAnalyzerFrontend.a/usr/local/lib/libclangSema.a
-- Found Clang: /usr/local/Cellar/llvm/3.1/include
-- Boost version: 1.51.0
-- Found the following Boost libraries:
--   filesystem
--   system
--   date_time
-- Boost version: 1.51.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/hadley/Desktop/woboq_codebrowser
[ 20%] Building CXX object generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o
clang: warning: -lpthread: 'linker' input unused when '-c' is present
clang: warning: -lm: 'linker' input unused when '-c' is present
clang: warning: argument unused during compilation: '-L/usr/local/Cellar/llvm/3.1/lib'
In file included from /Users/hadley/Desktop/woboq_codebrowser/generator/main.cpp:37:
/Users/hadley/Desktop/woboq_codebrowser/generator/annotator.h:27:10: fatal error: 
      'unordered_map' file not found
#include <unordered_map>
         ^
1 error generated.
make[2]: *** [generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o] Error 1
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
make: *** [all] Error 2

Any ideas? I've installed clang and cmake from homebrew.

list lib dependencies

Hello,
I had to install those on ubuntu in order to compile the project:

sudo apt-get install libclang-3.5-dev
sudo apt-get install libz-dev
sudo apt-get install libedit-dev
sudo apt-get install libqt4-dev

While clang was clearly mentioned in the readme, the others lib are not. Could we add them ? :-)

regards
yves

2.01 compile error on Ubuntu 14.04 / Clang 3.4

Hi,
Last time I compiled was v1.9 and all was good.

Now it says
$ make [ 11%] Building CXX object generator/CMakeFiles/codebrowser_generator.dir/projectmanager.cpp.o /home/asd/woboq_codebrowser/generator/projectmanager.cpp: In member function โ€˜std::string ProjectManager::includeRecovery(llvm::StringRef, llvm::StringRef)โ€™: /home/asd/woboq_codebrowser/generator/projectmanager.cpp:81:79: error: no matching function for call to โ€˜llvm::sys::fs::recursive_directory_iterator::recursive_directory_iterator(llvm::StringRef&, std::error_code&)โ€™ for (llvm::sys::fs::recursive_directory_iterator it(sourcePath, EC), DirEnd; ^ /home/asd/woboq_codebrowser/generator/projectmanager.cpp:81:79: note: candidates are: In file included from /home/asd/woboq_codebrowser/generator/filesystem.h:26:0, from /home/asd/woboq_codebrowser/generator/projectmanager.cpp:23: /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:912:12: note: llvm::sys::fs::recursive_directory_iterator::recursive_directory_iterator(const llvm::Twine&, llvm::error_code&) explicit recursive_directory_iterator(const Twine &path, error_code &ec) ^ /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:912:12: note: no known conversion for argument 2 from โ€˜std::error_codeโ€™ to โ€˜llvm::error_code&โ€™ /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:911:3: note: llvm::sys::fs::recursive_directory_iterator::recursive_directory_iterator() recursive_directory_iterator() {} ^ /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:911:3: note: candidate expects 0 arguments, 2 provided /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:907:7: note: llvm::sys::fs::recursive_directory_iterator::recursive_directory_iterator(const llvm::sys::fs::recursive_directory_iterator&) class recursive_directory_iterator { ^ /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:907:7: note: candidate expects 1 argument, 2 provided /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:907:7: note: llvm::sys::fs::recursive_directory_iterator::recursive_directory_iterator(llvm::sys::fs::recursive_directory_iterator&&) /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:907:7: note: candidate expects 1 argument, 2 provided /home/asd/woboq_codebrowser/generator/projectmanager.cpp:82:57: error: no matching function for call to โ€˜llvm::sys::fs::recursive_directory_iterator::increment(std::error_code&)โ€™ it != DirEnd && !EC; it.increment(EC)) { ^ /home/asd/woboq_codebrowser/generator/projectmanager.cpp:82:57: note: candidate is: In file included from /home/asd/woboq_codebrowser/generator/filesystem.h:26:0, from /home/asd/woboq_codebrowser/generator/projectmanager.cpp:23: /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:919:33: note: llvm::sys::fs::recursive_directory_iterator& llvm::sys::fs::recursive_directory_iterator::increment(llvm::error_code&) recursive_directory_iterator &increment(error_code &ec) { ^ /usr/lib/llvm-3.4/include/llvm/Support/FileSystem.h:919:33: note: no known conversion for argument 1 from โ€˜std::error_codeโ€™ to โ€˜llvm::error_code&โ€™ make[2]: *** [generator/CMakeFiles/codebrowser_generator.dir/projectmanager.cpp.o] Error 1 make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2 make: *** [all] Error 2

Any idea what's wrong?

Compatible versions of llvm clang

I compiled woboq_codebrowser against llvm and clang master (8.0.0) and I get a segfault right away when I attempt to generate. I also had problems using llvm/clang from devtoolset-7. I'm on Centos 7 (the system repo llvm and clang are missing cmake modules, so cmake of this project fails right away).

It's probably best that I compile a version of llvm and clang that's known to work with woboq. What is recommended?

building errors with msys2/clang

For MinGW I used cmake -G "MSYS Makefiles". I had to add "typedef int uint" and work around realpath (with _fullpath) and mkdir (remove file code) to compile. However I am flummoxed by the linking errors:

C:\alt\msys32\mingw32\bin/../lib\libclangFrontend.a(FrontendAction.o):(.text$_ZN5clang14FrontendAction15BeginInvocationERNS_16CompilerInstanceE[__ZN5clang14FrontendAction15BeginInvocationERNS_16CompilerInstanceE]+0x0): multiple definition of `clang::FrontendAction::BeginInvocation(clang::CompilerInstance&)'
CMakeFiles/codebrowser_generator.dir/objects.a(main.cpp.obj):C:/alt/msys32/mingw32/include\clang/Frontend/FrontendAction.h:73: first defined here

And there are lots of this. Any idea on how to address this?

ERROR๏ผšnot support utf8, can't see chinese char

source, adlist.h

/*

  • ๅŒ็ซฏ้“พ่กจ็ป“ๆž„
    */
    typedef struct list {

    // ่กจๅคด่Š‚็‚น
    listNode *head;

    // ่กจๅฐพ่Š‚็‚น
    listNode *tail;

    // ่Š‚็‚นๅ€ผๅคๅˆถๅ‡ฝๆ•ฐ
    void _(_dup)(void *ptr);

    // ่Š‚็‚นๅ€ผ้‡Šๆ”พๅ‡ฝๆ•ฐ
    void (*free)(void *ptr);

    // ่Š‚็‚นๅ€ผๅฏนๆฏ”ๅ‡ฝๆ•ฐ
    int (*match)(void *ptr, void *key);

    // ้“พ่กจๆ‰€ๅŒ…ๅซ็š„่Š‚็‚นๆ•ฐ้‡
    unsigned long len;

} list;

output, adlist.h.html

/*
66 * ้™ๅฒ€๎ฌ้–พๆใ€ƒ็ผๆ’ด็€ฏ
67 _/
68 typedef struct list {
69
70 // ็›ใ„ฅใ”้‘บๅ‚œๅฃ
71 listNode *head;
72
73 // ็›ใ„ฅ็†ฌ้‘บๅ‚œๅฃ
74 listNode *tail;
75
76 // ้‘บๅ‚œๅฃ้Š็…Ž๎˜ฒ้’่ทบๅšฑ้๏ฟฝ
77 void *(_dup)(void _ptr);
78
79 // ้‘บๅ‚œๅฃ้Šๅฅธๅ™ด้€ๆƒงๅšฑ้๏ฟฝ
80 void (_free)(void _ptr);
81
82 // ้‘บๅ‚œๅฃ้Š็…Ž๎‡ฎๅงฃๆ–ฟๅšฑ้๏ฟฝ
83 int (_match)(void *ptr, void *key);
84
85 // ้–พๆใ€ƒ้Žตโ‚ฌ้–ๅ‘ญๆƒˆ้จๅ‹ฎๅฆญ้่ง„ๆšŸ้–ฒ๏ฟฝ
86 unsigned long len;
87
88 } list;

Install instructions omit boost dependency

I get

...
-- Found Clang: /usr/local/Cellar/llvm/3.1/include
CMake Error at /usr/local/Cellar/cmake/2.8.9/share/cmake/Modules/FindBoost.cmake:1191 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.

linking errors while compiling woboq_codebrowser on ubuntu 16.04

I have installed clang-3.8
using

sudo apt-get install clang
sudo apt install libclang-3.8-dev

then tried building woboq_codebrowser

cmake . -DLLVM_CONFIG_EXECUTABLE= /usr/bin/llvm-config-3.8 -DCMAKE_BUILD_TYPE=Release
make

I'm getting linking errors related to clang

/usr/lib/llvm-3.8/include/clang/Basic/SourceManager.h:1516: undefined reference to `clang::SourceManager::loadSLocEntry(unsigned int, bool*) const'
/usr/lib/llvm-3.8/include/clang/Basic/SourceManager.h:1516: undefined reference to `clang::SourceManager::loadSLocEntry(unsigned int, bool*) const'
/usr/lib/llvm-3.8/include/clang/Basic/SourceManager.h:1516: undefined reference to `clang::SourceManager::loadSLocEntry(unsigned int, bool*) const'
/usr/lib/llvm-3.8/include/clang/Basic/SourceManager.h:1516: undefined reference to `clang::SourceManager::loadSLocEntry(unsigned int, bool*) const'
CMakeFiles/codebrowser_generator.dir/commenthandler.cpp.o:/usr/lib/llvm-3.8/include/clang/Basic/SourceManager.h:1516: more undefined references to `clang::SourceManager::loadSLocEntry(unsigned int, bool*) const' follow
CMakeFiles/codebrowser_generator.dir/commenthandler.cpp.o: In function `CommentHandler::handleComment(Annotator&, Generator&, clang::Sema&, char const*, int, int, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation)':
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:348: undefined reference to `clang::comments::CommandTraits::CommandTraits(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, clang::CommentOptions const&)'
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:349: undefined reference to `clang::comments::CommandTraits::registerBlockCommand(llvm::StringRef)'
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:354: undefined reference to `clang::comments::Lexer::Lexer(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, clang::DiagnosticsEngine&, clang::comments::CommandTraits const&, clang::SourceLocation, char const*, char const*)'
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:355: undefined reference to `clang::comments::Sema::Sema(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, clang::SourceManager const&, clang::DiagnosticsEngine&, clang::comments::CommandTraits&, clang::Preprocessor const*)'
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:357: undefined reference to `clang::comments::Parser::Parser(clang::comments::Lexer&, clang::comments::Sema&, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, clang::SourceManager const&, clang::DiagnosticsEngine&, clang::comments::CommandTraits const&)'
/home/jkl/Downloads/woboq_codebrowser/generator/commenthandler.cpp:358: undefined reference to `clang::comments::Parser::parseFullComment()'
collect2: error: ld returned 1 exit status
generator/CMakeFiles/codebrowser_generator.dir/build.make:276: recipe for target 'generator/codebrowser_generator' failed
make[2]: *** [generator/codebrowser_generator] Error 1
CMakeFiles/Makefile2:85: recipe for target 'generator/CMakeFiles/codebrowser_generator.dir/all' failed
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I have gcc 5.4
when I searched online it seems there are incompatibilities clang3.8 and gcc 5.3
https://www.reddit.com/r/cpp/comments/442b38/clang_38_gcc_53_incompatibilities/

Does not validate presence of headers

When compiling, I get

Scanning dependencies of target codebrowser_indexgenerator
Scanning dependencies of target codebrowser_generator
[ 11%] Building CXX object indexgenerator/CMakeFiles/codebrowser_indexgenerator.dir/indexer.cpp.o
[ 44%] [ 44%] [ 44%] Building CXX object generator/CMakeFiles/codebrowser_generator.dir/main.cpp.o
Building CXX object generator/CMakeFiles/codebrowser_generator.dir/annotator.cpp.o
Building CXX object generator/CMakeFiles/codebrowser_generator.dir/projectmanager.cpp.o
In file included from /home/soos/tmp/woboq_codebrowser-master/generator/annotator.cpp:22:0:
/home/soos/tmp/woboq_codebrowser-master/generator/annotator.h:24:40: fatal error: clang/Basic/SourceLocation.h: No such file or directory
 #include <clang/Basic/SourceLocation.h>
                                        ^
compilation terminated.

Which means that I don't have the headers for clang, but cmake failed to validate this. It should have stopped there and told me that it's missing the headers.

Half of building a system is stuff like this :S I wish it was different, but alas, it's unfortunately not :(

Assertion failure in shared_ptr on Fedora 28

/usr/include/c++/8/bits/shared_ptr_base.h:989: std::__shared_ptr_access<_Tp,
_Lp, <anonymous>, <anonymous> >::element_type& std::__shared_ptr_access<_Tp,
_Lp, <anonymous>, <anonymous> >::operator*() const [with _Tp =
llvm::sys::fs::detail::DirIterState; __gnu_cxx::_Lock_policy _Lp =
(__gnu_cxx::_Lock_policy)2; bool <anonymous> = false; bool <anonymous> = false;
std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type =
llvm::sys::fs::detail::DirIterState]: Assertion '_M_get() != nullptr' failed.

where:

#0  0x00007ffff2050eab in raise () from /lib64/libc.so.6
#1  0x00007ffff203b5b9 in abort () from /lib64/libc.so.6
#2  0x00007ffff679ea78 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libclangBasic.so.6
#3  0x00007ffff6814d36 in (anonymous namespace)::RealFileSystem::dir_begin(llvm::Twine const&, std::error_code&) () from /lib64/libclangBasic.so.6
#4  0x00007ffff1d705fa in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(llvm::Triple const&, llvm::opt::ArgList const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::StringRef, bool) () from /lib64/../lib64/libclangDriver.so.6
#5  0x00007ffff1d72035 in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::init(llvm::Triple const&, llvm::opt::ArgList const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) () from /lib64/../lib64/libclangDriver.so.6
#6  0x00007ffff1d7d539 in clang::driver::toolchains::Linux::Linux(clang::driver::Driver const&, llvm::Triple const&, llvm::opt::ArgList const&) ()
   from /lib64/../lib64/libclangDriver.so.6
#7  0x00007ffff1cd264f in clang::driver::Driver::getToolChain(llvm::opt::ArgList const&, llvm::Triple const&) const () from /lib64/../lib64/libclangDriver.so.6
#8  0x00007ffff1ce0077 in clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) () from /lib64/../lib64/libclangDriver.so.6
#9  0x00007ffff615d547 in clang::tooling::ToolInvocation::run() () from /lib64/libclangTooling.so.6
#10 0x00000000005a1f4d in proceedCommand (command=std::vector of length 15, capacity 16 = {...}, Directory=..., file=..., FM=0x7fffffffc180, 
    WasInDatabase=DatabaseType::InDatabase) at /opt/woboq_codebrowser/generator/main.cpp:307
#11 0x00000000005a38ac in main (argc=8, argv=0x7fffffffd248) at /opt/woboq_codebrowser/generator/main.cpp:474

backtrace:

#0  0x00007ffff2050eab in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007ffff203b5b9 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007ffff679ea78 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libclangBasic.so.6
No symbol table info available.
#3  0x00007ffff6814d36 in (anonymous namespace)::RealFileSystem::dir_begin(llvm::Twine const&, std::error_code&) () from /lib64/libclangBasic.so.6
No symbol table info available.
#4  0x00007ffff1d705fa in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(llvm::Triple const&, llvm::opt::ArgList const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::StringRef, bool) () from /lib64/../lib64/libclangDriver.so.6
No symbol table info available.
#5  0x00007ffff1d72035 in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::init(llvm::Triple const&, llvm::opt::ArgList const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) () from /lib64/../lib64/libclangDriver.so.6
No symbol table info available.
#6  0x00007ffff1d7d539 in clang::driver::toolchains::Linux::Linux(clang::driver::Driver const&, llvm::Triple const&, llvm::opt::ArgList const&) ()
   from /lib64/../lib64/libclangDriver.so.6
No symbol table info available.
#7  0x00007ffff1cd264f in clang::driver::Driver::getToolChain(llvm::opt::ArgList const&, llvm::Triple const&) const () from /lib64/../lib64/libclangDriver.so.6
No symbol table info available.
#8  0x00007ffff1ce0077 in clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) () from /lib64/../lib64/libclangDriver.so.6
No symbol table info available.
#9  0x00007ffff615d547 in clang::tooling::ToolInvocation::run() () from /lib64/libclangTooling.so.6
No symbol table info available.
#10 0x00000000005a1f4d in proceedCommand (command=std::vector of length 15, capacity 16 = {...}, Directory=..., file=..., FM=0x7fffffffc180, 
    WasInDatabase=DatabaseType::InDatabase) at /opt/woboq_codebrowser/generator/main.cpp:307
        previousIsDashI = false
        previousNeedsMacro = false
        hasNoStdInc = false
        Inv = {CommandLine = std::vector of length 15, capacity 15 = {"/opt/petalinux/2018.1/tools/linux-i386/gcc-arm-none-eabi-r5/bin/armr5-none-eabi-gcc", 
            "-I/home/user/rpu/openamp/install/usr/local/include", "-I/home/user/rpu/openamp/open-amp/lib/include", 
            "\t-O2\t\t\t\t-c\t\t\t\t-mcpu=cortex-r5\t\t\t-g\t\t\t\t-DARMR5\t\t\t\t-Wall\t\t\t\t-Wextra\t\t\t\t-mfpu=vfpv3-d16\t\t\t-include", 
            "errno.h\t\t-I/opt/petalinux/2018.1/workspace/openamp_fw_bsp/psu_cortexr5_0/include", "-Wall", "-Wextra", "-g", "-c", 
            "/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c", "-fsyntax-only", "-isystem", "/builtins", "-Qunused-arguments", "-Wno-unknown-warning-option"}, 
          Action = 0xb56500, OwnsAction = true, Files = 0x7fffffffc180, PCHContainerOps = std::shared_ptr<clang::PCHContainerOperations> (use count 1, weak count 0) = {
            get() = 0xb4ecb0}, MappedFileContents = {<llvm::StringMapImpl> = {TheTable = 0xb57720, NumBuckets = 128, NumItems = 80, NumTombstones = 0, ItemSize = 24}, 
            Allocator = {<llvm::AllocatorBase<llvm::MallocAllocator>> = {<No data fields>}, <No data fields>}}, DiagConsumer = 0x0}
        result = false
#11 0x00000000005a38ac in main (argc=8, argv=0x7fffffffd248) at /opt/woboq_codebrowser/generator/main.cpp:474
        file = "/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c"
        filename = {<llvm::SmallVector<char, 256>> = {<llvm::SmallVectorImpl<char>> = {<llvm::SmallVectorTemplateBase<char, true>> = {<llvm::SmallVectorTemplateCommon<char,
 void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffbe08, EndX = 0x7fffffffbe42, CapacityX = 0x7fffffffbf08}, FirstEl = {<llvm::AlignedCharArray<1, 1>> = {
                      buffer = "/"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {InlineElts = {{<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "h"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "o"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "m"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "u"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "s"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "u"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "o"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "n"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "a"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "m"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "o"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "n"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "-"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "a"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "m"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "l"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "i"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "b"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "o"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "x"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "y"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "/"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "p"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "m"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "s"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "g"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "_"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "t"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "a"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "r"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "g"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "e"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "t"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "."}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "c"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\240"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\276"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\177"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "`"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\276"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\177"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>} <repeats 18 times>, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = <incomplete sequence \341>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = <incomplete sequence \306>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = <incomplete sequence \335>}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = <incomplete sequence \367>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\177"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>} <repeats 11 times>, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\220"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "\001"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = <incomplete sequence \370>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\213"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\001"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = <incomplete sequence \370>}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "\213"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\001"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>} <repeats 13 times>, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\005"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "\377"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\177"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\220"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "!"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\260"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = "!"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = <incomplete sequence \360>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\242"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "!"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "\200"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {
                    buffer = <incomplete sequence \344>}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "!"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "\220"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\001"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\003"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "~"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\002"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = "~"}, <No data fields>}, {<llvm::AlignedCharArray<1, 1>> = {buffer = "\002"}, <No data fields>}, 
                {<llvm::AlignedCharArray<1, 1>> = {buffer = ""}, <No data fields>} <repeats 13 times>...}}}, <No data fields>}
        isHeader = false
        compileCommandsForFile = std::vector of length 1, capacity 1 = {{Directory = "/home/user/rpu/openamp/open-amp-build/lib", 
            Filename = "/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c", CommandLine = std::vector of length 12, capacity 12 = {
              "/opt/petalinux/2018.1/tools/linux-i386/gcc-arm-none-eabi-r5/bin/armr5-none-eabi-gcc", "-I/home/user/rpu/openamp/install/usr/local/include", 
              "-I/home/user/rpu/openamp/open-amp/lib/include", 
              "\t-O2\t\t\t\t-c\t\t\t\t-mcpu=cortex-r5\t\t\t-g\t\t\t\t-DARMR5\t\t\t\t-Wall\t\t\t\t-Wextra\t\t\t\t-mfpu=vfpv3-d16\t\t\t-include", 
              "errno.h\t\t-I/opt/petalinux/2018.1/workspace/openamp_fw_bsp/psu_cortexr5_0/include", "-Wall", "-Wextra", "-g", "-o", 
              "CMakeFiles/open_amp-static.dir/proxy/rpmsg_retarget.c.obj", "-c", "/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c"}, Output = ""}}
        it = "/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c"
        __for_range = @0x7fffffffc4a0: {Data = 0xb4d1e0, Length = 9}
        __for_begin = 0xb4d1e0
        __for_end = 0xb4d300
        ErrorMessage = "fixed-compilation-database: Error while opening fixed database: No such file or directory\n"
        Compilations = std::unique_ptr<clang::tooling::CompilationDatabase> = {get() = 0xb4c400}
        projectManager = {projects = std::vector of length 2, capacity 2 = {{name = "include", source_path = "/usr/include/", revision = "", external_root_url = "", 
              type = ProjectInfo::Internal}, {name = "codebrowser", source_path = "/home/user/rpu/openamp/open-amp/", revision = "v2018.04-180-g20d190e", 
              external_root_url = "", type = ProjectInfo::Normal}}, outputPrefix = "./open-amp-woboq/codebrowser", dataPath = "../data", 
          includeRecoveryCache = std::unordered_multimap with 0 elements}
        IsProcessingAllDirectory = false
        DirContents = std::vector of length 0, capacity 0
        AllFiles = std::vector of length 9, capacity 16 = {"/home/user/rpu/openamp/open-amp/lib/proxy/rpmsg_retarget.c", 
          "/home/user/rpu/openamp/open-amp/lib/remoteproc/elf_loader.c", "/home/user/rpu/openamp/open-amp/lib/remoteproc/remoteproc.c", 
          "/home/user/rpu/openamp/open-amp/lib/remoteproc/remoteproc_virtio.c", "/home/user/rpu/openamp/open-amp/lib/remoteproc/rsc_table_parser.c", 
          "/home/user/rpu/openamp/open-amp/lib/rpmsg/rpmsg.c", "/home/user/rpu/openamp/open-amp/lib/rpmsg/rpmsg_virtio.c", 
          "/home/user/rpu/openamp/open-amp/lib/virtio/virtio.c", "/home/user/rpu/openamp/open-amp/lib/virtio/virtqueue.c"}
        Sources = {Data = 0xb4d1e0, Length = 9}
        FM = {<llvm::RefCountedBase<clang::FileManager>> = {RefCount = 1}, FS = {Obj = 0xb4cc70}, FileSystemOpts = {WorkingDir = "."}, 
          UniqueRealDirs = std::map with 0 elements, UniqueRealFiles = std::map with 0 elements, 
          VirtualDirectoryEntries = {<llvm::SmallVectorImpl<std::unique_ptr<clang::DirectoryEntry, std::default_delete<clang::DirectoryEntry> > >> = {<llvm::SmallVectorTemplateBase<std::unique_ptr<clang::DirectoryEntry, std::default_delete<clang::DirectoryEntry> >, false>> = {<llvm::SmallVectorTemplateCommon<std::unique_ptr<clang::DirectoryEntry, std::default_delete<clang::DirectoryEntry> >, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc228, EndX = 0x7fffffffc228, CapacityX = 0x7fffffffc248}, 
                  FirstEl = {<llvm::AlignedCharArray<8, 8>> = {buffer = "@\000\000\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {
              InlineElts = {{<llvm::AlignedCharArray<8, 8>> = {buffer = "\020P\002\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                    buffer = "\000\000\000\000@\000\070"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {buffer = "\t\000@\000(\000'"}, <No data fields>}}}}, 
          VirtualFileEntries = {<llvm::SmallVectorImpl<std::unique_ptr<clang::FileEntry, std::default_delete<clang::FileEntry> > >> = {<llvm::SmallVectorTemplateBase<std::unique_ptr<clang::FileEntry, std::default_delete<clang::FileEntry> >, false>> = {<llvm::SmallVectorTemplateCommon<std::unique_ptr<clang::FileEntry, std::default_delete<clang::FileEntry> >, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc260, EndX = 0x7fffffffc260, CapacityX = 0x7fffffffc280}, 
                  FirstEl = {<llvm::AlignedCharArray<8, 8>> = {buffer = "@\000\000\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {
              InlineElts = {{<llvm::AlignedCharArray<8, 8>> = {buffer = "\370\001\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                    buffer = "\370\001\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                    buffer = "\b\000\000\000\000\000\000"}, <No data fields>}}}}, SeenDirEntries = {<llvm::StringMapImpl> = {TheTable = 0xb4d3f0, NumBuckets = 128, 
              NumItems = 0, NumTombstones = 0, ItemSize = 16}, 
            Allocator = {<llvm::AllocatorBase<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096> >> = {<No data fields>}, CurPtr = 0x0, End = 0x0, 
              Slabs = {<llvm::SmallVectorImpl<void*>> = {<llvm::SmallVectorTemplateBase<void*, true>> = {<llvm::SmallVectorTemplateCommon<void*, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc2c0, EndX = 0x7fffffffc2c0, CapacityX = 0x7fffffffc2e0}, FirstEl = {<llvm::AlignedCharArray<8, 8>> = {
                          buffer = "\000\000\000\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {InlineElts = {
                    {<llvm::AlignedCharArray<8, 8>> = {buffer = "\000\000\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                        buffer = "\000\000\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                        buffer = "\370\213\001\000\000\000\000"}, <No data fields>}}}}, 
              CustomSizedSlabs = {<llvm::SmallVectorImpl<std::pair<void*, unsigned long> >> = {<llvm::SmallVectorTemplateBase<std::pair<void*, unsigned long>, true>> = {<llvm::SmallVectorTemplateCommon<std::pair<void*, unsigned long>, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc2f8, EndX = 0x7fffffffc2f8, 
                        CapacityX = 0x7fffffffc2f8}, FirstEl = {<llvm::AlignedCharArray<8, 16>> = {
                          buffer = "\200\233\001\000\000\000\000\000\200\233!\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, 
                Storage = {<No data fields>}}, BytesAllocated = 0, RedZoneSize = 1, 
              Allocator = {<llvm::AllocatorBase<llvm::MallocAllocator>> = {<No data fields>}, <No data fields>}}}, SeenFileEntries = {<llvm::StringMapImpl> = {
              TheTable = 0xb4da10, NumBuckets = 128, NumItems = 0, NumTombstones = 0, ItemSize = 16}, 
            Allocator = {<llvm::AllocatorBase<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096> >> = {<No data fields>}, CurPtr = 0x0, End = 0x0, 
              Slabs = {<llvm::SmallVectorImpl<void*>> = {<llvm::SmallVectorTemplateBase<void*, true>> = {<llvm::SmallVectorTemplateCommon<void*, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc368, EndX = 0x7fffffffc368, CapacityX = 0x7fffffffc388}, FirstEl = {<llvm::AlignedCharArray<8, 8>> = {
                          buffer = "8\002\000\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {InlineElts = {
                    {<llvm::AlignedCharArray<8, 8>> = {buffer = "8\002\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                        buffer = "8\002\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                        buffer = "D\000\000\000\000\000\000"}, <No data fields>}}}}, 
              CustomSizedSlabs = {<llvm::SmallVectorImpl<std::pair<void*, unsigned long> >> = {<llvm::SmallVectorTemplateBase<std::pair<void*, unsigned long>, true>> = {<llvm::SmallVectorTemplateCommon<std::pair<void*, unsigned long>, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc3a0, EndX = 0x7fffffffc3a0, 
                        CapacityX = 0x7fffffffc3a0}, FirstEl = {<llvm::AlignedCharArray<8, 16>> = {
                          buffer = "`D\001\000\000\000\000\000`D\001\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, 
                Storage = {<No data fields>}}, BytesAllocated = 0, RedZoneSize = 1, 
              Allocator = {<llvm::AllocatorBase<llvm::MallocAllocator>> = {<No data fields>}, <No data fields>}}}, 
          CanonicalDirNames = {<llvm::DenseMapBase<llvm::DenseMap<clang::DirectoryEntry const*, llvm::StringRef, llvm::DenseMapInfo<clang::DirectoryEntry const*>, llvm::detail::DenseMapPair<clang::DirectoryEntry const*, llvm::StringRef> >, clang::DirectoryEntry const*, llvm::StringRef, llvm::DenseMapInfo<clang::DirectoryEntry const*>, llvm::detail::DenseMapPair<clang::DirectoryEntry const*, llvm::StringRef> >> = {<llvm::DebugEpochBase> = {<No data fields>}, <No data fields>}, Buckets = 0x0, NumEntries = 0, 
            NumTombstones = 0, NumBuckets = 0}, 
          CanonicalNameStorage = {<llvm::AllocatorBase<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096> >> = {<No data fields>}, CurPtr = 0x0, End = 0x0, 
            Slabs = {<llvm::SmallVectorImpl<void*>> = {<llvm::SmallVectorTemplateBase<void*, true>> = {<llvm::SmallVectorTemplateCommon<void*, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc410, EndX = 0x7fffffffc410, CapacityX = 0x7fffffffc430}, FirstEl = {<llvm::AlignedCharArray<8, 8>> = {
                        buffer = "\200\233\001\000\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {InlineElts = {
                  {<llvm::AlignedCharArray<8, 8>> = {buffer = "\200\233!\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                      buffer = "\200\233!\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8, 8>> = {
                      buffer = "\200\004\000\000\000\000\000"}, <No data fields>}}}}, 
            CustomSizedSlabs = {<llvm::SmallVectorImpl<std::pair<void*, unsigned long> >> = {<llvm::SmallVectorTemplateBase<std::pair<void*, unsigned long>, true>> = {<llvm::SmallVectorTemplateCommon<std::pair<void*, unsigned long>, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7fffffffc448, EndX = 0x7fffffffc448, 
                      CapacityX = 0x7fffffffc448}, FirstEl = {<llvm::AlignedCharArray<8, 16>> = {
                        buffer = "\003\000\000\000GNU\000%\310/\362\250\231\312H"}, <No data fields>}}, <No data fields>}, <No data fields>}, 
              Storage = {<No data fields>}}, BytesAllocated = 0, RedZoneSize = 1, 
            Allocator = {<llvm::AllocatorBase<llvm::MallocAllocator>> = {<No data fields>}, <No data fields>}}, NextFileUID = 0, NumDirLookups = 0, NumFileLookups = 0, 
          NumDirCacheMisses = 0, NumFileCacheMisses = 0, StatCache = std::unique_ptr<clang::FileSystemStatCache> = {get() = 0x0}}
        Progress = 1
        NotInDB = std::vector of length 0, capacity 0

Project being build is OpenAMP targeted for Xilinx Zynq.

Custom installations upload data to Google Analytics

Hi,

I was just playing with Woboq for our group and noticed that when building from the sources on github user data is uploaded to an upstream developer's Google Analytics account (in codebrowser.js).

Looking at the data used it looks like this was originally intended for woboq.com, and not for other installations. If it was intended to track unlicensed use it should be clearly documented. In some environments when used like covered by the license (e.g. non-commercial, academic) uploading data to 3rd-party sites might be illegal and shouldn't happen without notifying the person deploying and/or using the installation.

Thanks for this nice tool!

Feature request: Show usages/references to types.

Classes that have default constructor, C structs have no usages/references in Woboq.
Woboq should show also references to such compiler generated methods.

Could look like this:
Moving mouse above class/struct should show as usages:

  • construction of type (call to constructor in any way)
  • references to type
  • list of all variables that use this type.

Compile error with Clang 3.8.0 / Fedora 24

[100%] Linking CXX executable codebrowser_generator
clang-3.8: warning: argument unused during compilation: '-Wp,-D_FORTIFY_SOURCE=2'
clang-3.8: warning: argument unused during compilation: '-grecord-gcc-switches'
clang-3.8: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
CMakeFiles/codebrowser_generator.dir/main.cpp.o:(.data.rel.ro._ZTI13BrowserAction[_ZTI13BrowserAction]+0x10): undefined reference to `typeinfo for clang::ASTFrontendAction'
CMakeFiles/codebrowser_generator.dir/main.cpp.o:(.data.rel.ro._ZTI18BrowserASTConsumer[_ZTI18BrowserASTConsumer]+0x10): undefined reference to `typeinfo for clang::ASTConsumer'
CMakeFiles/codebrowser_generator.dir/main.cpp.o:(.data.rel.ro._ZTI23BrowserDiagnosticClient[_ZTI23BrowserDiagnosticClient]+0x10): undefined reference to `typeinfo for clang::DiagnosticConsumer'
CMakeFiles/codebrowser_generator.dir/preprocessorcallback.cpp.o:(.data.rel.ro._ZTI20PreprocessorCallback+0x10): undefined reference to `typeinfo for clang::PPCallbacks'
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)
generator/CMakeFiles/codebrowser_generator.dir/build.make:316: recipe for target 'generator/codebrowser_generator' failed
make[2]: *** [generator/codebrowser_generator] Error 1
CMakeFiles/Makefile2:85: recipe for target 'generator/CMakeFiles/codebrowser_generator.dir/all' failed
make[1]: *** [generator/CMakeFiles/codebrowser_generator.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

how to generate files for project like redis

redis has no official cmake file and no configure file, if I don't use a third-party cmakefile, it seems I can't get the compile_commands.json?
Is there a better way to generate files for project like this?

codebrowser_generator meets error when processing librdkafka

Hi, I am using the main branch of codebrowser_generator, when I tried processing librdkafka(v0.9.5-RC2), I got many errors, I just paste the head here:

[0%] Processing librdkafka/examples/kafkatest_verifiable_client.cpp
[1%] Processing librdkafka/examples/rdkafka_consumer_example.c
Error: librdkafka/examples/rdkafka_consumer_example.c:119: expected ')'
Error: librdkafka/examples/rdkafka_consumer_example.c:136: expected ')'
Error: librdkafka/examples/rdkafka_consumer_example.c:154: expected ')'
Error: librdkafka/examples/rdkafka_consumer_example.c:183: expected ')'
Error: librdkafka/examples/rdkafka_consumer_example.c:555: expected ')'
Error: librdkafka/examples/rdkafka_consumer_example.c:561: expected ')'

The source code of rdkafka_consumer_example.c:119 is a string format statement, it seems that codebrowser_generator can not deal with PRId32.

                                "%% Consumer reached end of %s [%"PRId32"] "

The project can be built by clang(version 3.8.0), but can not be processed by codebrowser_generator, please help me investigate it.

Template functions's uses within template classes are not properly shown as used.

For example, QSharedPointer::staticCast from
https://code.woboq.org/qt5/qtbase/src/corelib/tools/qsharedpointer_impl.h.html#_ZNK14QSharedPointer10staticCastEv shows 0 uses. Despite it is used in https://code.woboq.org/qt5/qtbase/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp.html#830

The problem is that the mangling is not performed the same:
_ZNK14QSharedPointer10staticCastEv vs.
_ZNK14QSharedPointerI4DataE10staticCastEv

When it is used, it uses the mangling that includes the template types. This should not happen.

Crash in Annotator::registerReference

Program received signal SIGABRT, Aborted.
0x000000375c032625 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x000000375c032625 in raise () from /lib64/libc.so.6
#1 0x000000375c033e05 in abort () from /lib64/libc.so.6
#2 0x000000375c02b74e in __assert_fail_base () from /lib64/libc.so.6
#3 0x000000375c02b810 in assert_fail () from /lib64/libc.so.6
#4 0x00000000004282e2 in clang::NamedDecl::getName() const clone .part.72
#5 0x0000000000433a27 in Annotator::registerReference(clang::NamedDecl
, clang::SourceRange, Annotator::TokenType, Annotator::DeclType, std::string, clang::NamedDecl
)

()

#6 0x000000000040d474 in BrowserASTVisitor::VisitFunctionDecl(clang::FunctionDecl*) clone .part.3017
#7 0x0000000000415818 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#8 0x000000000041670a in clang::RecursiveASTVisitor::TraverseDeclContextHelper(clang::DeclContext*) ()
#9 0x00000000004161da in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#10 0x000000000041670a in clang::RecursiveASTVisitor::TraverseDeclContextHelper(clang::DeclContext*) ()
#11 0x00000000004159b8 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#12 0x000000000041670a in clang::RecursiveASTVisitor::TraverseDeclContextHelper(clang::DeclContext*) ()
#13 0x00000000004159b8 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#14 0x000000000041670a in clang::RecursiveASTVisitor::TraverseDeclContextHelper(clang::DeclContext*) ()
#15 0x00000000004159b8 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#16 0x0000000000416647 in BrowserASTConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#17 0x00000000007acb5d in clang::ParseAST(clang::Sema&, bool, bool) ()
#18 0x000000000069647e in clang::FrontendAction::Execute() ()
#19 0x00000000006aa806 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#20 0x000000000071ae50 in clang::tooling::FrontendActionFactory::runInvocation(clang::CompilerInvocation_, clang::FileManager_, std::shared_ptrclang::PCHContainerOperations, clang::DiagnosticConsumer*) ()
#21 0x0000000000719cc1 in clang::tooling::ToolInvocation::runInvocation(char const_, clang::driver::Compilation_, clang::CompilerInvocation*, std::shared_ptrclang::PCHContainerOperations) ()
#22 0x000000000071a5af in clang::tooling::ToolInvocation::run() ()
#23 0x000000000040fca2 in proceedCommand(std::vector<std::string, std::allocatorstd::string >, llvm::StringRef, llvm::StringRef, clang::FileManager*, bool) ()
#24 0x00000000004075a6 in main ()

(gdb) info line *0x0000000000433a27
No line number information available for address 0x433a27 <ZN9Annotator17registerReferenceEPN5clang9NamedDeclENS0_11SourceRangeENS_9TokenTypeENS_8DeclTypeESsS2+6343>

generator's argument handling is weak

There are two big issues with the code generator's handling of the command line at the moment:

  1. Unconditional adding of /builtins should be avoided, only do it when no -nostdinc has been seen. This avoids surprises in freestanding environments.
  2. The path name translation logic interacts badly with separated options. Since this is the default output style for LLVM's own option renderer, it can easily result in hard to debug problems.

The first item is easy to fix, look for the option and only do the VFS dance if it is absent. The second one is harder to do correctly. The correct approach would be to restructure Tooling's argument adjuster to operate on the parsed argument list, but that requires cooperation. The other option would be to duplicate part of clang::driver::Driver::ParseArgStrings. Given that the command line should have passed a build with clang already, the only difficult part is likely the correct guessing of CL mode, if that is desirable at all.

Use index.html in links where appropriate

For example in the top-level index.html code like this is generated:
<tr><td class='folder'><a href='myProject/' class='opener' data-path='myProject'>[+]</a> <a href='myProject/'>myProject/</a></td><td></td></tr>

The myProject folder does contain an index.html which is served by a properly configured webserver. If you just look at local files or an improperly configured web server, you will probably receive an error or look at an autogenerated index. One example where you don't really have control over the webserver is when serving artifacts from continous integration.
For this cases I would suggest to just always link to the index.html.

If someone prefers "pretty urls", this could be an option of the generator or the webserver would need to be configured to redirect from /index.html to /.

problem with "deduction guide name"

Our project uses the catch testing framework.

This framework is header only with a lot of templates. Woboq's generator can't handle it with the following error message:

./codebrowser_generator -p debug:/home/xxx/debug -o out /home/xxx/debug/test.cpp -- -std=c++1z
debug:out
debug:/home/xxx/debug
build path: 
file: /home/xxx/debug/test.cpp
[100%] Processing /home/xxx/debug/test.cpp
Can't mangle a deduction guide name!
UNREACHABLE executed at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:1476!
Aborted (core dumped)

I made a simple cpp file based on this example:

https://en.cppreference.com/w/cpp/language/class_template_argument_deduction#User-defined_deduction_guides

and this simple cpp file can reproduce the same issue seen with the catch2 testing framework.

the cpp file is attached here for debugging:

test.zip

This is the call stack that causes the abort:

#1  0x00007ffff6ca9801 in __GI_abort () at abort.c:79
#2  0x00005555578f8cf6 in llvm::llvm_unreachable_internal (msg=0x55555889e1d8 "Can't mangle a deduction guide name!", file=0x55555889deb8 "/home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp", 
    line=1476) at /home/xxx/llvm-project/llvm/lib/Support/ErrorHandling.cpp:209
#3  0x000055555738e60d in (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (this=0x7fffffffbb10, ND=0x55555a564728, Name=..., KnownArity=4294967295, AdditionalAbiTags=0x0)
    at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:1476
#4  0x000055555738b9a6 in (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (this=0x7fffffffbb10, ND=0x55555a564728, AdditionalAbiTags=0x0)
    at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:469
#5  0x000055555738ced0 in (anonymous namespace)::CXXNameMangler::mangleUnscopedName (this=0x7fffffffbb10, ND=0x55555a564728, AdditionalAbiTags=0x0)
    at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:954
#6  0x000055555738caa3 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags (this=0x7fffffffbb10, ND=0x55555a564728, AdditionalAbiTags=0x0)
    at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:891
#7  0x000055555738c875 in (anonymous namespace)::CXXNameMangler::mangleName (this=0x7fffffffbb10, ND=0x55555a564728) at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:842
#8  0x000055555738bec3 in (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding (this=0x7fffffffbb10, FD=0x55555a564728) at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:666
#9  0x000055555738bd35 in (anonymous namespace)::CXXNameMangler::mangle (this=0x7fffffffbb10, D=0x55555a564728) at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:645
#10 0x000055555739a20e in (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName (this=0x555559c43df0, D=0x55555a564728, Out=...) at /home/xxx/llvm-project/clang/lib/AST/ItaniumMangle.cpp:4868
#11 0x00005555573ca31b in clang::MangleContext::mangleName (this=0x555559c43df0, D=0x55555a564728, Out=...) at /home/xxx/llvm-project/clang/lib/AST/Mangle.cpp:148
#12 0x000055555616c1f7 in Annotator::getReferenceAndTitle[abi:cxx11](clang::NamedDecl*) ()
#13 0x000055555616f49b in Annotator::registerReference(clang::NamedDecl*, clang::SourceRange, Annotator::TokenType, Annotator::DeclType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, clang::NamedDecl*) ()
#14 0x000055555614a7f1 in BrowserASTVisitor::VisitFunctionDecl(clang::FunctionDecl*) ()
#15 0x0000555556150af8 in clang::RecursiveASTVisitor<BrowserASTVisitor>::TraverseDecl(clang::Decl*) ()
#16 0x0000555556151903 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#17 0x00005555561504d5 in clang::RecursiveASTVisitor<BrowserASTVisitor>::TraverseDecl(clang::Decl*) ()
#18 0x0000555556151903 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#19 0x00005555561495c4 in clang::RecursiveASTVisitor<BrowserASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) [clone .part.3350] ()
#20 0x00005555561508f3 in clang::RecursiveASTVisitor<BrowserASTVisitor>::TraverseDecl(clang::Decl*) ()
#21 0x0000555556151903 in BrowserASTVisitor::TraverseDecl(clang::Decl*) ()
#22 0x0000555556151ae7 in BrowserASTConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#23 0x00005555563db15c in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=true) at /home/xxx/llvm-project/clang/lib/Parse/ParseAST.cpp:171
#24 0x0000555556196c65 in clang::ASTFrontendAction::ExecuteAction (this=0x555559bd7b90) at /home/xxx/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1041
#25 0x00005555561965c6 in clang::FrontendAction::Execute (this=0x555559bd7b90) at /home/xxx/llvm-project/clang/lib/Frontend/FrontendAction.cpp:934
#26 0x000055555620ade0 in clang::CompilerInstance::ExecuteAction (this=0x7fffffffc870, Act=warning: RTTI symbol not found for class 'BrowserAction'
...) at /home/xxx/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:944
#27 0x00005555576be87a in clang::tooling::FrontendActionFactory::runInvocation (this=0x555559bd5b20, Invocation=std::shared_ptr<clang::CompilerInvocation> (empty) = {...}, Files=0x7fffffffda80, 
    PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}, DiagConsumer=0x0) at /home/xxx/llvm-project/clang/lib/Tooling/Tooling.cpp:369
#28 0x00005555576be69f in clang::tooling::ToolInvocation::runInvocation (this=0x7fffffffd360, BinaryName=0x555559bd88e0 "/home/xxx/woboq_codebrowser/build/generator/clang-tool", 
    Compilation=0x555559bd8bb0, Invocation=std::shared_ptr<clang::CompilerInvocation> (empty) = {...}, PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...})
    at /home/xxx/llvm-project/clang/lib/Tooling/Tooling.cpp:345
#29 0x00005555576be4a6 in clang::tooling::ToolInvocation::run (this=0x7fffffffd360) at /home/xxx/llvm-project/clang/lib/Tooling/Tooling.cpp:330
#30 0x0000555556148d49 in proceedCommand(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, llvm::StringRef, llvm::StringRef, clang::FileManager*, DatabaseType) ()
#31 0x0000555556145f88 in main ()

C++ template makes the ref file name too long

While generating the refs from WebKit tree, I found the following errors.

Error opening output file '/home/yusuke/work/html/refs/_ZN3JSC19SparseArrayValueMap6removeEN3WTF24HashTableIteratorAdapterINS1_9HashTableImNS1_12KeyValuePairImNS_16SparseArrayEntryEEENS1_24KeyValuePairKeyExtractorIS6_EENS1_7IntHashImEENS1_7HashMapImS5_SA_NS1_29UnsignedWithZeroKeyHashTraitsImEENS1_10HashTraitsIS5_EEE18KeyValuePairTraitsESD_EES6_EE': File name too long

This error is caused by POSIX open (In LLVM sys::fs::openFileForWrite) because typical file system doesn't allow users to use too long file names. For example, ext4 limits its file name 256 bytes.

But C++ template generates very long type name, and it makes the length of the ref file names very long.

woboq codebrowser_generator segfaultsin llvm::sys::fs::detail::directory_iterator_construct(llvm::sys::fs::detail::DirIterState&, llvm::StringRef, bool)

Wanted to give this a spin and run it on the http://icecast.org codebase.
Tried it both with clang 5.0.2 and 6.0.1 (Debian testing).
json generated by help of scripts/fake_compiler.sh

Starting program: /home/tbr/src/woboq_codebrowser/build/generator/codebrowser_generator -b /home/tbr/src/icecast -a -o /home/src/icecast/foo -p codebrowser:/home/tbr/src/icecast:v2.4.3-23-g4e13c27
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Skipping file not included by any project /dev/null
Skipping file not included by any project /home/tbr/src/icecast
[5%] Processing /home/tbr/src/icecast/conftest

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4ce31c2 in llvm::sys::fs::detail::directory_iterator_construct(llvm::sys::fs::detail::DirIterState&, llvm::StringRef, bool) () from /usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1
(gdb) bt
#0  0x00007ffff4ce31c2 in llvm::sys::fs::detail::directory_iterator_construct(llvm::sys::fs::detail::DirIterState&, llvm::StringRef, bool) () from /usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1
#1  0x000055555642d716 in (anonymous namespace)::RealFileSystem::dir_begin(llvm::Twine const&, std::error_code&) ()
#2  0x00005555566b9716 in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(llvm::Triple const&, llvm::opt::ArgList const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::StringRef, bool) ()
#3  0x00005555566ba4aa in clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::init(llvm::Triple const&, llvm::opt::ArgList const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) ()
#4  0x00005555566c5a20 in clang::driver::toolchains::Linux::Linux(clang::driver::Driver const&, llvm::Triple const&, llvm::opt::ArgList const&) ()
#5  0x000055555663df18 in clang::driver::Driver::getToolChain(llvm::opt::ArgList const&, llvm::Triple const&) const ()
#6  0x000055555664a810 in clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) ()
#7  0x00005555564ccc65 in clang::tooling::ToolInvocation::run() ()
#8  0x00005555559bb8fe in proceedCommand(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, llvm::StringRef, llvm::StringRef, clang::FileManager*, DatabaseType) ()
#9  0x00005555559bd33b in main ()

Let me know if you need additional information.

Feature upgrade: Enchantments of 'Used' box

Features to add there:

  • filter by name, when macro got 10 000 usages, would be nice to have some filter based on file name or sctope
  • filter by type of usage, for example to see only writes

The result of code browser had no interactive woring (sythex highlight, tooltip for functions)

Dear Woboq developers,

Thank you for wonderful code browser.

I used LXR and Doxygen to read and find the code in open source library.

Recently, I found Woboq code browser and try to deploy in github pages.

It is my result.
https://jishin86.github.io/geant4-woboq/

It is the code browsing
https://jishin86.github.io/geant4-woboq/codebrowser/source/materials/src/G4DensityEffectData.cc.html

But in my result, I cannot see the beatiful browsing like sythex highlight, tooltip for functions in your result.
https://code.woboq.org/gcc/gcc/alias.c.html

Following instruction, I made my code browser in docker image about Ubuntu 16.04 and make json file using CMake, Bear.

I didn't install clang and llvm in docker image because I didn't need to build Woboq from source and I use deb package.

But it made same result. it is not related with "compile command" json file.

Is there option to make highlight and tooltips ?

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.