Subject: Re: edebug #77226 (was: second question about CEDET)

From: andres.ramirez <[email-masked]>
Date: Thu, 22 May 2025 17:15:55 +0000

Hi. Eric.
My comments below.
>>>>> "Eric" == Eric Ludlam <[email-masked]> writes:

    Eric> I don't have a full dev setup with Qt to try out your examples anymore, but I agree with
    Eric> your high level assessment that the setup fcn looks like it should be order independent
    Eric> since it loads the files it's modifying.

Ok.

    Eric> My first recommendation is to run M-x semantic-describe-buffer once Emacs starts (possibly
    Eric> forcing semantic/ctxt to also load) and check the created display buffer to make sure the
    Eric> correct items are listed in the system-includes related variable.  If they are listed, but
    Eric> it "doesn't work" as you say, then there is some order dependency being cleaned up with a
    Eric> timer.

This is the one I have tested.
I have run the oneline (when the bug behaviour is expected):
--8<---------------cut here---------------start------------->8---
emacs -Q -nw -l /tmp/.emacs-rc-cedet-t.el -f semantic-mode -f cedet-lambda/load-qt4 /tmp/cedet/impressive/qt4/main_cedet_demo.cpp --title Fail
--8<---------------cut here---------------end--------------->8---
And after running M-x semantic-describe-buffer, the buffer content has
been saved to 'semantic-describe-buffer-fails.sk'.

After it, 
I have run the oneline (where the order calling of functions is
switched)(aka workaround):
--8<---------------cut here---------------start------------->8---
emacs -Q -nw -l /tmp/.emacs-rc-cedet-t.el -f cedet-lambda/load-qt4 -f semantic-mode /tmp/cedet/impressive/qt4/main_cedet_demo.cpp --title OK
--8<---------------cut here---------------end--------------->8---
And after running M-x semantic-describe-buffer, the buffer content has
been saved to 'semantic-describe-buffer-ok.sk'.

Then I have diffted both files:
--8<---------------cut here---------------start------------->8---
diff -u /tmp/semantic-describe-buffer-fails.sk /tmp/semantic-describe-buffer-ok.sk
--- /tmp/semantic-describe-buffer-fails.sk	2025-05-13 13:18:07.149930891 -0500
+++ /tmp/semantic-describe-buffer-ok.sk	2025-05-13 12:55:08.146650860 -0500
@@ -105,7 +105,7 @@
        ‘semantic-expand-c-tag’
 
      ‘semantic-lex-spp-macro-symbol-obarray’ value is
-       #<obarray n=906>
+       #<obarray n=1113>
 
   ** Overloaded functions

Diff finished.  Thu May 22 12:03:53 2025
--8<---------------cut here---------------end--------------->8---

¿What could be seen from here?. It is 'obarray is larger when it works'. Could
I inspect the content of obarray?.

    Eric> Another thing is to try an input argument like this to see what is going on at different
    Eric> steps / orders to see if the thing you want added is there.  --eval '(message "%s:%s"
    Eric> (current-buffer) semantic-dependency-system-include-path)'

No difference when invoking M-: (message "%s:%s" (current-buffer) semantic-dependency-system-include-path)

Best Regards
Andrés Ramírez