Menu

#44 wrong dependencies (Indexer problem)

Version 1.x
closed
indexer (1)
5
2014-05-04
2014-03-03
jonathan
No

Hi,

On my setup I have some problem with the indexer. If I use the plugin version 1.7.x with eclipse Kepler SR1, the indexer work as expected. If I update the plugin OR the eclipse to SR2, the indexer doesn't find the intxx_t type in the stdint.h. This lead to a cascade of problem in the project. The indexer setting are per default in the workspace. I don't use per project specific setting for indexer.

I'm working with gnu arm embedded (version 2013q3)

Any idea of what can cause this ?

Any log file that I can create to view the probblem ?

regards

Jonathan

Discussion

  • Liviu Ionescu (ilg)

    • status: open --> accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • Liviu Ionescu (ilg)

    in SR2 I patched something with the indexer, it automatically triggers an update if the path or compiler option changes.

    I just checked it in a fresh sr2 install, with the latest plug-in from updates-test, and works as expected.

    I cannot figure out your problem, but indexer problems are generally cured by issuing the command right click -> Index -> Rebuild.

    I doubt it has something to do with the toolchain, but I would also suggest you install the 2013q4 in parallel, and compare the results. I had once a problem when the toolchain got damaged, and I had to reinstall it.

     
  • jonathan

    jonathan - 2014-03-06

    Hi,

    Thanx for your time.

    Here some log from the concole when the index start

    c:/program files/gnu tools arm embedded/4.7 2013q3/bin/../lib/gcc/arm-none-eabi/4.7.4/cc1plus.exe -E -quiet -v -P -imultilib armv7e-m/fpu -iprefix c:\program files\gnu tools arm embedded\4.7 2013q3\bin../lib/gcc/arm-none-eabi/4.7.4/ -isysroot c:\program files\gnu tools arm embedded\4.7 2013q3\bin../arm-none-eabi -MT $@ -dD -DUSES_INITFINI C:/projects/MICR-0805/Firmware/stm32_workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu++11 -Wall -Wextra -Wno-psabi -fno-exceptions -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -gdwarf-3 -fworking-directory -O0 -dD
    cc1plus.exe: error: to generate dependencies you must specify either -M or -MM

    So in my projet settings, I add this -MT"$@" to have the dependency working correctly. But this seem to have an bad effect on the indexer.

    regards

    Jonathan

     
  • Liviu Ionescu (ilg)

    So in my projet settings, I add this -MT"$@" to have the dependency working correctly. But this seem to have an bad effect on the indexer.

    hmmm... this is the problem, all options manually added to the compiler are also passed to the indexer.

    I don't know why you manually add -MT, it should be passed automatically in the makefile to all compile lines:

    arm-none-eabi-gcc ... -MMD -MP -MF"src/main.d" -MT"src/main.d" ...

     

    Last edit: Liviu Ionescu (ilg) 2014-03-08
  • jonathan

    jonathan - 2014-03-07

    Hi,

    If I don't do this, if we change a header file, the c/cpp file that depend on this header are not compiled in.

    With this hack, it's work. I think the index crash beacase the " are escaped. we got -MT $@ instead of -MT"$@"

    I'm not an expert at all with the dependency thing og gcc...

    is it possible to add this option in the makefile directly ?

    regards

    Jonathan

     
  • Liviu Ionescu (ilg)

    the index crash beacase the " are escaped. we got -MT $@ instead of -MT"$@"

    the indexer crashes because you add -MT to its compile line. none of the -Mxx options should be passed to the indexer to work.

    if we change a header file, the c/cpp file that depend on this header are not compiled in.

    then we should investigate what is wrong with the dependencies, not with the indexer.

    can you copy me the compile line from the makefile used to compile main.c, as it is originally, when the dependencies do not work?

     

    Last edit: Liviu Ionescu (ilg) 2014-03-08
  • jonathan

    jonathan - 2014-03-10

    Hi,

    I have found this link to help me resove the problem.

    http://stackoverflow.com/questions/14845428/auto-dependencies-not-working-with-eclipse-cdt-c-project

    Here the main.cpp line from makefile.

    arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wextra -Wno-psabi  -g3 -gdwarf-3 -D__GXX_EXPERIMENTAL_CXX0X__ -DUSE_VT100 -DUSE_PRINTF_CHECK_FORMAT_REMOVED -DUSE_STDPERIPH_DRIVER -DDEBUG_PRINTF -DUSE_FREERTOS -Dsprintf=sprintk -DUSE_PRINTK_64BITS -DUSE_PRINTK_DOUBLE -DEARLY_TRACES_NEEDED -DCORTEX_M4 -DSTM32F427X -DUSE_FULL_ASSERT -DUSE_MPU -DRTC_CLOCK_SOURCE_LSE -DSTM32F4XX -"C:\projects\UTILITIES" -std=gnu++0x -fno-exceptions -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -c -o "$@" "$<"
    

    in my main.d file I have this

    SRC/main.d: ../SRC/main.cpp \ C:\projects/FreeRTOS.h \ C:\projects/include/projdefs.h \

    I have modified a little bit the inclupath to not reveal private information.

    If you need more information, let me know.

    Regards

    Jonathan

     
  • Liviu Ionescu (ilg)

    I'll further investigate.

     
  • Liviu Ionescu (ilg)

    • summary: Indexer problem --> wrong dependencies (Indexer problem)
     
  • Liviu Ionescu (ilg)

    for testing purposes I applied a patch inspired by your solution, i.e. overwriting the default CDT -MT option with -MT"$@", but placed in a location that does not interfere with the indexer.

    could you try the beta version from http://gnuarmeclipse.sourceforge.net/updates-test if it works as expected?

     
  • jonathan

    jonathan - 2014-03-18

    Hi,

    Yes it's works as expected. Do you think that this modification can be part of the 0.5.5 version too ? We have many project that are build with the old plugin.

    regards

    Jonathan

     
  • Liviu Ionescu (ilg)

    unfortunately not. 0.5.5 is end-of-life and no longer supported. I suggest you migrate the old projects to the new plug-in.

     
  • Liviu Ionescu (ilg)

    we did some further tests, and with make 4.0 on gnu/linux the -MT"$@" is not necessary, the .d rules seem to be automatically understood.

    can you check the version of the make program you are using? (and provide more details about the environment, plus the sequence of steps to reproduce the problem)

    it would be very useful to distil a sample project that fails to build properly with the original .d target, and is fine with the patch and the .o target.

     
  • jonathan

    jonathan - 2014-03-18

    Hi,

    here some info

    Microsoft Windows XP [version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\vmUser>make --version
    GNU Make 3.81
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.

    This program built for i686-pc-mingw32

    C:\Documents and Settings\vmUser>

    to reproduce the problem

    • Create a new c++ project
    • Select Executable -> STM32F4xx StdPerph C/C++ project
    • Select all the default
    • build
    • modify BlinkLed.h
    • build. When the bug is there, the main.cpp is not recompiled.

    Hope this help

    Jonathan

     
  • Liviu Ionescu (ilg)

    that's strange, on my Mac it always works, even when the bug is there, as long as I run the make from inside Eclipse.

    if I run 'make all' from a terminal, the default configuration does not work, but the patched one does.

    I tried several examples on gnu/linux, and they also worked, although they shouldn't.

    I don't know what to say, it seems that Eclipse does some tricks that help the wrong configuration work.

    the good part is that the patched configuration seems to always work, so we'll leave it like this.

     
  • jonathan

    jonathan - 2014-03-19

    Hi,

    I would like to thank-you for your effort you put in this plugin. we use it from the beginning and we are always happy to contribute to it.

    continue your good work !!!

    Jonathan

     
  • Liviu Ionescu (ilg)

    I would like to thank-you...

    you are welcome!

    if you think it is worth, you can add a review in the SourceForge project page.

    always happy to contribute to it

    all contributions (comments/bugs/suggestions/etc) are highly appreciated :-)

     
  • Liviu Ionescu (ilg)

    the first patch proved not functional when using the internal builder, which does not require the -M* options.

    I removed the patch from the command line and added a new commandLineGenerator, to replace the .d to .o on the fly.

    the new beta version is available from updates-test, I would appreciate your feedback.

     
  • Liviu Ionescu (ilg)

    always happy to contribute to it

    btw, I added a new tracker for issues with the Beta versions.

    if you wish to contribute, you can provide feedback for the new entries.

    even better, you can subscribe to the Beta versions tracker (the upper right envelope or rss), and be notified when new features are added.

     

    Last edit: Liviu Ionescu (ilg) 2014-03-26
  • jonathan

    jonathan - 2014-03-28

    Hi,

    I tested both configuration (external and internal build and looks good to me.

    Jonathan

     
    • Liviu Ionescu (ilg)

      ok, thank you.

      for the records, could you document the test procedure you used in the 'Beta versions' newly inserted issue (https://sourceforge.net/p/gnuarmeclipse/beta-versions/4/).

      did you subscribe to the new tracker?

       
  • Liviu Ionescu (ilg)

    • status: accepted --> closed
     
  • Liviu Ionescu (ilg)

    fixed in 2.2.1-201404120702