date -s “23 FEB 2012 18:00:00”
apt-get install openjdk-6-jdk
E: Couldn’t find package gcc-arm-linux-gnueabi
http://lists.debian.org/debian-embedded/2011/04/msg00079.html
Ubuntu has pre-packaged cross-compilers for ARM directly in the archive since Ubuntu 10.10, so you shouldn’t need any special repository with recent Ubuntu releases; just
sudo apt-get install gcc-arm-linux-gnueabi.
If you’re running Ubuntu 10.04, there are backports of this
cross-toolchain in a PPA maintained by Linaro:
sudo add-apt-repository ppa:linaro-maintainers/toolchain
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabi
Ctags generates an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object).
Tag generation is supported for these programming languages.
A list of editors and tools utilizing tag files may be found here.
Manual and Tutorial can be found in http://ctags.sourceforge.net/
cscope is an interactive, screen-oriented tool that allows the user to browse through C source files for specified elements of code.
By default, cscope examines the C (.c and .h), lex (.l), and yacc (.y) source files in the current directory. cscope may also be invoked for source files named on the command line. In either case, cscope searches the standard directories for #include files that it does not find in the current directory. cscope uses a symbol cross-reference, cscope.out by default, to locate functions, function calls, macros, variables, and preprocessor symbols in the files.
cscope builds the symbol cross-reference the first time it is used on the source files for the program being browsed. On a subsequent invocation, cscope rebuilds the cross-reference only if a source file has changed or the list of source files is different. When the cross-reference is rebuilt, the data for the unchanged files are copied from the old cross-reference, which makes rebuilding faster than the initial build.
You can download the tarball here. Extract the contents into a convenient directory, and let’s get ready to roll.
To install Cscope, open a terminal and navigated to the extracted directory.
Now run the commands
./configure
make
sudo make install
This should install cscope on your computer. I use cscope with emacs, so the next set of steps explain how to integrate it with emacs. If you wish to use csope with other browsers, please visit their website (http://cscope.sourceforge.net) for instructions.
1) Make the ‘cscope-indexer’ script (in cscope/contrib/xcscope) executable.
sudo chmod a+x ./contrib/xcscope/cscope-indexer
2)Copy it into /usr/bin or /usr/sbin (it needs to be in $PATH)
sudo cp ./contrib/xcscope/cscope-indexer /usr/bin
3)Copy the file xcscope.el (in cscope/contrib/xcscope) to /etc/emacs (basically it has to be in the emacs load-path)
sudo cp ./contrib/xcscope/xcsope.el /etc/emacs
4)Edit your ~/.emacs file and add the line
(require ‘xcscope)
Now you can use the cscope key bindings in emacs. Here is a list of the most common key-bindings:
1) to create a cscope database for your code files, navigate to the topmost direcory (under which all your code directories of current project are) in emacs (using C-x,C-f) and type C-c s I. This should create the files cscope.out and cscope.files. These together represent your database
2)While browsing through any source code file, use the following bindings:
C-c s s Find symbol.
C-c s d Find global definition.
C-c s g Find global definition (alternate binding).
C-c s G Find global definition without prompting.
C-c s c Find functions calling a function.
C-c s C Find called functions (list functions called
from a function).
C-c s t Find text string.
C-c s e Find egrep pattern.
C-c s f Find a file.
C-c s i Find files #including a file.
3)To navigate the cscope search results use:
C-c s n Next symbol.
C-c s N Next file.
C-c s p Previous symbol.
C-c s P Previous file.
4)Once you have satisfied your curiosity, you can return to the point from where you jumped using
C-c s u Pop Mark
And thus, you have complete control over code navigation! I have used the file xcscope.el as a reference, and it goes on to detail far more complex tasks using cscope. Look into it once you get the hang of cscope!
The Linux Cross-Reference project is the testbed application of a general hypertext cross-referencing tool. (Or the other way around.)
The main goal of the project is to create a versatile cross-referencing tool for relatively large code repositories. The project is based on stock web technology, so the codeview client may be chosen from the full range of available web browsers. On the server side, any Unix-based web server with cgi-script capability should do nicely.
The main feature of the indexer is of course the ability to jump easily to the declaration of any global identifier. Indeed, even all references to global identifiers are indexed. Quick access to function declarations, data (type) definitions and preprocessor macros makes code browsing just that tad more convenient. At-a-glance overview of e.g. which code areas that will be affected by changing a function or type definition should also come in useful during development and debugging.
Other bits of hypertextual sugar, such as e-mail and include file links, are provided as well, but is on the whole, well, sugar. Some minimal visual markup is also done. (Style sheets are considered as a way to do this in the future.
Technicalities
The index generator is written in Perl and relies heavily on Perl’s regular expression facilities. The algorithm used is very brute force and extremely sloppy. The rationale behind the sloppiness is that too little information renders the database useless, while too much information simply means the users have to think and navigate at the same time.
The Linux source code, with which the project has initially been linked, presents the indexer with some very tough obstacles. Specifically, the heavy use of preprocessor macros makes the parsing a virtual nightmare. We want to index the information in the preprocessor directives as well as the actual C code, so we have to parse both at once, which leads to no end of trouble. (Strict parsing is right out.) Still, we’re pretty satisfied with what the indexer manages to get out of it.
There’s also the question of actually broken code. We want to reasonably index all code portions, even if some of it is not entirely syntactically valid. This is another reason for the sloppiness.
There are obviously disadvantages to this approach. No scope checking is done, and the most annoying effect of this is mistaking local identifers for references to global ones with the same name. This particular problem (and others) can only be solved by doing (almost) full parsing. The feasibility of combining this with the fuzzy way indexing is currently done is being looked into.
An identifier is a macro, typedef, struct, enum, union, function, function prototype or variable. For the Linux source code between 50000 and 60000 identifiers are collected. The individual files of the sourcecode are formatted on the fly and presented with clickable identifiers.
It is possible to search among the identifiers and the entire kernel source text. The freetext search is implemented using Glimpse, so all the capabilities of Glimpse are available. Especially the regular expression search capabilities are useful.
Availability
The code for the indexer is released under the GNU Copyleft license. Go to LXR main site to get the latest version.
Steps to setup lxr in ubuntu
Required Packages :
Apache – Web server
lxr -Linux Cross Reference –
Perl – Reference generator
Install the packages
$ sudo apt-get install lxr perl apache2
$ sudo vi /etc/apache2/sites-enabled/000-default
Add these lines to “/etc/apache2/sites-enabled/000-default”
$ sudo vi etc/apache2/sites-enabled/000-default/
# Linux Cross Reference Stuff Alias /lxr /usr/share/lxr <Directory usr/share/lxr> Options All AllowOverride All </Directory>Create a file /usr/share/lxr/http/.htaccess which contains:
$ sudo vi /usr/share/lxr/http/.htaccess
<Files ~ (search|source|ident|diff|find)$>
SetHandler cgi-script
</Files>
Restart your apache web-server
$ sudo /etc/init.d/apache2 restart
Now we will setup the cross reference.
i). Create /usr/share/lxr/source if it doesn’t exist.
ii). Create a directory 2.6.39 inside it – this is the linux version I am cross referencing.
$ sudo mkdir /usr/share/lxr/source/2.6.39 -p
Untar the kernel source inside this directory in a subdirectory ‘linux’ .. i.e., you now have /usr/share/lxr/source/2.6.39/linux with the source in the linux directory.
$ cd /usr/share/lxr/source/2.6.39 ; sudo tar zxvf linux-2.6.39.tar.gz
Create andAdd a line with contents ’2.6.39′ (without the single quotes) in /usr/share/lxr/source/versions
Create a link from /usr/share/lxr/source/2.6.39 to /usr/share/lxr/source/defversion
$ sudo ln -s /usr/share/lxr/source/2.6.39 /usr/share/lxr/source/defversion
Change the director to /usr/share/lxr/source/2.6.39 and execute ‘genxref linux’
$ cd/usr/share/lxr/source/2.6.39 ; sudo genxref linux
Make sure that all the files inside /usr/share/lxr/source/2.6.39 has “read” permission
$ sudo chmod -R o+r /usr/share/lxr/source/2.6.39/*
10 minutes later click here: http://localhost/lxr/http/blurb.html
Then click “Browse The Code”