Is there a way to build a cross reference with kernel file

Alexandre Courbot gnurou at gmail.com
Sat Dec 17 01:28:47 EST 2011


On Dec 17, 2011 9:58 AM, "Jeff Haran" <jharan at bytemobile.com> wrote:
> I tried kdevelop to solve this same problem. It doesn't seem to provide
> any references to structure field names. Hover the mouse cursor over a
> field name in kdevelop and nothing pops up like it would for say a local
> or global variable name. At least it didn't when I tried it.

Actually, KDevelop does that, and pretty well even. The problem is that the
source files cannot be correctly parsed as of now because many macro are
not defined. For instance, __KERNEL__ must exist for many core kernel
include files to be parsed correctly, and the header file generated from
your kernel configuration must also be parsed automatically (or you will
miss things like CONFIG_PM and such and some parts of the code that depend
on these macros will appear as dead code). But for other stuff, it really
does a great job at infering the types and only giving you relevant
references.

I am currently writing a couple of patches to improve kernel parsing (e.g.
C99 designated initializers are not supported yet), and also started a
kernel project plugin to solve the macros problem and only parse the files
and drivers that are relevant for a given kernel configuration, but this
will still take some time.

If you are looking for a better grep, you may want to give a try to
coccigrep, part of the coccinelle suite. It supposingly does wonders,
unfortunately I did not manage to compile it and did not look further but
maybe you will have more luck.

Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111217/0b4d8ae7/attachment.html 


More information about the Kernelnewbies mailing list