Hi Damian,
I haven't seen the issue in any C files I've edited recently. Could you
do the following?
1. Setup to get stack traces as you had before.
2. Visit the function semantic-decoration-on-includes-highlight-default,
and eval it, like this:
M-x find-function RET semantic-decoration-on-includes-highlight-default RET
C-M-x ;; eval-defun
3. reproduce.
this will expand the stack trace and hopefully point more directly at
the line causing the problem.
The include file in question, from your stack, has no position
information. This is pretty strange. Thus, I'll guess the attached
patch helps, but it doesn't explain why you have a tag entering this
code w/out a position.
I'd guess you were using some external tagger, like ctags, and for some
reason that produced tags associated with your buffer with no position.
You config indicates this is not the case. Did you try the ctags
parser once in the past? Those tags will still be in your .semanticdb
cache directory. Thus, exiting emacs, deleting your ~/.semanticdb cache
directory and restarting might also just "fix" the problem without the
use of the above patch. In that case, we'd need to figure out where the
bogus tag first came from (like ctags) and see if we can't find and fix
that bug instead.
Eric
Damien Deville wrote:
> Hi cedet-devel,
>
> Since an unknown number of versions of cedet i suffer from a strange bug
> that i was able to isolate but not reproduce on simple case yesterday.
>
> First i use last emacs trunk and last cedet from cvs, here is an extract
> of how i enable the modules i want to use in cedet.
>
> ; minimal + custom (only activate what we need and use)
> (semantic-load-enable-minimum-features)
> (global-semantic-idle-scheduler-mode 1)
> (global-semantic-idle-summary-mode 1)
> (global-semantic-idle-tag-highlight-mode 1)
> (global-senator-minor-mode 1)
> (global-semantic-decoration-mode 1)
>
> The bug is the following:
>
> Sometimes, When i open some .c or .h file semantic throws the following
> error, it also happens when jumping to the definition of a symbol using
> gtags.el
>
> "semantic-decoration-on-includes-highlight: Wrong type argument: arrayp,
> nil"
>
> If i enable debug-on-error here is what i have when trying to switch
> from a .c file to a .h file using sourcepair (partially anonymized):
>
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
> semantic-decoration-on-includes-highlight-default(("foo.h" include
> nil (dependency-file "/somepath/foo.h") nil))
> semantic-decoration-on-includes-highlight(("foo.h" include nil
> (dependency-file "/somepath/foo.h") nil))
> semantic-decorate-add-decorations((("_XX_XXX_H" variable
> (:constant-flag t) nil nil) ("foo.h" include nil (dependency-file
> "/somepath/foo.h") nil) ("func1" function (:prototype-flag t :pointer 1
> :arguments ... :type "char") nil nil)))
> semantic-decoration-mode-setup()
> semantic-decoration-mode()
> run-hooks(semantic-init-hook)
> semantic-new-buffer-fcn()
> run-hooks(mode-local-init-hook)
> #[nil "\300 \210\301\302!\207" [activate-mode-local-bindings
> run-hooks mode-local-init-hook] 2]()
> mode-local-map-file-buffers(#[nil "\300 \210\301\302!\207"
> [activate-mode-local-bindings run-hooks mode-local-init-hook] 2]
> #[nil " =?\207" [mode-local--init-mode major-mode] 2] (#<buffer foo2.h>))
> mode-local-post-major-mode-change()
> run-hooks(find-file-hook)
> after-find-file(nil t)
> find-file-noselect-1(#<buffer foo2.h> "/somepath/foo2.h" nil nil
> "/somepath/foo2.h" (10976667 94))
> find-file-noselect("/somepath/foo2.h" nil nil nil)
> find-file("/somepath/foo2.h")
> byte-code("...." [temp search-path possible-filenames
> matching-filename path-to-check sourcepair-analyze-filename buffer-name
> 0 message "%s is not a recognized source or header file (consider
> updating sourcepair-source-extensions or sourcepair-header-extensions)"
> nil 3 -2 "/*" sourcepair-find-one-of t throw found-matching-file
> find-file "No matching file for " " (consider updating
> sourcepair-source-path, sourcepair-header-path)"] 5)
> sourcepair-load()
> call-interactively(sourcepair-load nil nil)
>
> Here is another trace if i just ido-open-file:
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
> semantic-decoration-on-includes-highlight-default(("foo.h" include
> nil (dependency-file "/somepath/foo.h") nil))
> semantic-decoration-on-includes-highlight(("foo.h" include nil
> (dependency-file "/somepath/foo.h") nil))
> semantic-decorate-add-decorations((("_XX_XXX_H" variable
> (:constant-flag t) nil nil) ("foo.h" include nil (dependency-file
> "/somepath/foo.h") nil) ("func1" function (:prototype-flag t :pointer 1
> :arguments ... :type "char") nil nil)))
> semantic-decoration-mode-setup()
> semantic-decoration-mode()
> run-hooks(semantic-init-hook)
> semantic-new-buffer-fcn()
> run-hooks(mode-local-init-hook)
> #[nil "\300 \210\301\302!\207" [activate-mode-local-bindings
> run-hooks mode-local-init-hook] 2]()
> mode-local-map-file-buffers(#[nil "\300 \210\301\302!\207"
> [activate-mode-local-bindings run-hooks mode-local-init-hook] 2]
> #[nil " =?\207" [mode-local--init-mode major-mode] 2] (#<buffer foo2.h>))
> mode-local-post-major-mode-change()
> run-hooks(find-file-hook)
> after-find-file(nil t)
> find-file-noselect-1(#<buffer foo2.h> "/somepath/foo2.h" nil nil
> "/somepath/foo2.h" (10976667 94))
> find-file-noselect("/somepath/foo2.h" nil nil)
> ido-file-internal(raise-frame)
> ido-find-file()
> call-interactively(ido-find-file nil nil)
>
> The issue vanish if i disable (global-semantic-decoration-mode 1) but i
> lose the overline decoration on function declaration which i find fancy
> and usefull, so to keep that part and disable the decoration on include
> i am forced to remove the ;;###autoload in semantinc-decorate-include.el.
>
> If you need any other information do not hesitate to ask.
>
> Damien
|