Re: Some files that CEDET cannot parse and produce errors

"Eric M. Ludlam" <[email protected]>
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
Hi Tu

Thanks for the misc emails on parsing problems from linux headers.

I tried parsing your attached files, and they seemed to parse ok with no 
errors for me.  For your earlier linux_banner related issue, I don't 
have the exact same header, but the one I do have 
(linux-headers-3.13.0-27) parsed and completed ok.

This means you have something in your default macro table list that I 
don't that is somehow messing it up, or you have some version of hideif 
that is not what I have, or you have an old version of CEDET and we 
happen to have fixed that already.

The easy question then is if you are using the latest version of CEDET 
from the cedet bzr repository?

Next, lets see how you can debug these issues, and perhaps we can focus 
in on the issue.  For example, perhaps my found macros from GCC force 
CEDET to skip parsing the code that you parsed and had bugs in.

I guess the easiest thing would be to create a new buggy.h, and copy in 
the code you found that is throwing the error.  To zoom in on that, load 
in you file, such as jiffies.h, and put the cursor at the beginning, and do:

M-x semantic-lex-test RET

I think if it bails with an error, that should drop you in the right spot.

You can then copy over the bogus code into buggy.h and try it stand 
alone.   If the code you found (some #if statements I assume) you may 
need to also copy in any reference macros to make it work / fail.

This reduced case will then avoid anything that might be forcing my 
version to skip over the buggy code so I can see what the problem might be.

The code I think you are running into is related to the Emacs package 
"hideif" which is a handy tool for evaluating CPP macros for 
hiding/showing sections of code.

In case this is the problem, I have attached a patch that wraps up the 
code that hideif generates to capture errors.  This patch is against the 
latest version of CEDET, so if you are running something else, it should 
be easy to just copy it in to what you have.

I hope this helps.
Eric


On 05/30/2014 01:49 PM, Tu Do wrote:
> Sorry I forgot to attach *jiffies.h
>
>
> *
>
>
> On Sat, May 31, 2014 at 12:48 AM, Tu Do <[email protected]
> <mailto:[email protected]>> wrote:
>
>     One file is in
>     */usr/include/x86_64-linux-gnu/c++/4.8/ext/opt_random.h* from the
>     previous email I sent Alex.
>
>     One file is in *linux/include/linux/jiffies.h* . I got the following
>     error parsing this file:
>
>      > Parsing jiffies.h (LL)...
>      > Idle Work Parse Error: "#<buffer jiffies.h> - Arithmetic error"
>     *
>     *
>     When I tried to execute *bovinate*, I got this error:
>
>      > hif-shiftleft: Arithmetic error
>     *
>     *
>     *linux* is the linux kernel source tree.
>
>     I attached both files here. It seems CEDET having problem parsing
>     macros with arithmetic operations in it.
>
>     Regards,
>
>     Tu
>
>         While I was making CEDET parse /usr/include, it cannot parse
>         this particular file:
>         */usr/include/x86_64-linux-gnu/c++/4.8/ext/opt_random.h
>
>         *
>         I got this error:
>
>             Error running timer `semantic-idle-scheduler-function':
>             (wrong-type-argument number-or-marker-p
>             "__ORDER_LITTLE_ENDIAN__")
>
>
>         When I tried `bovinate`, I got this error:
>
>             eval: Wrong type argument: number-or-marker-p,
>             "__ORDER_LITTLE_ENDIAN__"
>
>
>         Since Semantic got stuck on this particular file, it cannot
>         continue. I think CEDET devs should implement a recovery mechanism.
>
>         Regards,
>
>         Tu.
>
>
>
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
>
>
>
> _______________________________________________
> Cedet-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cedet-devel

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech

_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel
bovine-c.patch (text/x-diff, 769 B)
=== modified file 'lisp/cedet/semantic/bovine/c.el'
*** lisp/cedet/semantic/bovine/c.el	2014-03-12 00:33:39 +0000
--- lisp/cedet/semantic/bovine/c.el	2014-06-03 00:53:33 +0000
***************
*** 503,509 ****
  	      (hif-canonicalize)
  	    (error nil))))
  
!     (let ((eval-form (eval parsedtokelist)))
        (if (or (not eval-form)
                (and (numberp eval-form)
                     (equal eval-form 0)));; ifdefline resulted in false
--- 503,511 ----
  	      (hif-canonicalize)
  	    (error nil))))
  
!     (let ((eval-form (condition-case nil
! 			 (eval parsedtokelist)
! 		       (error nil))))
        (if (or (not eval-form)
                (and (numberp eval-form)
                     (equal eval-form 0)));; ifdefline resulted in false
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.