Sorry about the super-late response. It was catapult season over here.
Since you are using the linux kernel, and ede-linux, does it make sense
to teach ede-linux to always use some set of headers? It could be that
ede-preprocessor-map should change to force different headers to be in
the preprocessor map based on which file you are editing.
I'm not sure what the rules are, but if you know, them, that is the
place to encode them.
In general, Semantic doesn't use #includes for learning preprocessor
symbols, so your attempt to add more #includes to the file with the
symbols in it won't work. In this instance, however, it probably makes
sense for this specific case to work, but someone will need to work on that.
Eric
On 10/09/2011 03:34 PM, Abdellatif El Khlifi wrote:
> Hi,
>
> Your solution shown here
> http://osdir.com/ml/emacs.cedet/2007-05/msg00017.html#comment-304455138
> has resolved my problem. The intellisense works as I wanted :) Thank
> you ! But I still do not understand what was the mistake I did in my
> old .emacs file (last attachement).
>
> Howerver, I still have one question please.
>
> To force semantic to detect some preprocessor defines in a header
> file, I added the file like this:
>
> (add-to-list 'semantic-lex-c-preprocessor-symbol-file
> "/home/abdellatif/android/kernel/include/linux/start_kernel.h")
>
> It works, the defines are detected.
>
> But, I also need to add many other headers like this. How can I
> include a lisp file which contains a set of
> semantic-lex-c-preprocessor-symbol-file calls (to handle all the
> headers) in .emacs ? If that's not possible, is there another solution
> to parse all these headers without putting them all in the .emacs
> file. I already created a header file containing some defines and some
> headers to parse (#include). Unfortunately, only the defines are
> detected. The defines stored in the included headers are not detected.
>
> Thank you in advance
>
> On Sat, Oct 1, 2011 at 6:50 PM, Abdellatif El Khlifi
> <elkhlifiabdellatif@...> wrote:
>> Add to that, the "summarize includes current buffer" in the include
>> menu tells the following:
>>
>> Include Summary for File: ... main.c
>>
>> This file contains 141 tags, 63 of which are includes.
>> Unknown Includes: 0
>> Unparsed Includes: 0
>> Parsed Includes: 63
>>
>> ...
>>
>> Summary of all includes needed by main.c
>> ...
>> start_kernel.h : 0 tags, 0 are includes.
>> ...
>>
>>
>> So it appears that semantic doesn't parse the start_kernel.h header
>> automatically. I verified that other includes are parsed correctly.
>>
>>
>>
>> On Mon, Sep 26, 2011 at 1:07 AM, Abdellatif El Khlifi
>> <elkhlifiabdellatif@...> wrote:
>>> Hello,
>>>
>>> Thank you for the replies.
>>>
>>> I am using CEDET CVS version.
>>>
>>> The problem is exactly as follows:
>>>
>>> I have a C structure named X declared in a header file
>>> (start_kernel.h) included in the current C file (main.c which is
>>> located in a subdirectory of the kernel tree). And I defined a global
>>> variable g_x of type X.
>>>
>>> When I want the intellisense to appear when I type "g_x." the menu is
>>> not shown and an error like this is written below: "can not find types
>>> for "X" ".
>>>
>>> The result of semantic-analyze-debug-assist tells the following:
>>>
>>> --------------------------------------------------------------------------------
>>> Unable to find datatype for: "class X g_x".
>>> Declared type is: "class X {}"
>>> Raw data type is: ("X" type (:type "class") nil nil)
>>>
>>> Semantic could not find this data type in any of its global tables.
>>>
>>> Semantic locates datatypes through either the local scope, or the global
>>> typecache.
>>>
>>> ...
>>>
>>> --------------------------------------------------------------------------------
>>>
>>> Intellisense for types defined and instantiated in the current C file
>>> work with no problem (the menu is shown).
>>>
>>> I use the semantic-ia-complete-symbol-menu command bound to Control-space.
>>>
>>> When I open the C file and before trying the intellisense I do the
>>> following to clean possible wrong data cache: M-x
>>> semanticdb-typecache-complete-flush
>>>
>>>
>>> M-x semanticdb-typecache-dump
>>>
>>> I tried semantic-c-reset-preprocessor-symbol-map but I don't find it
>>> in the semantic completion list. Although, I put it in the .emacs
>>> file.
>>>
>>> You can find my kernel configurations in the .emacs file in the
>>> attachment (test.emacs).
>>>
>>> Thank you for all your efforts to help me.
>>>
>>> Regards
>>>
>>> On Sun, Sep 25, 2011 at 10:18 PM, Eric M. Ludlam<ericludlam@...> wrote:
>>>> Hi,
>>>>
>>>> This depends on which CEDET you are using. If you use CEDET from
>>>> sourceforge, then follow the instructions for enabling Semantic and EDE.
>>>> Linux kernel sources should be detected automatically. If not,
>>>> perhaps the detection algorithm needs to be updated.
>>>>
>>>> For intellisense, there are a range of ways you might get the completion
>>>> engine to start up. The simplest is to use
>>>> semantic-complete-analyze-inline which you can bind to a key, or have
>>>> enabled with global-semantic-idle-completions-mode.
>>>>
>>>> If you already have a completion engine picked out and it is not
>>>> completing as you would like, it is time to use
>>>> semantic-analyze-debug-assist to figure out what might be missing.
>>>>
>>>> Eric
>>>>
>>>> On 09/25/2011 01:07 PM, Abdellatif El Khlifi wrote:
>>>>> Hello,
>>>>>
>>>>> I need some help on working with ede-linux. I am trying to make
>>>>> intellisense working with my linux kernel project but without success.
>>>>> Can you provide me a working example if possible (an excerpt of the
>>>>> .emacs file).
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> All of the data generated in your IT infrastructure is seriously valuable.
>>>> Why? It contains a definitive record of application performance, security
>>>> threats, fraudulent activity, and more. Splunk takes this data and makes
>>>> sense of it. IT sense. And common sense.
>>>> http://p.sf.net/sfu/splunk-d2dcopy2
>>>> _______________________________________________
>>>> Cedet-devel mailing list
>>>> Cedet-devel@...
>>>> https://lists.sourceforge.net/lists/listinfo/cedet-devel
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
>
|