Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer marking method "Invalid Arguments"...(Indexer marking method "Invalid Arguments"...)
Indexer marking method "Invalid Arguments"... [message #1845018] Sun, 03 October 2021 05:20 Go to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
I'm having an issue with the indexer in a C++ file marking a method as "Invalid Arguments" however it is not as the file compiles just fine. Furthermore the indexer does not complain about the same code in a regular C file. This is using the ESP32 tool chain and I posted this to their forum and have received not response in a month so I thought I would try here. Here is Eclipse with the code in a C file:

index.php/fa/41075/0/

And here is Eclipse with the same code formatted in a CPP file.

index.php/fa/41076/0/

I have also attempted to debug this using the the indexer debug options explained here https://www.eclipse.org/lists/cdt-dev/msg08941.html and when I request Index->Rebuild I see the files that I am including being processed so it is indeed finding them.

.
.
.
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/freertos/include/freertos/FreeRTOS.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/esp_hw_support/include/esp_intr_alloc.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/esp_common/include/esp_types.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/soc/esp32/include/soc/io_mux_reg.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/soc/esp32/include/soc/gpio_struct.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/soc/esp32/include/soc/gpio_reg.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/soc/esp32/include/soc/gpio_sig_map.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/soc/include/soc/gpio_periph.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/hal/include/hal/gpio_types.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/esp_rom/include/esp32/rom/gpio.h
Indexer: adding file:/C:/Users/lehrian/Documents/esp-idf/components/driver/include/driver/gpio.h
Indexer: adding file:/C:/Users/lehrian/Documents/ESP32/sample_project/main/TestClass.h
Indexer: adding file:/C:/Users/lehrian/Documents/ESP32/sample_project/main/TestClass.cpp
Indexer: processed \sample_project\main\TestClass.cpp [543 ms]
Indexer: parsing \sample_project\build\detect_compiler_builtins.cpp
[1,633,237,917,329] Parsed detect_compiler_builtins.cpp: 1 ms. Ambiguity resolution: 0 ms
Indexer: processed \sample_project\build\detect_compiler_builtins.cpp [1 ms]
Indexer: parsing \sample_project\build\bootloader\config\sdkconfig.h
[1,633,237,917,331] Parsed sdkconfig.h: 1 ms. Ambiguity resolution: 0 ms
Indexer: adding file:/C:/Users/lehrian/Documents/ESP32/sample_project/build/bootloader/config/sdkconfig.h
Indexer: processed \sample_project\build\bootloader\config\sdkconfig.h [2 ms]
C/C++ Indexer: Project 'sample_project' (7 sources, 253 headers)
    Options: indexer='PDOMFastIndexer', parseAllFiles=true, unusedHeaders=useCPP, skipReferences=false, skipImplicitReferences=false, skipTypeReferences=false, skipMacroReferences=false.
    Database: 4292608 bytes
    Timings: 1239 total, 527 parser, 50 resolution, 379 index update.
    Errors: 0 internal, 0 include, 0 scanner, 2 syntax errors.
    Names: 7597 declarations, 10287 references, 0(0.00%) unresolved.
    Cache[204MB]: 1673253 hits, 0(0.00%) misses.
Indexer: completed PDOMUpdateTask[1257ms]
Indexer: start PDOMFastIndexerTask
C/C++ Indexer: Project 'sample_project' (0 sources, 0 headers)
    Options: indexer='PDOMFastIndexer', parseAllFiles=true, unusedHeaders=useCPP, skipReferences=false, skipImplicitReferences=false, skipTypeReferences=false, skipMacroReferences=false.
    Database: 4292608 bytes
    Timings: 1 total, 0 parser, 0 resolution, 0 index update.
    Errors: 0 internal, 0 include, 0 scanner, 0 syntax errors.
    Names: 0 declarations, 0 references, 0(0.00%) unresolved.
    Cache[204MB]: 99 hits, 0(0.00%) misses.


As my code does compile I can do what I need to do, but it is difficult because I never know if the marker is an actual error or not until I attempt a compile. Any ideas what is wrong? Any ideas how to debug this? My next step would be running Eclipse in debug in Eclipse and seeing if I can catch the bug that way.
Re: Indexer marking method "Invalid Arguments"... [message #1845025 is a reply to message #1845018] Sun, 03 October 2021 17:31 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
Please click the Problems tab and see there what the system is complaining about.

--

Tauno Voipio
Re: Indexer marking method "Invalid Arguments"... [message #1845026 is a reply to message #1845025] Sun, 03 October 2021 17:39 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
Thank you very much for your reply. I appreciate your help greatly. Here is the Problems Tab.
index.php/fa/41078/0/
Re: Indexer marking method "Invalid Arguments"... [message #1845046 is a reply to message #1845026] Mon, 04 October 2021 14:16 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
Check the header defining the symbols complained about. I do not know the ESP32 mess well enough to point to the right one.

As plain C goes fine but C++ does not, my guess is that there are extern "C" definitions missing in the affected header.


--

Tauno Voipio

[Updated on: Mon, 04 October 2021 14:16]

Report message to a moderator

Re: Indexer marking method "Invalid Arguments"... [message #1845054 is a reply to message #1845046] Mon, 04 October 2021 22:13 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
Just to be clear, both the C and C++ files compile without error or warning. This just seems to be an issue with the Eclipse indexer not liking the C++ file.

As I look through the included headers they all seem to have a

Quote:

#ifdef __cplusplus
extern "C" {
#endif


at the top and a corresponding closure at the bottom. I will continue to investigate and see if this leads anywhere.

Interestingly, if I comment out
Quote:

#include <freertos/FreeRTOS.h>

at the top of the C++ file the error markers in Eclipse go away the file file will still compile.

[Updated on: Mon, 04 October 2021 22:17]

Report message to a moderator

Re: Indexer marking method "Invalid Arguments"... [message #1845084 is a reply to message #1845054] Wed, 06 October 2021 08:16 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
The next question is: What does FreeRTOS.h do to __cplusplus?


--

Tauno Voipio
Re: Indexer marking method "Invalid Arguments"... [message #1845095 is a reply to message #1845054] Wed, 06 October 2021 16:02 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
At the end of the day the problem here is that the indexer is handling the header files differently than the compiler. I can't figure out why this is happening by analyzing the indexer log files so the only way I can think to debug this would be to run Eclipse in the debugger. I have done this before with a plugin but the source code for the plugin was available via GitHub. Is there documentation available as to how to download and run the indexer plugin (or any of the Eclipse core plugins) in the debugger?
Re: Indexer marking method "Invalid Arguments"... [message #1845096 is a reply to message #1845084] Wed, 06 October 2021 16:37 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
Sorry, didn't see your question. It uses it to extern "C" { a bunch of methods. \

/* *INDENT-OFF* */
#ifdef __cplusplus
    extern "C" {
#endif
/* *INDENT-ON* */


EDIT: Actually it doesn't seem to be declaring any methods, it is conditionally including some other headers and creating some defines. I commented out the extern "C" and it still compiled fine and the error was still present. I'm going through all the included files and looking at them as well. They seem to be mostly conditional defines but I'm not through them all yet.

[Updated on: Wed, 06 October 2021 16:56]

Report message to a moderator

Re: Indexer marking method "Invalid Arguments"... [message #1845098 is a reply to message #1845096] Wed, 06 October 2021 17:00 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
There are the Includes missing in the project setup, see picture.

index.php/fa/41108/0/

Open your project's Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc, and click the language.

I see that your project is a CMake one. How did you set it up?


--

Tauno Voipio
Re: Indexer marking method "Invalid Arguments"... [message #1845100 is a reply to message #1845096] Wed, 06 October 2021 17:18 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
I found a fix! Apparently if I move the gpio.h import above the FreeRTOS.h import it fixes the issue. I don't know why, I was just hacking, but it works. I hate these kind of solutions, but it allows me to move forward.

#include <driver/gpio.h>
#include <freertos/FreeRTOS.h>
#include "TestClass.h"

TestClass::TestClass(uint8_t pin){
	this->gpio=pin;
}

void TestClass::testMethod(){
	gpio_pad_select_gpio((unsigned char)this->gpio);
}
Re: Indexer marking method "Invalid Arguments"... [message #1845103 is a reply to message #1845098] Wed, 06 October 2021 21:03 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
I set this example up using the Espressif sample_project template.

File -> New -> Espressif IDF Project
Enter project name and click next.
Check "Create a project using one of the templates"
Select the sample_project template.

Then I added the 4 files test_function.c & .h and TestClass.cpp & .h.

So those includes are for ARM. This is an xtensa core which I believe is different. I don't have and ARM folder under the gcc folder in the expressif tools folder.

Re: Indexer marking method "Invalid Arguments"... [message #1845106 is a reply to message #1845103] Thu, 07 October 2021 07:04 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
I took the Cortex-M3 project just to show how the includes directory looks.

You have two complications from an usual cross-compilation:
- the target processor is not the usual ARM or Cortex,
- the project has been set up with CMake.

It is pretty obvious that the indexer does not know the toolkit correctly.

Please open the project properties pages and check how your template has set up the compiler toolkit. For CMake, there are two good plug-ins in the Eclipse Marketplace:
- cmake4eclipse,
- CMake Editor.

The cmake4eclipse sets up its own entries in the project setup pages, and it is able to pick the details for the indexer, using the CMake scripts.


--

Tauno Voipio
Re: Indexer marking method "Invalid Arguments"... [message #1845118 is a reply to message #1845106] Thu, 07 October 2021 19:22 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
Espressif went to cmake in version 4 of their IDF. I do have CMake Editor installed but not cmake4eclispe. I will install it and see if that provides happiness.
Re: Indexer marking method "Invalid Arguments"... [message #1845120 is a reply to message #1845118] Thu, 07 October 2021 19:38 Go to previous messageGo to next message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
So it seems that cmake4eclipse no longer installs from the marketplace based on comments here https://marketplace.eclipse.org/content/cmake4eclipse. However there does appear to be:

Quote:

C/C++ CMake Build Support - Preview 10.4.1.202109142059 org.eclipse.cdt.cmake.feature.group Eclipse CDT


Which has the provider listed as Eclipse CDT and which I do have installed. I do realize I'm very much on the bleeding edge but acknowledge there is tremendous functionality in the system. I am able to run the device with a hardware debugger in Eclipse and now that I have eliminated the false error markers am able to move forward with my project. I can only guess that the CMake Build Support will get better and better since it is still considered "Preview". Thanks for taking the time to respond and help me with this issue.
Re: Indexer marking method "Invalid Arguments"... [message #1846927 is a reply to message #1845120] Sat, 09 October 2021 08:30 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 686
Registered: August 2014
Senior Member
cmake4eclipse 2.1.4 is in the Marketplace. I installed a copy on 7th October.


--

Tauno Voipio
Re: Indexer marking method "Invalid Arguments"... [message #1847027 is a reply to message #1846927] Tue, 12 October 2021 14:24 Go to previous message
David Lehrian is currently offline David LehrianFriend
Messages: 10
Registered: October 2021
Junior Member
So I received a response from espressif/idf-eclipse-plugin on GitHub. They acknowledged the issue and believe they have a fix that should be forthcoming.

https://github.com/espressif/idf-eclipse-plugin/issues/346
Previous Topic:How to set / option ( perspective ?) to debug C code
Next Topic: Anyone use Eclipse CDT to develop on FreeBSD?
Goto Forum:
  


Current Time: Sun Dec 05 05:45:23 GMT 2021

Powered by FUDForum. Page generated in 0.02881 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top