LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2018, 10:13 AM   #1
purnish_dave
LQ Newbie
 
Registered: Jan 2014
Location: India
Distribution: Slackware 14.2
Posts: 18

Rep: Reputation: Disabled
Which IDE should I ideally use for browsing Linux Kernel Source Code?


If I come across a variable and function name which isn't defined in the same file it's practically impossible to find in other files.
Which command I can use or which IDEs can I use for this?

Thanks for your time.

Last edited by purnish_dave; 03-04-2018 at 10:15 AM.
 
Old 03-04-2018, 12:03 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
You can use grep.
Code:
$ grep -r string directory
will return every matching string in all files and subdirectories in directory.
 
Old 03-04-2018, 12:08 PM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,100

Rep: Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144
originally it was ctags to do that, you do not need any kind of IDE.
https://en.wikipedia.org/wiki/Ctags
https://linux.die.net/man/1/ctags
 
Old 03-05-2018, 02:35 AM   #4
xamaco
Member
 
Registered: Sep 2009
Location: Bastelicaccia, Corsica
Distribution: Crux
Posts: 47

Rep: Reputation: 7
Just to add to pan64: Once you tags are generated, advanced editors like vim or emacs have commands to jump from the name of a function to it's definition, etc...
 
Old 03-05-2018, 02:41 AM   #5
purnish_dave
LQ Newbie
 
Registered: Jan 2014
Location: India
Distribution: Slackware 14.2
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by xamaco View Post
Just to add to pan64: Once you tags are generated, advanced editors like vim or emacs have commands to jump from the name of a function to it's definition, etc...
Thanks for the answer. I will use ctags and come back if I have any more questions.

Last edited by purnish_dave; 03-05-2018 at 02:43 AM.
 
Old 03-05-2018, 03:39 AM   #6
purnish_dave
LQ Newbie
 
Registered: Jan 2014
Location: India
Distribution: Slackware 14.2
Posts: 18

Original Poster
Rep: Reputation: Disabled
I set up CTags. It's really cool. I use it with vim.
 
Old 03-05-2018, 03:54 AM   #7
purnish_dave
LQ Newbie
 
Registered: Jan 2014
Location: India
Distribution: Slackware 14.2
Posts: 18

Original Poster
Rep: Reputation: Disabled
I have one strange issue with ctags.

There is a line in the code like this


Code:
struct bio *bio;
When I run

Code:
:tag bio
it returns to the same line.

I however want it to go to where the struct is defined.

How do I do this?
 
Old 03-05-2018, 05:48 AM   #8
purnish_dave
LQ Newbie
 
Registered: Jan 2014
Location: India
Distribution: Slackware 14.2
Posts: 18

Original Poster
Rep: Reputation: Disabled
I figured it out.

All I have to do is to type

Code:
:ts bio
 
Old 03-05-2018, 06:07 AM   #9
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,100

Rep: Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144Reputation: 4144
great! glad to help you.
If you were satisfied please mark the thread solved.
Also if you want to say thanks just click on yes.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Browsing the kernel source code with eclipse shivashivasiva1 Linux - Kernel 1 06-16-2017 06:45 PM
[SOLVED] Looking for a source code editor. Not exactly an IDE prushik Linux - Software 4 01-26-2012 06:24 AM
linux kernel source code vardhan22 Linux - Kernel 10 11-06-2011 08:13 AM
Need tools for browsing source code phuna Programming 4 08-04-2005 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration