Tuesday, June 25, 2013

Extract Path and Symbols from Chromium to index Eclipse CDT

Eclipse CDT can analysis build message and extract Path and Symbols.
I use Ubuntu 13.04. Other OS I don't care. I hate both Mac and Window.

There is not one way to do that. However, I prefer what I describe here, because I don't like build chromium in Eclipse.

If you like to build chromium in Eclipse, refer to https://code.google.com/p/chromium/wiki/LinuxEclipseDev
For more information, refer to https://developer.mozilla.org/en-US/docs/Eclipse_CDT

My way consists of 2 step.
1. record build message
2. extract Path and Symbols using power of CDT.

1. record build message

> ninja -C out/Debug -j 80 -v -n chrome content_shell > build-message
> sed -i "s/g++/gcc/g" build-message
> sed -i "s/\[\S* gcc/gcc/g" build-message
> sed -i "s/-I\.\.\/\./-I/g" build-message

2. extract Path and Symbols using power of CDT.

1. open project Properties window
2. go "C/C++ Build > Discovery Options"
3. Select "Configuration-wide" in "Discovery profiles scope"
 a. check "Automate discovery of paths and symbols"
 b. check Report path deltection problems"
 c. "GCC per file scanner infor profile" in Discovery profile
 d. check Enable build output scanner info discovery
4. select "build-message" file via Browse... button.
5. click Load button

6. Refresh project
7. Rebuild index

build message for WebKit

QT
make -B -n make_default > build-message

GTK
make -B -n all-am > build-message



expand your Eclipse memory

CDT indexing needs so much memory


change your eclipse.ini file, my settings


org.eclipse.platform
--launcher.XXMaxPermSize
2G
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-XX:MaxPermSize=2G
-Xms2G
-Xmx7G

increase your index memory

1. open Window>Preferences
2. go C/C++ > Indexer
3. change Cache limits : in my settings, 70%, 6144MB, 6144MB



trouble shooting

You will feel that indexing is gradually slow with repeated updating index.

It it time to rebuild index. Don't assume that clicking rebuild is fine. Real rebuild is a bit more complicated.

go to indexing directory
> cd [workspace]/.metadata/.plugins/org.eclipse.cdt.core
> rm [project name]*

Indexing is not free, it is stored in your persistent storage. Chromium indexing consume about 1GB.

And click rebuild.




No comments:

Post a Comment