Hi, sorry it's taken me a while to get back to you. I've updated from
CVS as of now (april 21st), and added this to my .emacs:
(add-hook 'c-initialization-hook
'(lambda ()
(require 'semantic-gcc)
(semantic-gcc-setup)))
Two small issues- "make utest" still fails with: ...
>> Setting up tests to run @ Tue Apr 21 16:50:08 2009
- Running multi-lang parsing ...
* C tests...
* ERROR: (buffer-read-only #<buffer sutest.c>)
to debug this test point, execute:
semantic-utest-main
** Exiting Test Suite. **
make: *** [utest] Error 1
---
2nd thing is good, libintl.h seems to parse OK now. But it's giving a
write error now-
Error Writing Table: #<semanticdb-table libintl.h>
Save Error: "listp": c:/Documents and Settings/Stephen
Edwards/Application
Data/.semanticdb/!drive_c!cygwin!usr!include!semantic.cache
---
3rd, I'm still unable to get "printf" to expand. I think the Lex C
preprocessing is broken here.
On Fri, Apr 10, 2009 at 6:27 PM, Eric M. Ludlam <eric@...> wrote:
> This is likely because Semantic caches old results. If you are
> restarting your Emacs, you can just delete the file in the
> ~/.semanticdb directory that maps to where stdio.h lives. In Emacs,
> you can use the Senator menu to force a reparse.
Clearing the directory, forcing reparse, no difference
>>_EXFUN. Also, when I restart emacs and look at the customization for
>>that symbol-file variable, they're cleared:
>>
>>Semantic Lex C Preprocessor Symbol File: Hide Value
>>INS
>> State: CHANGED outside Customize; operating on it here may be unreliable.
>>
>>I don't explicitly touch it in my .emacs file, so some other function
>>is clearing it.
>
> If you customize only for the current session, then restarting Emacs
> would reset it.
Sorry for not being clearer, I saved and set for future sessions,
adding two files through the customization interface:
"c:/cygwin/usr/include/_ansi.h" and
"c:/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h". Doing that
adds a line to a section of ~/.emacs. Then I restart emacs and go to
my customization screen, look at "Semantic Lex C Preprocessor Symbol
File" again, and it says:
"CHANGED outside Customize; operating on it here may be unreliable"
and the two files I added are missing.
The customization section of my .emacs shows the additional file, but
it disappears from the customization interface.When I look in my
.emacs, the preprocessor files are there:
(custom-set-variables
....
'(semantic-c-dependency-system-include-path (quote ("/usr/include"
"\\cygwin\\usr\\include"
"/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/")))
'(semantic-lex-c-preprocessor-symbol-file (quote
("c:/cygwin/usr/include/_ansi.h"
"c:/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h")))
'(semanticdb-project-roots (quote
("C:/DOCUME~1/STEPHE~1/MYDOCU~1/PROGRA~1/API/PRECIS~1/NCUDEV~1/PRI-NCU"
"C:\\DOCUME~1\\STEPHE~1\\MYDOCU~1\\PROGRA~1\\API\\brocade\\src\\MANTIS~1\\phase3\\scripts\\python\\NFOS")))
...)
... but C-h v semantic-lex-c-preprocessor-symbol-file tells me its value is nil
seems like something is clearing my customization.
Some other relevant portions of my ~/.emacs:
;; Load CEDET.
;; See cedet/common/cedet.info for configuration details.
(load-file "/Program Files/Emacs/site-lisp/cedet/common/cedet.el")
;; Enable EDE (Project Management) features
(global-ede-mode 1)
;; * This enables some tools useful for coding, such as summary mode
;; imenu support, and the semantic navigator
(semantic-load-enable-excessive-code-helpers)
(add-hook 'c-initialization-hook
'(lambda ()
(require 'semantic-gcc)
(semantic-gcc-setup)))
(add-hook 'c-mode-common-hook
'(lambda ()
(require 'tempo-c-cpp)
(define-key c-mode-map (kbd "C-<tab>")
'semantic-ia-complete-symbol-menu)))
(require 'semantic-ia)
(defun my-semantic-hook ()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
---
> Do you know of a way to query your gcc (ie, gcc -v as is done now in
> semantic-gcc.el) so that it provides your include directory.
I didn't have gcc set up to support c++, so it was choking on the
default command. In retrospect I could have used the optional arg and
passed in one of these-
echo | cpp -Wp,-v (--- or ---) cpp -Wp,-v <nul
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/include"
ignoring duplicate directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include
/usr/include
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
ECHO is on.
- or -
c:\cygwin\usr\include>touch foo.c && gcc -v -E foo.c && del foo.c
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with:
/usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --verbose
--prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry
--enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
/usr/lib/gcc/i686-pc-cygwin/3.4.4/cc1.exe -E -quiet -v -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
-idirafter /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api
foo.c -mtune=pentiumpro
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/include"
ignoring duplicate directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include
/usr/include
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
End of search list.
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"
... instead of using one of those command, I installed the c++ portion
of cygwins gcc, so that the default command would work, and as to
avoid future surprises. Despite that, I'm still missing symbols.
semantic-c-describe-environment says:
Include Path Summary:
This file's system include path is:
/usr/include
\cygwin\usr\include
/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/
Macro Summary:
Built-in symbol map:
__THROW =
__const = const
__restrict =
__declspec = ((spp-arg-list (foo) 1 . 2))
__attribute__ = ((spp-arg-list (foo) 1 . 2))
--- and M-x semantic-lex-spp-describe only tells me
Macro Value
DEBUG_POS ((number "0" 11654 . 11655))
__THROW nil
__declspec ((spp-arg-list ("foo") 1 . 2))
__const "const"
__restrict nil
__attribute__ ((spp-arg-list ("foo") 1 . 2))
---
> This is missing the output of defines via use of a cpp query that does
> occur during semantic-gcc queries. It is mostly #defines like:
>
> #define linux 1
Here's one way of getting all the built-in defines on cygwin's gcc-
C:\Program Files\Emacs\site-lisp\cedet>touch foo.c
C:\Program Files\Emacs\site-lisp\cedet>gcc -dM -E foo.c
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 65535U
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
...
#define __unix__ 1
#define __DECIMAL_DIG__ 21
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 3
#define _cdecl __attribute__((__cdecl__))
...
#define __cdecl __attribute__((__cdecl__))
#define __NO_INLINE__ 1
#define __i386 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "3.4.4 (cygming special, gdc 0.12, using dmd 0.125)"
#define _X86_ 1
#define i386 1
#define unix 1
#define __i386__ 1
...
#define __declspec(x) __attribute__((x))
...etc
> If the paths above are standard, it would be nice to update
> semantic-gcc to include the guess /cywin/usr/include and whatever else
> is useful in place of the Linux path when on a cygwin platform.
well most people probably don't exclude c++, so gcc-setup should get
the paths ok.
> M-: system-type
>
> return cygwin, or win32?
windows-nt
...
|