-
Notifications
You must be signed in to change notification settings - Fork 217
Description
There are issues using current CDT (with original Indexer) with GDB
The GNU Project Debugger
sources. I understand there is a new cdt-lsp
to try - unfortunately that is not as usable for me at the moment so maybe we can improve original implementation too.
Currently GDB
The GNU Project Debugger
sources are a mix of C and C++ language code where lots (about 500) of files have .c
extension but are in fact already transitioned to C++ and are compiled using C++ compiler (here, g++
). The other lots (also about 500) of .c
files are remaining C code and that of dependencies which are also in C language and are compiled using C compiler (here, gcc
). The major issues I see are:
-
I'm unable to configure CDT Indexer properly since I only know about file type mappings by file extension.
With that I can either configure per-projectFile Types
entry*.c -> C++ source file
which breaks Indexer for the other half because lots ofC
constructs are not validC++
, or do nothing andC++
half of files is not parsed properly because C Indexer parser is used. -
I'm using
Compilation Database Parser
withGDB
sources and it helps a lot but at the moment compilation database parser ask project to select language for discovered source file and uses that information to populate language-specific entry for macros etc..
This does not work forGDB
source since about half of.c
files areC++
and due to first issue discovered macros end up in the wrong language-specific bin with 50% chance.
Ideally I'd like Compilation Database Parser
to use discovered language type from compilation database and configure language for discovered source files in project for me. It already knows which compiler (e.g. g++
or gcc
) is used for each of compiled files so this should be possible. This probably requires adding a mapping selection of compiler to language in compilation database parser options but that should not be hard part.