Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes7
-rw-r--r--.gitignore3
-rw-r--r--.mvn/extensions.xml2
-rw-r--r--build/org.eclipse.cdt.autotools-feature/feature.xml2
-rw-r--r--build/org.eclipse.cdt.autotools.docs/pom.xml2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java10
-rw-r--r--build/org.eclipse.cdt.cmake-feature/feature.xml2
-rw-r--r--build/org.eclipse.cdt.cmake.ui.tests/pom.xml2
-rw-r--r--build/org.eclipse.cdt.core.autotools-feature/feature.xml2
-rw-r--r--build/org.eclipse.cdt.gnu.build-feature/feature.xml2
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java924
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.properties1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.xml6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java460
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java37
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties21
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/CompilationDatabaseParserOptionPage.java295
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/Messages.java32
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/messages.properties19
-rw-r--r--build/org.eclipse.cdt.meson-feature/feature.xml2
-rw-r--r--build/org.eclipse.cdt.meson.docs/pom.xml2
-rw-r--r--build/org.eclipse.cdt.meson.ui.tests/META-INF/MANIFEST.MF1
-rw-r--r--build/org.eclipse.cdt.meson.ui.tests/pom.xml2
-rw-r--r--build/pom.xml2
-rw-r--r--codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF2
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/IProblemPreferenceDescriptor.java1
-rw-r--r--codan/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.linux.ppc64le/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.linux.x86_64/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.linux/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.macosx/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java33
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/pom.xml3
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.win32/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/c/GCCScannerExtensionConfiguration.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java45
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java2
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java51
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java11
-rw-r--r--core/org.eclipse.cdt.ui.tests/pom.xml3
-rw-r--r--core/org.eclipse.cdt.ui/.settings/.api_filters19
-rw-r--r--core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CommentsTabPage.java3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java236
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java262
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/build/ToolChainPreferencePage.java21
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java2
-rw-r--r--core/pom.xml2
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc-feature/feature.xml2
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml2
-rw-r--r--cross/org.eclipse.cdt.launch.remote-feature/feature.xml2
-rw-r--r--cross/org.eclipse.cdt.launch.remote-feature/pom.xml2
-rw-r--r--cross/org.eclipse.cdt.launch.serial-feature/feature.xml2
-rw-r--r--cross/org.eclipse.cdt.launch.serial.ui/META-INF/MANIFEST.MF1
-rw-r--r--cross/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.application.doc/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.application.product/debug.product2
-rw-r--r--debug/org.eclipse.cdt.debug.application.product/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/pom.xml3
-rw-r--r--debug/org.eclipse.cdt.debug.application/plugin.properties2
-rw-r--r--debug/org.eclipse.cdt.debug.application/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.dap-feature/feature.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.dap/META-INF/MANIFEST.MF7
-rw-r--r--debug/org.eclipse.cdt.debug.dap/debug-servers/package.json2
-rw-r--r--debug/org.eclipse.cdt.debug.dap/debug-servers/yarn.lock14
-rw-r--r--debug/org.eclipse.cdt.debug.dap/pom.xml4
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/Activator.java4
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/CDTDebugProtocol.java97
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDebugTarget.java1
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackend.java382
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackendFactory.java29
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/ICDTDebugProtocolServer.java1
-rw-r--r--debug/org.eclipse.cdt.debug.standalone-feature/feature.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java13
-rw-r--r--debug/org.eclipse.cdt.gdb-feature/feature.xml2
-rw-r--r--debug/org.eclipse.cdt.gdb-feature/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.gnu.debug-feature/feature.xml2
-rw-r--r--debug/pom.xml2
-rw-r--r--disable_intro_in_tests.ini3
-rw-r--r--doc/org.eclipse.cdt.doc.isv/pom.xml2
-rw-r--r--doc/org.eclipse.cdt.doc.user/pom.xml2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests/META-INF/MANIFEST.MF1
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/META-INF/MANIFEST.MF1
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout.pngbin0 -> 131 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout@2x.pngbin0 -> 180 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout.pngbin0 -> 154 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout@2x.pngbin0 -> 207 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/collapse_all.gifbin0 -> 161 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/existingFiles.gifbin0 -> 354 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/expand_all.gifbin0 -> 167 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout.pngbin0 -> 123 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout@2x.pngbin0 -> 199 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout.pngbin0 -> 148 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout@2x.pngbin0 -> 230 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/view16/debugsources_view.gifbin0 -> 353 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/refresh.gifbin0 -> 385 bytes
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml41
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesLabelProvider.java119
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.java52
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.properties35
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeContentProvider.java105
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeElement.java220
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesView.java736
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesViewComparator.java85
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/IDebugSourcesImagesConst.java30
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesCollapseAction.java52
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesExpandAction.java51
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesFlattendedTree.java64
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesNormalTree.java64
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesShowExistingFilesOnly.java66
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesViewRefresh.java93
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBSourceLookup.java157
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IDebugSourceFiles.java67
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIFileListExecSourceFiles.java39
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MiSourceFilesInfo.java164
-rw-r--r--dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/feature.xml2
-rw-r--r--dsf-gdb/org.eclipse.cdt.gnu.multicorevisualizer-feature/feature.xml2
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml4
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java25
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java58
-rw-r--r--dsf-gdb/pom.xml2
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf-feature/feature.xml2
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml2
-rw-r--r--dsf/pom.xml2
-rw-r--r--jtag/org.eclipse.cdt.debug.dap.gdbjtag-feature/feature.xml2
-rw-r--r--jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/Activator.java2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag-feature/feature.xml2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml6
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java7
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml5
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java10
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/PEMicro.java51
-rw-r--r--jtag/pom.xml2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher-feature/feature.xml2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher-feature/pom.xml2
-rw-r--r--launch/pom.xml2
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb-feature/feature.xml2
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF2
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/LLDBPreferenceInitializer.java7
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java1
-rw-r--r--llvm/org.eclipse.cdt.managedbuilder.llvm-feature/feature.xml2
-rw-r--r--llvm/pom.xml2
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml2
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml2
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java2
-rw-r--r--lrparser/pom.xml2
-rw-r--r--lsp/org.eclipse.cdt.lsp-feature/feature.xml2
-rw-r--r--lsp/org.eclipse.cdt.lsp.core.tests/META-INF/MANIFEST.MF1
-rw-r--r--lsp/org.eclipse.cdt.lsp.core.tests/pom.xml3
-rw-r--r--lsp/pom.xml2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory-feature/feature.xml2
-rw-r--r--memory/pom.xml2
-rw-r--r--native/org.eclipse.cdt.native.serial/META-INF/MANIFEST.MF2
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/Makefile14
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/Readme.md21
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/serial.c3
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.sobin13408 -> 13192 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilibbin13756 -> 13476 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dllbin126038 -> 380597 bytes
-rw-r--r--native/org.eclipse.cdt.native.serial/pom.xml80
-rw-r--r--native/pom.xml2
-rw-r--r--pom.xml73
-rw-r--r--qt/org.eclipse.cdt.qt-feature/feature.xml2
-rw-r--r--qt/org.eclipse.cdt.qt.core.tests/META-INF/MANIFEST.MF1
-rw-r--r--qt/pom.xml2
-rw-r--r--releng/CDT.setup16
-rw-r--r--releng/org.eclipse.cdt-feature/feature.xml2
-rw-r--r--releng/org.eclipse.cdt-feature/p2.inf4
-rw-r--r--releng/org.eclipse.cdt-feature/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.native-feature/feature.xml2
-rw-r--r--releng/org.eclipse.cdt.platform-feature/feature.xml2
-rw-r--r--releng/org.eclipse.cdt.repo/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.sdk-feature/feature.xml2
-rw-r--r--releng/org.eclipse.cdt.sdk-feature/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.sdk/META-INF/MANIFEST.MF2
-rw-r--r--releng/org.eclipse.cdt.target/cdt.target12
-rw-r--r--releng/org.eclipse.cdt.target/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.testing-feature/feature.xml2
-rw-r--r--releng/org.eclipse.cdt.testing-feature/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.testing.repo/pom.xml2
-rw-r--r--releng/org.eclipse.cdt.testing/pom.xml2
-rw-r--r--releng/org.eclipse.cdt/META-INF/MANIFEST.MF2
-rw-r--r--releng/org.eclipse.cdt/pom.xml4
-rw-r--r--releng/pom.xml2
-rwxr-xr-xreleng/scripts/check_code_cleanliness.sh99
-rwxr-xr-xreleng/scripts/check_mvn_plugin_versions.sh13
-rw-r--r--remote/pom.xml2
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner.feature/feature.xml2
-rw-r--r--testsrunner/pom.xml2
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml4
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.core.tests/META-INF/MANIFEST.MF1
-rw-r--r--toolchains/arduino/pom.xml2
-rw-r--r--upc/org.eclipse.cdt.bupc-feature/feature.xml2
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc.feature/feature.xml2
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc.sdk.feature/feature.xml2
-rw-r--r--upc/pom.xml2
-rw-r--r--util/pom.xml2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer-feature/feature.xml2
-rw-r--r--visualizer/pom.xml2
-rw-r--r--windows/org.eclipse.cdt.msw-feature/feature.xml2
-rw-r--r--windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.jdt.launching.prefs3
-rw-r--r--windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.pde.prefs2
-rw-r--r--windows/pom.xml2
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc.tests/META-INF/MANIFEST.MF1
-rw-r--r--xlc/org.eclipse.cdt.xlc.feature/feature.xml2
-rw-r--r--xlc/org.eclipse.cdt.xlc.sdk-feature/feature.xml2
-rw-r--r--xlc/pom.xml2
233 files changed, 5262 insertions, 934 deletions
diff --git a/.gitattributes b/.gitattributes
index 8bd9401822..ad8bb8f989 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -7,6 +7,7 @@ COPYING text
NEWS text
README text
*.txt text
+*.md text
*.zip binary
# C-like Sources
@@ -45,12 +46,12 @@ Makefile text
# (These should not normally be checked in, exceptions for pre-compiled libraries and tests)
*.o binary
*.d text
-*.dll binary
+*.dll binary diff=dll
*.a binary
*.exe binary
*.out binary
*.app binary
-*.jnilib binary
+*.jnilib binary diff=hex
*.so binary
# Web/Javascript/Node
@@ -64,6 +65,8 @@ package-list text
*.xml text
*.xsd text
*.xsl text
+yarn.lock text
+*.lock text
# Images
*.gif binary
diff --git a/.gitignore b/.gitignore
index df6c7c8440..a2267a1d9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,6 @@
.nfs*
.polyglot.build.properties
check_code_cleanliness_workspace/
+.META-INF_MANIFEST.MF
+.polyglot..META-INF_MANIFEST.MF
+*.takari_issue_192
diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml
index 022bbfae27..c1a9cd6e99 100644
--- a/.mvn/extensions.xml
+++ b/.mvn/extensions.xml
@@ -3,6 +3,6 @@
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
- <version>1.4.0</version>
+ <version>1.5.1</version>
</extension>
</extensions>
diff --git a/build/org.eclipse.cdt.autotools-feature/feature.xml b/build/org.eclipse.cdt.autotools-feature/feature.xml
index 7ea0f68d17..f9c42a79ad 100644
--- a/build/org.eclipse.cdt.autotools-feature/feature.xml
+++ b/build/org.eclipse.cdt.autotools-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.autotools"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%provider"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/build/org.eclipse.cdt.autotools.docs/pom.xml b/build/org.eclipse.cdt.autotools.docs/pom.xml
index 76e3a41c05..4b02dd0a52 100644
--- a/build/org.eclipse.cdt.autotools.docs/pom.xml
+++ b/build/org.eclipse.cdt.autotools.docs/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/build/org.eclipse.cdt.autotools.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.autotools.ui/META-INF/MANIFEST.MF
index 9508e0dbfb..1b73fcc4ed 100644
--- a/build/org.eclipse.cdt.autotools.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.autotools.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.autotools.ui;singleton:=true
-Bundle-Version: 2.0.200.qualifier
+Bundle-Version: 2.0.300.qualifier
Bundle-Activator: org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin
Bundle-Localization: plugin
Bundle-Vendor: %provider
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
index 02e26ddfa9..19fce55b7c 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
@@ -409,7 +409,7 @@ public class AutoconfParser {
}
throw new BlockEndCondition(token);
- // 1. Check for end of statement
+ // 1. Check for end of statement
case ITokenConstants.EOL:
case ITokenConstants.SEMI:
return;
@@ -462,7 +462,7 @@ public class AutoconfParser {
INVALID_FI);
throw new BlockEndCondition(token);
- // 4. Look for for/while loops
+ // 4. Look for for/while loops
case ITokenConstants.SH_FOR:
checkLineStart(token, atStart);
parseBlock(parent, token, new AutoconfForElement());
@@ -489,7 +489,7 @@ public class AutoconfParser {
AutoconfUntilElement.class, AutoconfSelectElement.class }, INVALID_DONE);
throw new BlockEndCondition(token);
- // 5. Look for case statements
+ // 5. Look for case statements
case ITokenConstants.SH_CASE:
checkLineStart(token, atStart);
parseCaseBlock(parent, token, new AutoconfCaseElement());
@@ -507,7 +507,7 @@ public class AutoconfParser {
new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class }, INVALID_ESAC);
throw new BlockEndCondition(token);
- // 6. Check for HERE documents
+ // 6. Check for HERE documents
case ITokenConstants.SH_HERE:
case ITokenConstants.SH_HERE_DASH:
@@ -584,7 +584,7 @@ public class AutoconfParser {
case ITokenConstants.EOF:
throw new BlockEndCondition(token);
- // 2. Check macro expansions
+ // 2. Check macro expansions
case ITokenConstants.WORD:
token = checkMacro(parent, token);
break;
diff --git a/build/org.eclipse.cdt.cmake-feature/feature.xml b/build/org.eclipse.cdt.cmake-feature/feature.xml
index b17b4b9782..a150a5bf46 100644
--- a/build/org.eclipse.cdt.cmake-feature/feature.xml
+++ b/build/org.eclipse.cdt.cmake-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.cmake"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/build/org.eclipse.cdt.cmake.ui.tests/pom.xml b/build/org.eclipse.cdt.cmake.ui.tests/pom.xml
index 89cfaf7b34..52f5454a5e 100644
--- a/build/org.eclipse.cdt.cmake.ui.tests/pom.xml
+++ b/build/org.eclipse.cdt.cmake.ui.tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/build/org.eclipse.cdt.core.autotools-feature/feature.xml b/build/org.eclipse.cdt.core.autotools-feature/feature.xml
index 7f497109d8..8aacd684e0 100644
--- a/build/org.eclipse.cdt.core.autotools-feature/feature.xml
+++ b/build/org.eclipse.cdt.core.autotools-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.core.autotools"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/build/org.eclipse.cdt.gnu.build-feature/feature.xml b/build/org.eclipse.cdt.gnu.build-feature/feature.xml
index 03611da060..0a36c3b035 100644
--- a/build/org.eclipse.cdt.gnu.build-feature/feature.xml
+++ b/build/org.eclipse.cdt.gnu.build-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.build"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
index 19ed970c91..be6f23c292 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
@@ -422,7 +422,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
/**
* Check if the resource is in the list of source entries.
-
+
* @param rc - resource to check.
* @return {@code true} if the resource is a source folder, {@code false} otherwise.
*
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF
index af5e610101..1ba05c9894 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Export-Package: org.eclipse.cdt.managedbuilder.core.tests,
org.eclipse.cdt.projectmodel.tests
Require-Bundle: org.eclipse.core.runtime,
org.junit,
+ org.junit.jupiter.api,
org.eclipse.core.resources,
org.eclipse.ui,
org.eclipse.ui.ide,
@@ -25,3 +26,4 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core.tests
+Import-Package: com.google.gson
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
index 2a13429717..e638ee210a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/AllLanguageSettingsProvidersMBSTests.java
@@ -32,5 +32,6 @@ public class AllLanguageSettingsProvidersMBSTests extends TestSuite {
addTestSuite(GCCBuildCommandParserTest.class);
addTestSuite(BuiltinSpecsDetectorTest.class);
addTestSuite(GCCBuiltinSpecsDetectorTest.class);
+ addTestSuite(CompilationDatabaseParserTest.class);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java
new file mode 100644
index 0000000000..4a0490c26f
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java
@@ -0,0 +1,924 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.language.settings.providers.tests;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileReader;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
+import org.eclipse.cdt.core.settings.model.CMacroEntry;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
+import org.eclipse.cdt.core.settings.model.util.CDataUtil;
+import org.eclipse.cdt.core.testplugin.ResourceHelper;
+import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
+import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer;
+import org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompilationDatabaseParser;
+import org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompileCommand;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.Job;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
+
+/**
+ * Test cases to test CompilationDatabaseParser (compile_commands.json).
+ */
+public class CompilationDatabaseParserTest extends BaseTestCase {
+ private static final String COMPILATION_DATABASE_PARSER_EXT = "org.eclipse.cdt.managedbuilder.core.CompilationDatabaseParser"; //$NON-NLS-1$
+ private static final String GCC_BUILD_COMMAND_PARSER_EXT = "org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"; //$NON-NLS-1$
+
+ private static final String ATTR_CDB_PATH = "cdb-path"; //$NON-NLS-1$
+ private static final String ATTR_BUILD_PARSER_ID = "build-parser-id"; //$NON-NLS-1$
+ private static final String ATTR_CDB_MODIFIED_TIME = "cdb-modified-time"; //$NON-NLS-1$
+ private static final String ATTR_EXCLUDE_FILES = "exclude-files"; //$NON-NLS-1$
+
+ private IFile fCdbFile;
+ private IFile fSourceFile;
+ private IFile fSourceFile2;
+ private IFile fOutsideCdbSourceFile;
+ private IProject fProject;
+ private IFolder fFolder;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ try {
+ joingLanguageSettingsJobs();
+ } catch (Exception e) {
+ // ignore
+ }
+ super.tearDown();
+ }
+
+ private void createTestProject() throws Exception {
+ createTestProject(true, true, true, true, true);
+ }
+
+ private void createTestProject(boolean useAbsoluteSourcePath, boolean haveCommandDir, boolean validCommandDir,
+ boolean haveCommandLine, boolean validCommandLine) throws Exception {
+ fProject = ResourceHelper.createCDTProjectWithConfig(getName());
+ fFolder = ResourceHelper.createFolder(fProject, "folder");
+
+ IFile sourceFile = fFolder.getFile("test.cpp");
+ if (sourceFile.exists()) {
+ sourceFile.delete(true, null);
+ }
+
+ IFile sourceFile2 = fProject.getFile("test.cpp");
+ if (sourceFile2.exists()) {
+ sourceFile2.delete(true, null);
+ }
+
+ fSourceFile = ResourceHelper.createFile(sourceFile, "//comment");
+ fSourceFile2 = ResourceHelper.createFile(sourceFile2, "//comment2");
+
+ IFile outsideSourceFile = fFolder.getFile("outside.cpp");
+ if (outsideSourceFile.exists()) {
+ outsideSourceFile.delete(true, null);
+ }
+ fOutsideCdbSourceFile = ResourceHelper.createFile(outsideSourceFile, "//comment");
+
+ IFile file = fProject.getFile("compile_commands.json");
+ if (file.exists()) {
+ file.delete(true, null);
+ }
+
+ // Command for proj/folder/test.cpp
+ CompileCommand command = new CompileCommand();
+ if (haveCommandDir) {
+ if (validCommandDir)
+ command.directory = fSourceFile.getParent().getLocation().toOSString();
+ else
+ command.directory = "foo";
+ }
+ String sourceFilePath = fSourceFile.getLocation().toOSString();
+ if (!useAbsoluteSourcePath) {
+ sourceFilePath = fSourceFile.getLocation().makeRelativeTo(fSourceFile.getParent().getLocation())
+ .toOSString();
+ }
+ command.file = sourceFilePath;
+ if (haveCommandLine) {
+ if (validCommandLine)
+ command.command = "g++ -I" + fFolder.getLocation().toOSString() + " -DFOO=2 " + sourceFilePath;
+ else
+ command.command = "foo";
+ }
+
+ // Command for proj/test.cpp
+ CompileCommand command2 = new CompileCommand();
+ if (haveCommandDir) {
+ if (validCommandDir)
+ command2.directory = fSourceFile2.getParent().getLocation().toOSString();
+ else
+ command2.directory = "foo";
+ }
+ String sourceFilePath2 = fSourceFile2.getLocation().toOSString();
+ if (!useAbsoluteSourcePath) {
+ sourceFilePath2 = fSourceFile2.getLocation().makeRelativeTo(fSourceFile2.getParent().getLocation())
+ .toOSString();
+ }
+ command2.file = sourceFilePath2;
+ if (haveCommandLine) {
+ if (validCommandLine)
+ command2.command = "g++ -I" + fFolder.getLocation().toOSString() + " -DFOO=3 " + sourceFilePath2;
+ else
+ command2.command = "foo";
+ }
+
+ CompileCommand[] commands = new CompileCommand[2];
+ commands[0] = command;
+ commands[1] = command2;
+
+ String json = new Gson().toJson(commands);
+ fCdbFile = ResourceHelper.createFile(file, json);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+ GCCBuildCommandParser buildCommandParser = (GCCBuildCommandParser) LanguageSettingsManager
+ .getExtensionProviderCopy(GCC_BUILD_COMMAND_PARSER_EXT, true);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+ List<ILanguageSettingsProvider> providers = new ArrayList<>();
+ providers.add(buildCommandParser);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ }
+
+ private void joingLanguageSettingsJobs() throws InterruptedException {
+ Job.getJobManager().join(CompilationDatabaseParser.JOB_FAMILY_COMPILATION_DATABASE_PARSER, null);
+ Job.getJobManager().join(AbstractBuildCommandParser.JOB_FAMILY_BUILD_COMMAND_PARSER, null);
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_PROJECT,
+ null);
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE,
+ null);
+ }
+
+ /**
+ * Helper method to fetch a configuration description.
+ */
+ private ICConfigurationDescription getConfigurationDescription(IProject project, boolean writable) {
+ CoreModel coreModel = CoreModel.getDefault();
+ ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
+ // project description
+ ICProjectDescription projectDescription = mngr.getProjectDescription(project, writable);
+ assertNotNull(projectDescription);
+ assertEquals(1, projectDescription.getConfigurations().length);
+ // configuration description
+ ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
+ return cfgDescriptions[0];
+ }
+
+ private void addLanguageSettingsProvider(ILanguageSettingsProvider provider) throws CoreException {
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+ List<ILanguageSettingsProvider> providers = new ArrayList<>(
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders());
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ }
+
+ private CompilationDatabaseParser getCompilationDatabaseParser() throws CoreException {
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, false);
+ List<ILanguageSettingsProvider> settingProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
+ for (ILanguageSettingsProvider languageSettingsProvider : settingProviders) {
+ if (languageSettingsProvider instanceof CompilationDatabaseParser) {
+ return (CompilationDatabaseParser) languageSettingsProvider;
+ }
+ }
+
+ return null;
+ }
+
+ private void assertExpectedEntries(CompilationDatabaseParser parser) {
+ assertFalse(parser.isEmpty());
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID);
+
+ CIncludePathEntry expected = new CIncludePathEntry("/${ProjName}/folder",
+ CIncludePathEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry entry = (CIncludePathEntry) entries.get(0);
+ assertEquals(expected.getName(), entry.getName());
+ assertEquals(expected.getValue(), entry.getValue());
+ assertEquals(expected.getKind(), entry.getKind());
+ assertEquals(expected.getFlags(), entry.getFlags());
+ assertEquals(expected, entry);
+
+ assertEquals(new CMacroEntry("FOO", "2", 0), entries.get(1));
+
+ entries = parser.getSettingEntries(resCfgDescription, fSourceFile2, GPPLanguage.ID);
+
+ entry = (CIncludePathEntry) entries.get(0);
+ assertEquals(expected.getName(), entry.getName());
+ assertEquals(expected.getValue(), entry.getValue());
+ assertEquals(expected.getKind(), entry.getKind());
+ assertEquals(expected.getFlags(), entry.getFlags());
+ assertEquals(expected, entry);
+
+ assertEquals(new CMacroEntry("FOO", "3", 0), entries.get(1));
+ }
+
+ public void testParseCDB_WritableConfigDesc() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertExpectedEntries(parser);
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_ReadonlyConfigDesc() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, false);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ // processCompileCommandsFile restarts itself in a WorkspaceJob with a writable config desc so we have to wait for the job.
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertExpectedEntries(getCompilationDatabaseParser());
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_WithExclusions() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ assertExpectedEntries(parser);
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertTrue(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_ReadonlyConfigDescWithExclusions() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, false);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ // processCompileCommandsFile restarts itself in a WorkspaceJob with a writable config desc so we have to wait for the job.
+ joingLanguageSettingsJobs();
+
+ assertExpectedEntries(getCompilationDatabaseParser());
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertTrue(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_NoBuildCommandParser() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_InvalidBuildCommandParser() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT + "foo");
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_NonExistantCDB() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(new Path("/testParseCDB_NonExistantCDB"));
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_EmptyCDBPath() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(new Path(""));
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_DirectoryCDBPath() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getParent().getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_InvalidJson() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ //Make the Json invalid
+ String cdbOsString = fCdbFile.getLocation().toOSString();
+ Files.write(Paths.get(cdbOsString), new byte[] { 'f', 'o', 'o' });
+ try (FileReader reader = new FileReader(cdbOsString)) {
+ Gson gson = new Gson();
+ CompileCommand[] compileCommands = gson.fromJson(reader, CompileCommand[].class);
+ assertTrue("Json should have been invalid and thrown an JsonSyntaxException", false);
+ } catch (JsonSyntaxException e) {
+
+ } catch (Exception e) {
+ assertTrue("Json should have been invalid and thrown an JsonSyntaxException", false);
+ }
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ parser.setExcludeFiles(true);
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ assertThrows(CoreException.class, () -> parser.processCompileCommandsFile(null, cfgDescription));
+
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ CompilationDatabaseParser resultParser = getCompilationDatabaseParser();
+ assertTrue(resultParser.isEmpty());
+ List<ICLanguageSettingEntry> entries = resultParser.getSettingEntries(resCfgDescription, fSourceFile,
+ GPPLanguage.ID);
+ assertTrue(entries == null);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_RelativePaths() throws Exception {
+ createTestProject(false, true, true, true, true);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ assertExpectedEntries(parser);
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_InvalidCommandDir() throws Exception {
+ createTestProject(true, true, false, true, true);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(resCfgDescription, fSourceFile2,
+ GPPLanguage.ID);
+
+ // Since the directory could not be used as working dir, both files CDB entries will match
+ // the same source file and only the last one will be recorder in language setting entries.
+ CIncludePathEntry expected = new CIncludePathEntry("/${ProjName}/folder",
+ CIncludePathEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry entry = (CIncludePathEntry) entries.get(0);
+ assertEquals(expected.getName(), entry.getName());
+ assertEquals(expected.getValue(), entry.getValue());
+ assertEquals(expected.getKind(), entry.getKind());
+ assertEquals(expected.getFlags(), entry.getFlags());
+ assertEquals(expected, entry);
+
+ assertEquals(new CMacroEntry("FOO", "3", 0), entries.get(1));
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_NoCommandDir() throws Exception {
+ createTestProject(true, false, true, true, true);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(resCfgDescription, fSourceFile2,
+ GPPLanguage.ID);
+
+ // Since the directory could not be used as working dir, both files CDB entries will match
+ // the same source file and only the last one will be recorder in language setting entries.
+ CIncludePathEntry expected = new CIncludePathEntry("/${ProjName}/folder",
+ CIncludePathEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry entry = (CIncludePathEntry) entries.get(0);
+ assertEquals(expected.getName(), entry.getName());
+ assertEquals(expected.getValue(), entry.getValue());
+ assertEquals(expected.getKind(), entry.getKind());
+ assertEquals(expected.getFlags(), entry.getFlags());
+ assertEquals(expected, entry);
+
+ assertEquals(new CMacroEntry("FOO", "3", 0), entries.get(1));
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_InvalidCommandLine() throws Exception {
+ createTestProject(true, true, true, true, false);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertNull(parser.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID));
+ assertNull(parser.getSettingEntries(resCfgDescription, fSourceFile2, GPPLanguage.ID));
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testParseCDB_NoCommandLine() throws Exception {
+ createTestProject(true, true, true, false, true);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertNull(parser.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID));
+ assertNull(parser.getSettingEntries(resCfgDescription, fSourceFile2, GPPLanguage.ID));
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+ }
+
+ public void testClear() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+
+ parser.clear();
+ assertTrue(parser.isEmpty());
+ assertEquals(parser.getProperty(ATTR_CDB_MODIFIED_TIME), "");
+ }
+
+ public void testCloneShallow() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+
+ CompilationDatabaseParser clonedShallow = parser.cloneShallow();
+ assertEquals(clonedShallow.getProperty(ATTR_CDB_PATH), parser.getProperty(ATTR_CDB_PATH));
+ assertEquals(clonedShallow.getProperty(ATTR_BUILD_PARSER_ID), parser.getProperty(ATTR_BUILD_PARSER_ID));
+ assertEquals(clonedShallow.getProperty(ATTR_EXCLUDE_FILES), parser.getProperty(ATTR_EXCLUDE_FILES));
+ assertEquals(clonedShallow.getProperty(ATTR_CDB_MODIFIED_TIME), "");
+ }
+
+ public void testClone() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID);
+ assertExpectedEntries(parser);
+
+ CompilationDatabaseParser cloned = parser.clone();
+ entries = cloned.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID);
+ assertExpectedEntries(cloned);
+ assertEquals(cloned.getProperty(ATTR_CDB_MODIFIED_TIME), parser.getProperty(ATTR_CDB_MODIFIED_TIME));
+ }
+
+ public void testParseCDB_testUpdateWithModifiedCDB() throws Exception {
+ createTestProject();
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePath(fCdbFile.getLocation());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ assertExpectedEntries(parser);
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+
+ // Modify the CDB, only to contain one file with different macro definition.
+ String sourceFilePath = fSourceFile.getLocation().toOSString();
+ CompileCommand command = new CompileCommand();
+ command.directory = fSourceFile.getParent().getLocation().toOSString();
+ command.file = sourceFilePath;
+ command.command = "g++ -I" + fFolder.getLocation().toOSString() + " -DFOO=200 " + sourceFilePath;
+ CompileCommand[] commands = new CompileCommand[1];
+ commands[0] = command;
+ String json = new Gson().toJson(commands);
+ InputStream inputStream = new ByteArrayInputStream(json.getBytes());
+ // Make sure the timestamp is different, in case the code runs fast and
+ // in case the system doesn't support milliseconds granularity.
+ while (fCdbFile.getLocalTimeStamp() / 1000 == System.currentTimeMillis() / 1000) {
+ Thread.sleep(5);
+ }
+ fCdbFile.setContents(inputStream, IFile.FORCE, null);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ assertFalse(parser.isEmpty());
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ resCfgDescription = getConfigurationDescription(fProject, false);
+
+ assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
+
+ assertFalse(parser.isEmpty());
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(resCfgDescription, fSourceFile, GPPLanguage.ID);
+
+ CIncludePathEntry expected = new CIncludePathEntry("/${ProjName}/folder",
+ CIncludePathEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry entry = (CIncludePathEntry) entries.get(0);
+ assertEquals(expected.getName(), entry.getName());
+ assertEquals(expected.getValue(), entry.getValue());
+ assertEquals(expected.getKind(), entry.getKind());
+ assertEquals(expected.getFlags(), entry.getFlags());
+ assertEquals(expected, entry);
+
+ assertEquals(new CMacroEntry("FOO", "200", 0), entries.get(1));
+
+ entries = parser.getSettingEntries(resCfgDescription, fSourceFile2, GPPLanguage.ID);
+ assertNull(entries);
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
index 12509538aa..7557234565 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig,
org.eclipse.cdt.managedbuilder.internal.core;x-friends:="org.eclipse.cdt.managedbuilder.ui",
org.eclipse.cdt.managedbuilder.internal.dataprovider;x-internal:=true,
org.eclipse.cdt.managedbuilder.internal.envvar;x-internal:=true,
- org.eclipse.cdt.managedbuilder.internal.language.settings.providers;x-internal:=true,
+ org.eclipse.cdt.managedbuilder.internal.language.settings.providers;x-friends:="org.eclipse.cdt.managedbuilder.ui",
org.eclipse.cdt.managedbuilder.internal.macros;x-friends:="org.eclipse.cdt.managedbuilder.ui",
org.eclipse.cdt.managedbuilder.internal.scannerconfig;x-internal:=true,
org.eclipse.cdt.managedbuilder.language.settings.providers,
@@ -41,5 +41,6 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: com.ibm.icu.text
+Import-Package: com.google.gson;version="2.8.0",
+ com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties b/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
index 5112695a91..4c0da31292 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
@@ -84,6 +84,7 @@ GCCBuildOutputParser.name = CDT GCC Build Output Parser
GCCBuiltinCompilerSettings.name = CDT GCC Built-in Compiler Settings
GCCBuiltinCompilerSettingsMinGW.name = CDT GCC Built-in Compiler Settings MinGW
GCCBuiltinCompilerSettingsCygwin.name = CDT GCC Built-in Compiler Settings Cygwin
+CompilationDatabaseParser.name = Compilation Database Parser
ManagedBuildSettingEntries.name = CDT Managed Build Setting Entries
extension.name.8 = C/C++ Scanner Discovery Problem
extension.name.9 = HeadlessBuilder Additional Settings \ No newline at end of file
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index 8a3c70c496..a9ebd32a79 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
@@ -645,6 +645,12 @@
parameter="(g?cc)|([gc]\+\+)|(clang)"
prefer-non-shared="true">
</provider>
+ <provider
+ class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompilationDatabaseParser"
+ id="org.eclipse.cdt.managedbuilder.core.CompilationDatabaseParser"
+ name="%CompilationDatabaseParser.name"
+ prefer-non-shared="true">
+ </provider>
</extension>
<extension
id="scanner.discovery.problem"
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index 8186fc07b9..a59d13da68 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -858,7 +858,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return;
}
} catch (BuildException e) {return;}
-
+
// Figure out if there is a listener for this change
IResource resource = config.getOwner();
List listeners = (List) getBuildModelListeners().get(resource);
@@ -1363,10 +1363,10 @@ public class ManagedBuildManager extends AbstractCExtension {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.newDocument();
-
+
// Get the build information for the project
ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project);
-
+
// Save the build info
if (buildInfo != null &&
!buildInfo.isReadOnly() &&
@@ -1381,7 +1381,7 @@ public class ManagedBuildManager extends AbstractCExtension {
Element rootElement = doc.createElement(ROOT_NODE_NAME);
doc.appendChild(rootElement);
buildInfo.serialize(doc, rootElement);
-
+
// Transform the document to something we can save in a file
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -1391,11 +1391,11 @@ public class ManagedBuildManager extends AbstractCExtension {
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(stream);
transformer.transform(source, result);
-
+
// Save the document
IFile projectFile = project.getFile(SETTINGS_FILE_NAME);
String utfString = stream.toString("UTF-8"); //$NON-NLS-1$
-
+
if (projectFile.exists()) {
if (projectFile.isReadOnly()) {
// If we are not running headless, and there is a UI Window around, grab it
@@ -1429,7 +1429,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} else {
projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$
}
-
+
// Close the streams
stream.close();
}
@@ -1450,7 +1450,7 @@ public class ManagedBuildManager extends AbstractCExtension {
// Save to IFile failed
err = e;
}
-
+
if (err != null) {
// Put out an error message indicating that the attempted write to the .cdtbuild project file failed
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@@ -1458,7 +1458,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
-
+
final Shell shell = window.getShell();
if (shell != null) {
final String exceptionMsg = err.getMessage();
@@ -1536,9 +1536,9 @@ public class ManagedBuildManager extends AbstractCExtension {
for (int i=0; i < configs.length; i++) {
ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_CLOSE);
}
-
+
info.setValid(false);
-
+
try {
resource.setSessionProperty(buildInfoProperty, null);
} catch (CoreException e) {
@@ -1819,7 +1819,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return Status.OK_STATUS;
/*
ManagedBuildInfo buildInfo = null;
-
+
// Get the build info associated with this project for this session
try {
buildInfo = findBuildInfo(resource.getProject(), true);
@@ -2729,7 +2729,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (Exception e) {
// TODO: Issue error reagarding not being able to load the project file (.cdtbuild)
}
-
+
try {
// Check if the project needs its container initialized
initBuildInfoContainer(buildInfo);
@@ -2811,7 +2811,7 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
/* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) {
ManagedBuildInfo buildInfo = null;
-
+
// Check if there is any build info associated with this project for this session
try {
buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty);
@@ -2822,7 +2822,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (CoreException e) {
// return null;
}
-
+
if(buildInfo == null && forceLoad){
// Make sure the extension information is loaded first
try {
@@ -2831,11 +2831,11 @@ public class ManagedBuildManager extends AbstractCExtension {
e.printStackTrace();
return null;
}
-
-
+
+
// Check weather getBuildInfo is called from converter
buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
-
+
// Nothing in session store, so see if we can load it from cdtbuild
if (buildInfo == null) {
try {
@@ -2852,7 +2852,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
-
+
final Shell shell = window.getShell();
final String exceptionMsg = e.getMessage();
//using syncExec could cause a dead-lock
@@ -2866,7 +2866,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
} );
}
-
+
if (buildInfo != null && !buildInfo.isContainerInited()) {
// NOTE: If this is called inside the above rule, then an IllegalArgumentException can
// occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule.
@@ -2880,7 +2880,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
}
-
+
return buildInfo;
}
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
new file mode 100644
index 0000000000..e8c1e8a4a1
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.attribute.FileTime;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
+import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICElementVisitor;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICSourceEntry;
+import org.eclipse.cdt.core.settings.model.util.CDataUtil;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+
+import com.google.gson.Gson;
+import com.ibm.icu.text.MessageFormat;
+
+/**
+ * This language settings provider takes a compile_commands.json file as input (aka, Compilation Database or CDB) and parses the commands
+ * with a chosen build command parser. The command parser can be any implementation of AbstractBuildCommandParser like GCCBuildCommandParser,
+ * MSVCBuildCommandParser, etc.
+ *
+ * The file json file is re-parsed at startup through {@link #registerListener(ICConfigurationDescription)} but only if the timestamp changed.
+ * It it also parsed when the options are modified in the UI through {@link #processCompileCommandsFile(IProgressMonitor, ICConfigurationDescription)}
+ */
+public class CompilationDatabaseParser extends LanguageSettingsSerializableProvider
+ implements ICListenerAgent, ILanguageSettingsEditableProvider {
+
+ public static final String JOB_FAMILY_COMPILATION_DATABASE_PARSER = "org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompilationDatabaseParser"; //$NON-NLS-1$
+
+ private static final String ATTR_CDB_PATH = "cdb-path"; //$NON-NLS-1$
+ private static final String ATTR_BUILD_PARSER_ID = "build-parser-id"; //$NON-NLS-1$
+ private static final String ATTR_CDB_MODIFIED_TIME = "cdb-modified-time"; //$NON-NLS-1$
+ private static final String ATTR_EXCLUDE_FILES = "exclude-files"; //$NON-NLS-1$
+
+ public IPath getCompilationDataBasePath() {
+ return Path.fromOSString(getProperty(ATTR_CDB_PATH));
+ }
+
+ public void setCompilationDataBasePath(IPath compilationDataBasePath) {
+ setProperty(ATTR_CDB_PATH, compilationDataBasePath.toOSString());
+ }
+
+ public void setExcludeFiles(boolean selection) {
+ setPropertyBool(ATTR_EXCLUDE_FILES, selection);
+ }
+
+ public boolean getExcludeFiles() {
+ return getPropertyBool(ATTR_EXCLUDE_FILES);
+ }
+
+ public void setBuildParserId(String parserId) {
+ setProperty(ATTR_BUILD_PARSER_ID, parserId);
+ }
+
+ public String getBuildParserId() {
+ return getProperty(ATTR_BUILD_PARSER_ID);
+ }
+
+ public Long getCDBModifiedTime(String cdbPath) throws IOException {
+ FileTime lastModifiedTime = Files.getLastModifiedTime(Paths.get(cdbPath));
+ return lastModifiedTime.toMillis();
+ }
+
+ // Wanted to use this as a base to also count the number of translation unit
+ // for the progress monitor but it's too slow so only use it to exclude for now.
+ private abstract class SourceFilesVisitor implements ICElementVisitor {
+ @Override
+ public boolean visit(ICElement element) throws CoreException {
+ int elementType = element.getElementType();
+ if (elementType != ICElement.C_UNIT) {
+ return elementType == ICElement.C_CCONTAINER || elementType == ICElement.C_PROJECT;
+ }
+
+ ITranslationUnit tu = (ITranslationUnit) element;
+ if (tu.isSourceUnit()) {
+ handleTranslationUnit(tu);
+ }
+ return false;
+ }
+
+ abstract void handleTranslationUnit(ITranslationUnit tu) throws CoreException;
+ }
+
+ private final class ExcludeSourceFilesVisitor extends SourceFilesVisitor {
+ private final ICConfigurationDescription cfgDescription;
+ ICSourceEntry[] entries = null;
+ private final IProgressMonitor monitor;
+ private final int sourceFilesCount;
+ private int nbChecked = 0;
+
+ //Note: monitor already has ticks allocated for number of source files (not considering exclusions though)
+ private ExcludeSourceFilesVisitor(IProgressMonitor monitor, int sourceFilesCount,
+ ICConfigurationDescription cfgDescription) {
+ this.monitor = monitor;
+ this.sourceFilesCount = sourceFilesCount;
+ this.cfgDescription = cfgDescription;
+ }
+
+ public ICSourceEntry[] getSourceEntries() {
+ return entries;
+ }
+
+ @Override
+ void handleTranslationUnit(ITranslationUnit tu) throws CoreException {
+ boolean isExcluded = CDataUtil.isExcluded(tu.getPath(), cfgDescription.getSourceEntries());
+ if (!isExcluded) {
+ List<ICLanguageSettingEntry> list = getSettingEntries(cfgDescription, tu.getResource(),
+ tu.getLanguage().getId());
+ if (list == null) {
+ if (entries == null) {
+ entries = cfgDescription.getSourceEntries();
+ }
+ entries = CDataUtil.setExcluded(tu.getResource().getFullPath(), false, true, entries);
+ }
+ }
+ monitor.worked(1);
+ if (nbChecked % 100 == 0) {
+ monitor.subTask(String.format(Messages.CompilationDatabaseParser_ProgressExcludingFiles, nbChecked,
+ sourceFilesCount));
+ }
+ nbChecked++;
+ }
+ }
+
+ private static class CDBWorkingDirectoryTracker implements IWorkingDirectoryTracker {
+ URI currentDirectory = null;
+
+ @Override
+ public URI getWorkingDirectoryURI() {
+ return currentDirectory;
+ }
+
+ public void setCurrentDirectory(URI currentDirectory) {
+ this.currentDirectory = currentDirectory;
+ }
+ }
+
+ @Override
+ public void registerListener(ICConfigurationDescription cfgDescription) {
+ unregisterListener();
+ try {
+ processCompileCommandsFile(null, cfgDescription);
+ } catch (CoreException e) {
+ ManagedBuilderCorePlugin.log(e);
+ }
+ }
+
+ @Override
+ public void unregisterListener() {
+ }
+
+ /**
+ * Processes the compilation database based on the attributes previously set.
+ * Parses the commands and sets the language setting entries. If cfgDescription is a writable configuration, it is assumed that the caller will call
+ * CoreModel#setProjectDescription. Otherwise if cfgDescription is read-only, the method will restart itself with a writable configuration description and call CoreModel#setProjectDescription.
+ */
+ public boolean processCompileCommandsFile(IProgressMonitor monitor, ICConfigurationDescription cfgDescription)
+ throws CoreException {
+ if (cfgDescription.isReadOnly()) {
+ scheduleOnWritableCfgDescription(cfgDescription);
+ return false;
+ }
+
+ if (getCompilationDataBasePath().isEmpty()) {
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_CDBNotConfigured));
+ }
+
+ if (!Files.exists(Paths.get(getCompilationDataBasePath().toOSString()))) {
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, MessageFormat.format(
+ Messages.CompilationDatabaseParser_CDBNotFound, getCompilationDataBasePath().toOSString())));
+ }
+
+ try {
+ if (!getProperty(ATTR_CDB_MODIFIED_TIME).isEmpty() && getProperty(ATTR_CDB_MODIFIED_TIME)
+ .equals(getCDBModifiedTime(getCompilationDataBasePath().toOSString()).toString())) {
+ return false;
+ }
+ } catch (IOException e) {
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase, e));
+ }
+
+ if (getBuildParserId().isEmpty()) {
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ MessageFormat.format(Messages.CompilationDatabaseParser_BuildCommandParserNotConfigured,
+ getCompilationDataBasePath().toOSString())));
+ }
+
+ if (!isEmpty()) {
+ clear();
+ }
+ String cdbPath = getCompilationDataBasePath().toOSString();
+ Long cdbModifiedTime;
+ try {
+ cdbModifiedTime = getCDBModifiedTime(cdbPath);
+ } catch (Exception e) {
+ //setProperty(ATTR_CDB_MODIFIED_TIME, Long.toString(0L));
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase, e));
+ }
+
+ int totalTicks = getExcludeFiles() ? 100 : 60;
+ SubMonitor subMonitor = SubMonitor.convert(monitor, totalTicks);
+ subMonitor.subTask(Messages.CompilationDatabaseParser_ProgressParsingJSONFile);
+ subMonitor.split(5);
+
+ CompileCommand[] compileCommands = null;
+ try (FileReader reader = new FileReader(cdbPath)) {
+ Gson gson = new Gson();
+ compileCommands = gson.fromJson(reader, CompileCommand[].class);
+ } catch (Exception e) {
+ //setProperty(ATTR_CDB_MODIFIED_TIME, Long.toString(0L));
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase, e));
+ }
+
+ AbstractBuildCommandParser outputParser;
+ try {
+ outputParser = getBuildCommandParser(cfgDescription, getBuildParserId());
+ } catch (Exception e) {
+ //setProperty(ATTR_CDB_MODIFIED_TIME, Long.toString(0L));
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase, e));
+ }
+
+ CDBWorkingDirectoryTracker workingDirectoryTracker = new CDBWorkingDirectoryTracker();
+
+ SubMonitor parseCmdsMonitor = SubMonitor.convert(subMonitor.split(50), compileCommands.length);
+ outputParser.startup(cfgDescription, workingDirectoryTracker);
+ for (int i = 0; i < compileCommands.length; i++) {
+ CompileCommand c = compileCommands[i];
+ // Don't spam the progress view too much
+ if (i % 100 == 0) {
+ parseCmdsMonitor.subTask(String.format(Messages.CompilationDatabaseParser_ProgressParsingBuildCommands,
+ i, compileCommands.length));
+ }
+ String dir = c.getDirectory();
+ workingDirectoryTracker.setCurrentDirectory(null);
+ if (dir != null) {
+ File file = new File(dir);
+ if (file.exists()) {
+ workingDirectoryTracker.setCurrentDirectory(file.toURI());
+ }
+ }
+
+ outputParser.processLine(c.getCommand());
+ parseCmdsMonitor.worked(1);
+ }
+ LanguageSettingsStorage storage = outputParser.copyStorage();
+ SubMonitor entriesMonitor = SubMonitor.convert(subMonitor.split(5), storage.getLanguages().size());
+ entriesMonitor.subTask(Messages.CompilationDatabaseParser_ProgressApplyingEntries);
+ for (String language : storage.getLanguages()) {
+ SubMonitor langMonitor = entriesMonitor.split(1);
+ Set<String> resourcePaths = storage.getResourcePaths(language);
+ SubMonitor langEntriesMonitor = SubMonitor.convert(langMonitor, resourcePaths.size());
+ for (String resourcePath : resourcePaths) {
+ IFile file = cfgDescription.getProjectDescription().getProject().getFile(new Path(resourcePath));
+ if (file.exists()) {
+ List<ICLanguageSettingEntry> settingEntries = storage.getSettingEntries(resourcePath, language);
+ setSettingEntries(cfgDescription, file, language, settingEntries);
+ }
+ langEntriesMonitor.worked(1);
+ }
+ }
+
+ if (getExcludeFiles()) {
+ excludeFiles(cfgDescription, subMonitor);
+ }
+
+ setProperty(ATTR_CDB_MODIFIED_TIME, cdbModifiedTime.toString());
+ touchProjectDes(cfgDescription.getProjectDescription());
+ return true;
+ }
+
+ private void scheduleOnWritableCfgDescription(ICConfigurationDescription cfgDescription) {
+ WorkspaceJob job = new WorkspaceJob(Messages.CompilationDatabaseParser_Job) {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ // If the config description we have been given is read-only, we need to get a writable one instead in order to be able to set source entries (exclusions).
+ // The tricky thing is that in that situation, the CompilationDatabaseParser instance (this) came from the read-only project description so anything that is
+ // saved that is not stored in the project description (i.e. calls to setProperties) will be saved to the wrong instance so when we call setProjectDescription, our changes will be ignored.
+ // So instead, restart the whole thing with the corresponding CompilationDatabaseParser instance in the writable config.
+ IProject project = cfgDescription.getProjectDescription().getProject();
+ ICProjectDescription projectDescription = CCorePlugin.getDefault().getCoreModel()
+ .getProjectDescription(project.getProject(), true);
+ ICConfigurationDescription writableCfg = projectDescription
+ .getConfigurationById(cfgDescription.getId());
+ if (!(writableCfg instanceof ILanguageSettingsProvidersKeeper)) {
+ return Status.CANCEL_STATUS;
+ }
+
+ CompilationDatabaseParser parser = null;
+ List<ILanguageSettingsProvider> settingProviders = ((ILanguageSettingsProvidersKeeper) writableCfg)
+ .getLanguageSettingProviders();
+ for (ILanguageSettingsProvider languageSettingsProvider : settingProviders) {
+ if (languageSettingsProvider.getId().equals(CompilationDatabaseParser.this.getId())
+ && languageSettingsProvider instanceof CompilationDatabaseParser) {
+ parser = (CompilationDatabaseParser) languageSettingsProvider;
+ break;
+ }
+ }
+
+ if (parser == null) {
+ // Seems very unlikely to get here. This should mean that the provider was disabled before the job ran.
+ return Status.CANCEL_STATUS;
+ }
+
+ try {
+ if (parser.processCompileCommandsFile(monitor, writableCfg)) {
+ CoreModel.getDefault().setProjectDescription(project.getProject(), projectDescription);
+ }
+ } catch (CoreException e) {
+ // If we are running this in a WorkspaceJob it's because the CfgDescription was read-only so we are probably loading the project.
+ // We don't want to pop-up jarring error dialogs on start-up. Ideally, CDT would have problem markers for project setup issues.
+ ManagedBuilderCorePlugin.log(e);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == JOB_FAMILY_COMPILATION_DATABASE_PARSER;
+ }
+ };
+
+ // Using root rule because of call to setProjectDescription above
+ job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ job.schedule();
+ }
+
+ private void excludeFiles(ICConfigurationDescription cfgDescription, SubMonitor subMonitor) throws CoreException {
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel()
+ .create(cfgDescription.getProjectDescription().getProject());
+ // Getting a approximation of the number of source files we will have to visit based on file names.
+ // Much faster than going through the CElements. Then do the real work and report progress.
+ // It's possible that the approximation will be pretty wrong if there are a lot of already excluded files
+ // then we won't visit them in the ExcludeSourceFilesVisitor and the progress monitor won't be ticked for those.
+ int sourceFilesCount[] = new int[1];
+ cProject.getProject().accept(new IResourceProxyVisitor() {
+ @Override
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+ if (CoreModel.isValidSourceUnitName(cProject.getProject(), proxy.getName()))
+ sourceFilesCount[0]++;
+ return true;
+ }
+ }, IResource.DEPTH_INFINITE, IResource.NONE);
+ SubMonitor sourceMonitor = SubMonitor.convert(subMonitor.split(35), sourceFilesCount[0]);
+
+ ExcludeSourceFilesVisitor sourceFileVisitor = new ExcludeSourceFilesVisitor(sourceMonitor, sourceFilesCount[0],
+ cfgDescription);
+ cProject.accept(sourceFileVisitor);
+ ICSourceEntry[] sourceEntries = sourceFileVisitor.getSourceEntries();
+
+ subMonitor.split(5);
+ if (sourceEntries != null) {
+ cfgDescription.setSourceEntries(sourceEntries);
+ }
+ }
+
+ private void touchProjectDes(ICProjectDescription desc) {
+ // Make sure the project description is marked as modified so that language settings serialization kicks in.
+ // We need to let the setProjectDescription do the serialization because we cannot do it on a writable description
+ // and we need a writable description because we need to call setSourceEntries!
+ final QualifiedName TOUCH_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "touch-project"); //$NON-NLS-1$
+ desc.setSessionProperty(TOUCH_PROPERTY, ""); //$NON-NLS-1$
+ desc.setSessionProperty(TOUCH_PROPERTY, null);
+ }
+
+ private AbstractBuildCommandParser getBuildCommandParser(ICConfigurationDescription cfgDesc, String id)
+ throws CloneNotSupportedException {
+ ICConfigurationDescription configurationDescription = cfgDesc;
+ if (configurationDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List<ILanguageSettingsProvider> settingProviders = ((ILanguageSettingsProvidersKeeper) configurationDescription)
+ .getLanguageSettingProviders();
+ for (ILanguageSettingsProvider languageSettingsProvider : settingProviders) {
+ if (languageSettingsProvider instanceof AbstractBuildCommandParser
+ && languageSettingsProvider instanceof ILanguageSettingsEditableProvider) {
+ AbstractBuildCommandParser buildParser = (AbstractBuildCommandParser) languageSettingsProvider;
+ if (buildParser.getId().equals(id))
+ return (AbstractBuildCommandParser) ((ILanguageSettingsEditableProvider) buildParser).clone();
+ }
+ }
+ }
+
+ throw new IllegalArgumentException(MessageFormat
+ .format(Messages.CompilationDatabaseParser_BuildCommandParserNotFound, id, cfgDesc.getName()));
+ }
+
+ @Override
+ public boolean isEmpty() {
+ // treat provider that has been executed as not empty
+ // to let "Clear" button to restart the provider
+ return getProperty(ATTR_CDB_MODIFIED_TIME).isEmpty() && super.isEmpty();
+ }
+
+ @Override
+ public void clear() {
+ super.clear();
+ setProperty(ATTR_CDB_MODIFIED_TIME, null);
+ }
+
+ @Override
+ public CompilationDatabaseParser cloneShallow() throws CloneNotSupportedException {
+ CompilationDatabaseParser clone = (CompilationDatabaseParser) super.cloneShallow();
+ clone.setProperty(ATTR_CDB_MODIFIED_TIME, null);
+ return clone;
+ }
+
+ @Override
+ public CompilationDatabaseParser clone() throws CloneNotSupportedException {
+ return (CompilationDatabaseParser) super.clone();
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
new file mode 100644
index 0000000000..3675d94dc0
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016, 2019 QNX Software Systems and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marc-André Laperle - Moved to managed builder
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
+
+public class CompileCommand {
+
+ public String directory;
+ public String command;
+ public String file;
+
+ public String getDirectory() {
+ return directory;
+ }
+
+ public String getCommand() {
+ return command;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java
new file mode 100644
index 0000000000..1a15eaff8f
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.language.settings.providers.messages"; //$NON-NLS-1$
+
+ public static String CompilationDatabaseParser_BuildCommandParserNotConfigured;
+ public static String CompilationDatabaseParser_BuildCommandParserNotFound;
+ public static String CompilationDatabaseParser_CDBNotConfigured;
+ public static String CompilationDatabaseParser_CDBNotFound;
+ public static String CompilationDatabaseParser_ErrorProcessingCompilationDatabase;
+ public static String CompilationDatabaseParser_Job;
+ public static String CompilationDatabaseParser_ProgressApplyingEntries;
+ public static String CompilationDatabaseParser_ProgressExcludingFiles;
+ public static String CompilationDatabaseParser_ProgressParsingBuildCommands;
+ public static String CompilationDatabaseParser_ProgressParsingJSONFile;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties
new file mode 100644
index 0000000000..f5b2a80d63
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties
@@ -0,0 +1,21 @@
+################################################################################
+# Copyright (c) 2019 Marc-Andre Laperle.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+################################################################################
+
+CompilationDatabaseParser_BuildCommandParserNotConfigured=Compilation database parser does not have a build command parser configured.
+CompilationDatabaseParser_BuildCommandParserNotFound=Could not find '{0}' language settings provider in configuration '{1}'
+CompilationDatabaseParser_CDBNotConfigured=Compilation database (usually compile_commands.json) path not set.
+CompilationDatabaseParser_CDBNotFound=Compilation database (usually compile_commands.json) not found at location {0}.
+CompilationDatabaseParser_ErrorProcessingCompilationDatabase=Error processing compilation database.
+CompilationDatabaseParser_Job=Discover Compilation Database language settings
+CompilationDatabaseParser_ProgressApplyingEntries=Applying language setting entries
+CompilationDatabaseParser_ProgressExcludingFiles=Excluding files not in compilation database. Checking %d/%d (Estimate)
+CompilationDatabaseParser_ProgressParsingBuildCommands=Parsing build commands (%d/%d)
+CompilationDatabaseParser_ProgressParsingJSONFile=Parsing JSON file \ No newline at end of file
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
index ccd25f1019..f8f7c4b19b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
-Bundle-Version: 9.1.300.qualifier
+Bundle-Version: 9.1.400.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index e9df66e8a4..198bcea804 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -884,6 +884,13 @@
ui-clear-entries="true"
ui-edit-entries="false">
</class-association>
+ <class-association
+ class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompilationDatabaseParser"
+ icon="icons/obj16/log_obj.gif"
+ page="org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.CompilationDatabaseParserOptionPage"
+ ui-clear-entries="true"
+ ui-edit-entries="false">
+ </class-association>
</extension>
<extension
point="org.eclipse.cdt.core.CBuildConsole">
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/CompilationDatabaseParserOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/CompilationDatabaseParserOptionPage.java
new file mode 100644
index 0000000000..391fe05fdc
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/CompilationDatabaseParserOptionPage.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
+import org.eclipse.cdt.managedbuilder.internal.language.settings.providers.CompilationDatabaseParser;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
+import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
+import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
+import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Options page for {@link CompilationDatabaseParser}.
+ *
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public final class CompilationDatabaseParserOptionPage extends AbstractLanguageSettingProviderOptionPage {
+ private boolean fEditable;
+ private Text fCompileCommandsPath;
+
+ @SuppressWarnings("restriction")
+ private StatusMessageLine fStatusLine;
+ private Combo fBuildOutputParserCombo;
+
+ @Override
+ public void createControl(Composite parent) {
+ fEditable = parent.isEnabled();
+ CompilationDatabaseParser provider = (CompilationDatabaseParser) getProvider();
+
+ Composite composite = createCompositeForPageArea(parent);
+ createCompileCommandsPathInputControl(composite, provider);
+ createBrowseButton(composite);
+ createOutputParserCombo(composite);
+ createExclusionOptions(composite);
+ createStatusLine(composite, provider);
+
+ setControl(composite);
+ }
+
+ private Composite createCompositeForPageArea(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 1;
+ layout.marginHeight = 1;
+ layout.marginRight = 1;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Dialog.applyDialogFont(composite);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ composite.setLayoutData(gd);
+ return composite;
+ }
+
+ private void createCompileCommandsPathInputControl(Composite composite, CompilationDatabaseParser provider) {
+ Label label = ControlFactory.createLabel(composite,
+ Messages.CompilationDatabaseParserOptionPage_CompileCommandsPath);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ label.setLayoutData(gd);
+ label.setEnabled(fEditable);
+
+ fCompileCommandsPath = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
+ String command = provider.getCompilationDataBasePath().toOSString();
+ fCompileCommandsPath.setText(command != null ? command : ""); //$NON-NLS-1$
+ fCompileCommandsPath.setEnabled(fEditable);
+ fCompileCommandsPath.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String text = fCompileCommandsPath.getText();
+ CompilationDatabaseParser provider = (CompilationDatabaseParser) getProvider();
+ if (provider.getCompilationDataBasePath() == null
+ || !text.equals(provider.getCompilationDataBasePath().toOSString())) {
+ CompilationDatabaseParser selectedProvider = (CompilationDatabaseParser) getProviderWorkingCopy();
+ selectedProvider.setCompilationDataBasePath(Path.fromOSString(text));
+ refreshItem(selectedProvider);
+ validate();
+ }
+ }
+ });
+ }
+
+ private void createBrowseButton(Composite composite) {
+ Button button = ControlFactory.createPushButton(composite, Messages.CompilationDatabaseParserOptionPage_Browse);
+ button.setEnabled(fEditable);
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent evt) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
+ dialog.setText(Messages.CompilationDatabaseParserOptionPage_ChooseFile);
+ String fileName = fCompileCommandsPath.getText();
+ IPath folder = new Path(fileName).removeLastSegments(1);
+ dialog.setFilterPath(folder.toOSString());
+ String chosenFile = dialog.open();
+ if (chosenFile != null) {
+ fCompileCommandsPath.insert(chosenFile);
+ }
+ }
+ });
+ }
+
+ private void createOutputParserCombo(Composite composite) {
+ ICConfigurationDescription configurationDescription = getConfigurationDescription();
+ List<AbstractBuildCommandParser> buildParsers = new ArrayList<>();
+ if (configurationDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List<ILanguageSettingsProvider> settingProviders = ((ILanguageSettingsProvidersKeeper) configurationDescription)
+ .getLanguageSettingProviders();
+ for (ILanguageSettingsProvider languageSettingsProvider : settingProviders) {
+ if (languageSettingsProvider instanceof AbstractBuildCommandParser) {
+ AbstractBuildCommandParser buildParser = (AbstractBuildCommandParser) languageSettingsProvider;
+ buildParsers.add(buildParser);
+ }
+ }
+ }
+
+ Label parserLabel = ControlFactory.createLabel(composite,
+ Messages.CompilationDatabaseParserOptionPage_BuildParser);
+ GridData gd = new GridData(SWT.BEGINNING);
+ gd.horizontalSpan = 2;
+ parserLabel.setLayoutData(gd);
+
+ fBuildOutputParserCombo = new Combo(composite, SWT.READ_ONLY);
+ fBuildOutputParserCombo.setEnabled(fEditable);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ fBuildOutputParserCombo.setLayoutData(gd);
+ if (buildParsers.isEmpty()) {
+ fBuildOutputParserCombo.add(Messages.CompilationDatabaseParserOptionPage_NoBuildOutputParserError);
+ fBuildOutputParserCombo.select(0);
+ fBuildOutputParserCombo.setEnabled(false);
+ // Can't call getProviderWorkingCopy().setBuildParserId() while creating the page since
+ // it will try to replace the selected provider in the table which
+ // doesn't have a proper selection index until one of them is clicked.
+ // Use combo.setData to encode invalid/valid data then set it on the working copy on setVisible(true)/validate.
+ fBuildOutputParserCombo.setData(null);
+ return;
+ }
+
+ for (int i = 0; i < buildParsers.size(); i++) {
+ AbstractBuildCommandParser buildParser = buildParsers.get(i);
+ fBuildOutputParserCombo.add(buildParser.getName());
+ fBuildOutputParserCombo.setData(buildParser.getName(), buildParser);
+ if (buildParser.getId().equals(((CompilationDatabaseParser) getProvider()).getBuildParserId())) {
+ fBuildOutputParserCombo.select(i);
+ fBuildOutputParserCombo.setData(buildParser.getId());
+ }
+ }
+
+ fBuildOutputParserCombo.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ AbstractBuildCommandParser parser = (AbstractBuildCommandParser) fBuildOutputParserCombo
+ .getData(fBuildOutputParserCombo.getText());
+ CompilationDatabaseParser selectedProvider = (CompilationDatabaseParser) getProviderWorkingCopy();
+ String parserId = ""; //$NON-NLS-1$
+ if (parser != null) {
+ parserId = parser.getId();
+ }
+ selectedProvider.setBuildParserId(parserId);
+ fBuildOutputParserCombo.setData(parserId);
+ validate();
+ }
+ });
+
+ }
+
+ private void createExclusionOptions(Composite parent) {
+ Button keepExclusion = new Button(parent, SWT.CHECK);
+ keepExclusion.setText(Messages.CompilationDatabaseParserOptionPage_ExcludeFiles);
+ GridData gd = new GridData(SWT.BEGINNING);
+ gd.horizontalSpan = 2;
+ keepExclusion.setLayoutData(gd);
+
+ keepExclusion.setSelection(((CompilationDatabaseParser) getProvider()).getExcludeFiles());
+ keepExclusion.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ CompilationDatabaseParser selectedProvider = (CompilationDatabaseParser) getProviderWorkingCopy();
+ selectedProvider.setExcludeFiles(keepExclusion.getSelection());
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ @SuppressWarnings("restriction")
+ private void createStatusLine(Composite composite, CompilationDatabaseParser provider) {
+ fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2);
+ }
+
+ @SuppressWarnings("restriction")
+ @Override
+ public void performApply(IProgressMonitor monitor) throws CoreException {
+ ILanguageSettingsProvider provider = providerTab.getProvider(providerId);
+ if ((provider instanceof CompilationDatabaseParser)) { // basically check for working copy
+ CompilationDatabaseParser compilationDatabaseParser = (CompilationDatabaseParser) provider;
+ ILanguageSettingsProvider initialProvider = providerTab.getInitialProvider(providerId);
+ if (!(initialProvider instanceof CompilationDatabaseParser)
+ || !((CompilationDatabaseParser) initialProvider).getCompilationDataBasePath()
+ .equals(compilationDatabaseParser.getCompilationDataBasePath())
+ || !((CompilationDatabaseParser) initialProvider).getBuildParserId()
+ .equals(compilationDatabaseParser.getBuildParserId())
+ || ((CompilationDatabaseParser) initialProvider).getExcludeFiles() != compilationDatabaseParser
+ .getExcludeFiles()) {
+ compilationDatabaseParser.clear();
+ }
+ if (compilationDatabaseParser.isEmpty()) {
+ compilationDatabaseParser.processCompileCommandsFile(monitor, getConfigurationDescription());
+ }
+ }
+
+ super.performApply(monitor);
+ }
+
+ @SuppressWarnings("restriction")
+ private void validate() {
+ if (fBuildOutputParserCombo.getData() == null) {
+ ((CompilationDatabaseParser) getProviderWorkingCopy()).setBuildParserId(null);
+ }
+
+ CompilationDatabaseParser provider = (CompilationDatabaseParser) getProvider();
+ if (provider.getCompilationDataBasePath() == null || provider.getCompilationDataBasePath().isEmpty()
+ || !Files.exists(Paths.get(provider.getCompilationDataBasePath().toOSString()))) {
+ fStatusLine.setErrorStatus(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(),
+ Messages.CompilationDatabaseParserOptionPage_CompileCommandsPathError));
+ return;
+ }
+
+ if (provider.getBuildParserId() == null || provider.getBuildParserId().isEmpty()) {
+ fStatusLine.setErrorStatus(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(),
+ Messages.CompilationDatabaseParserOptionPage_BuildOutputParserError));
+ return;
+ }
+
+ fStatusLine.setErrorStatus(Status.OK_STATUS);
+ }
+
+ private ICConfigurationDescription getConfigurationDescription() {
+ if (providerTab.page.isForPrefs()) {
+ return null;
+ }
+
+ return providerTab.getResDesc().getConfiguration().getConfiguration();
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ validate();
+ }
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/Messages.java
new file mode 100644
index 0000000000..1b0d061dc9
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/Messages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.messages"; //$NON-NLS-1$
+ public static String CompilationDatabaseParserOptionPage_Browse;
+ public static String CompilationDatabaseParserOptionPage_BuildOutputParserError;
+ public static String CompilationDatabaseParserOptionPage_BuildParser;
+ public static String CompilationDatabaseParserOptionPage_ChooseFile;
+ public static String CompilationDatabaseParserOptionPage_CompileCommandsPath;
+ public static String CompilationDatabaseParserOptionPage_CompileCommandsPathError;
+ public static String CompilationDatabaseParserOptionPage_ExcludeFiles;
+ public static String CompilationDatabaseParserOptionPage_NoBuildOutputParserError;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/messages.properties
new file mode 100644
index 0000000000..c9657a7442
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/messages.properties
@@ -0,0 +1,19 @@
+################################################################################
+# Copyright (c) 2019 Marc-Andre Laperle.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+################################################################################
+
+CompilationDatabaseParserOptionPage_Browse=Browse...
+CompilationDatabaseParserOptionPage_BuildOutputParserError=Invalid build parser
+CompilationDatabaseParserOptionPage_BuildParser=Build parser:
+CompilationDatabaseParserOptionPage_ChooseFile=Choose File
+CompilationDatabaseParserOptionPage_CompileCommandsPath=Compilation Database path (compile_commands.json):
+CompilationDatabaseParserOptionPage_CompileCommandsPathError=Compilation Database path does not exist
+CompilationDatabaseParserOptionPage_ExcludeFiles=Exclude files not in the Compilation Database
+CompilationDatabaseParserOptionPage_NoBuildOutputParserError=No build output parser enabled in "Providers"
diff --git a/build/org.eclipse.cdt.meson-feature/feature.xml b/build/org.eclipse.cdt.meson-feature/feature.xml
index 5a9c326938..2a449b0969 100644
--- a/build/org.eclipse.cdt.meson-feature/feature.xml
+++ b/build/org.eclipse.cdt.meson-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.meson"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/build/org.eclipse.cdt.meson.docs/pom.xml b/build/org.eclipse.cdt.meson.docs/pom.xml
index 401049e277..43c0ca4f30 100644
--- a/build/org.eclipse.cdt.meson.docs/pom.xml
+++ b/build/org.eclipse.cdt.meson.docs/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/build/org.eclipse.cdt.meson.ui.tests/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.meson.ui.tests/META-INF/MANIFEST.MF
index 6c3cf30d80..1fb9b37672 100644
--- a/build/org.eclipse.cdt.meson.ui.tests/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.meson.ui.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: org.eclipse.cdt.meson.ui.tests
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.1.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.cdt.meson.core;bundle-version="1.0.0",
diff --git a/build/org.eclipse.cdt.meson.ui.tests/pom.xml b/build/org.eclipse.cdt.meson.ui.tests/pom.xml
index 125b2c6c2d..adc1137e85 100644
--- a/build/org.eclipse.cdt.meson.ui.tests/pom.xml
+++ b/build/org.eclipse.cdt.meson.ui.tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/build/pom.xml b/build/pom.xml
index 30adc4e75a..127f9d556a 100644
--- a/build/pom.xml
+++ b/build/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.build-parent</artifactId>
diff --git a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
index e352f79968..fc5928b29f 100644
--- a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.0.200.qualifier
Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/IProblemPreferenceDescriptor.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/IProblemPreferenceDescriptor.java
index 0f79abb2b1..36d60f28da 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/IProblemPreferenceDescriptor.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/IProblemPreferenceDescriptor.java
@@ -65,6 +65,7 @@ public interface IProblemPreferenceDescriptor extends Cloneable {
* Custom type, represented by string input field by default
*/
TYPE_CUSTOM("custom"); //$NON-NLS-1$
+
private String literal;
private PreferenceType(String literal) {
diff --git a/codan/pom.xml b/codan/pom.xml
index a83cea6ed1..eea600f369 100644
--- a/codan/pom.xml
+++ b/codan/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.codan-parent</artifactId>
diff --git a/core/org.eclipse.cdt.core.linux.ppc64le/pom.xml b/core/org.eclipse.cdt.core.linux.ppc64le/pom.xml
index 2e7b02062c..9ca42a34bf 100644
--- a/core/org.eclipse.cdt.core.linux.ppc64le/pom.xml
+++ b/core/org.eclipse.cdt.core.linux.ppc64le/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core.linux.x86_64/pom.xml b/core/org.eclipse.cdt.core.linux.x86_64/pom.xml
index 4d5a1d04d3..2111ce204f 100644
--- a/core/org.eclipse.cdt.core.linux.x86_64/pom.xml
+++ b/core/org.eclipse.cdt.core.linux.x86_64/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core.linux/pom.xml b/core/org.eclipse.cdt.core.linux/pom.xml
index 607ec82a4c..19d317ffd6 100644
--- a/core/org.eclipse.cdt.core.linux/pom.xml
+++ b/core/org.eclipse.cdt.core.linux/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core.macosx/pom.xml b/core/org.eclipse.cdt.core.macosx/pom.xml
index b086fc3708..fdac4bd32a 100644
--- a/core/org.eclipse.cdt.core.macosx/pom.xml
+++ b/core/org.eclipse.cdt.core.macosx/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
index 242b5ed5eb..bada355b7d 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
@@ -11373,4 +11373,16 @@ public class AST2TemplateTests extends AST2CPPTestBase {
public void testGlobalConstWorksAsConstExpression_545756() throws Exception {
parseAndCheckBindings();
}
+
+ // template <class C, C... Chars>
+ // unsigned int operator""_test() {
+ // return sizeof...(Chars);
+ // }
+ //
+ // void foo() {
+ // auto len = "test"_test;
+ // }
+ public void testStringLiteralOperatorTemplate_536986() throws Exception {
+ parseAndCheckImplicitNameBindings();
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java
index 17d86ac772..c44bce5433 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java
@@ -75,4 +75,37 @@ public class TemplateAutoTests extends AST2CPPTestBase {
public void testTemplateNontypeParameterTypeDeductionParsing_519361_3() throws Exception {
parseAndCheckBindings();
}
+
+ // template <typename T, T>
+ // struct meta { using type = int; };
+ //
+ // template <typename T>
+ // struct remove_noexcept { using type = T; };
+ //
+ // template <typename T>
+ // using remove_noexcept_t = typename remove_noexcept<T>::type;
+ //
+ // template <auto Key>
+ // struct K : meta<remove_noexcept_t<decltype(Key)>,Key>{};
+ //
+ // template <auto Key>
+ // struct W {
+ // using type = typename K<Key>::type;
+ // };
+ //
+ // template <typename T>
+ // struct M {};
+ //
+ // struct A {
+ // int foo;
+ // };
+ // typedef M<W<&A::foo>::type> M1; // typedef #1
+ //
+ // struct B {
+ // int foo;
+ // };
+ // typedef M<W<&B::foo>::type> M2; // typedef #2
+ public void testInstantiationCacheConflict_553141() throws Exception {
+ parseAndCheckBindings();
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java
index 544f98fe68..1d4bbdeaba 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java
@@ -120,7 +120,7 @@ public class RewriteTester extends TestSuite {
private static RewriteBaseTest createTestClass(String className, String testName, List<TestSourceFile> files)
throws Exception {
- try {
+ try {
Class<?> refClass = Class.forName(className);
Constructor<?> ct = refClass.getConstructor(new Class[] { String.class, List.class });
RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(new Object[] { testName, files });
diff --git a/core/org.eclipse.cdt.core.tests/pom.xml b/core/org.eclipse.cdt.core.tests/pom.xml
index 707e4a6a9d..0cf2a20bbe 100644
--- a/core/org.eclipse.cdt.core.tests/pom.xml
+++ b/core/org.eclipse.cdt.core.tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -43,6 +43,7 @@
<useUIHarness>false</useUIHarness>
<!-- Core tests actually use eclipse.ui classes, see CProjectHelper -->
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} ${extra.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<includes>
<include>**/AutomatedIntegrationSuite.*</include>
</includes>
diff --git a/core/org.eclipse.cdt.core.win32.x86_64/pom.xml b/core/org.eclipse.cdt.core.win32.x86_64/pom.xml
index c13e33179d..cd54180618 100644
--- a/core/org.eclipse.cdt.core.win32.x86_64/pom.xml
+++ b/core/org.eclipse.cdt.core.win32.x86_64/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core.win32/pom.xml b/core/org.eclipse.cdt.core.win32/pom.xml
index 4105a8806f..c1bf197fb5 100644
--- a/core/org.eclipse.cdt.core.win32/pom.xml
+++ b/core/org.eclipse.cdt.core.win32/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
index 0ea597d048..60dab642d7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
@@ -649,8 +649,9 @@ public class ASTTypeUtil {
// requirement of appendStringReference().
if (cachedResult.length() > TYPE_STRING_LENGTH_THRESHOLD) {
appendStringReference(cachedResult, result);
+ } else {
+ result.append(cachedResult);
}
- result.append(cachedResult);
return;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/c/GCCScannerExtensionConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/c/GCCScannerExtensionConfiguration.java
index 68693ca572..be5fcebaa0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/c/GCCScannerExtensionConfiguration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/c/GCCScannerExtensionConfiguration.java
@@ -87,7 +87,7 @@ public class GCCScannerExtensionConfiguration extends GNUScannerExtensionConfigu
}
/**
- * @since 6.9
+ * @since 6.10
*/
@SuppressWarnings("nls")
public GCCScannerExtensionConfiguration(CompilerType compiler, int version) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
index 88e1f9afc7..77e2f6da45 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTAlignmentSpecifier;
@@ -1748,7 +1749,9 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
consume();
n = getNodeFactory().newName(t.getCharImage());
setRange(n, t.getOffset(), t.getEndOffset());
- createCompletionNode(t).addName(n);
+ ASTCompletionNode node = createCompletionNode(t);
+ if (node != null)
+ node.addName(n);
return n;
default:
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
index ebdf710df1..860cd7d20d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2016 IBM Corporation and others.
+ * Copyright (c) 2002, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -462,7 +462,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
switch (nt.getType()) {
case IToken.tEOC:
case IToken.tCOMPLETION:
- createCompletionNode(nt).addName(name);
+ ASTCompletionNode node = createCompletionNode(nt);
+ if (node != null)
+ node.addName(name);
break;
}
return name;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index bcb87fc8d9..02046bca74 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -231,6 +231,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPReferenceType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPScope;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateNonTypeArgument;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateParameterMap;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateTypeArgument;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownField;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownMemberClass;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownMethod;
@@ -3453,11 +3454,10 @@ public class CPPSemantics {
data.setFunctionArguments(false, createArgForType(exp, charArray));
ret = resolveFunction(data, funcs, true, false);
- //
char[] stringLiteral = exp.getValue(); // The string literal that was passed to the operator
// The string literal is passed to the operator as chars:
- // "literal"_op -> operator "" _op<'l', 'i', 't', 'e', 'r', 'a', 'l'>();
+ // 12345_op -> operator "" _op<'1', '2', '3', '4', '5'>();
ICPPTemplateArgument args[] = new ICPPTemplateArgument[stringLiteral.length];
for (int k = 0; k < stringLiteral.length; k++) {
args[k] = new CPPTemplateNonTypeArgument(
@@ -3492,13 +3492,48 @@ public class CPPSemantics {
* str (i.e., its length excluding the terminating null character).
* L is treated as operator "" X(str, len)
*/
- CPPPointerType strType = new CPPPointerType(
- new CPPBasicType(((CPPASTLiteralExpression) exp).getBasicCharKind(), 0, null), true, false,
- false);
+ IType charType = new CPPBasicType(((CPPASTLiteralExpression) exp).getBasicCharKind(), 0, null);
+ CPPPointerType strType = new CPPPointerType(charType, true, false, false);
IASTInitializerClause[] initializer = new IASTInitializerClause[] { createArgForType(exp, strType),
createArgForType(null, CPPBasicType.UNSIGNED_INT) };
data.setFunctionArguments(false, initializer);
ret = resolveFunction(data, funcs, true, false);
+
+ // GNU extension: allow literal operator templates for string literals.
+ // The implementation follows the proposed spec in
+ // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3599.html.
+ char[] stringLiteral = exp.getValue(); // The string literal that was passed to the operator
+
+ // The operator template is expected to take the character type as its first argument,
+ // followed by the characters as non-type arguments.
+ // "literal"_op -> operator "" _op<char, 'l', 'i', 't', 'e', 'r', 'a', 'l'>();
+ ICPPTemplateArgument args[] = new ICPPTemplateArgument[stringLiteral.length + 1];
+ args[0] = new CPPTemplateTypeArgument(charType);
+ for (int k = 0; k < stringLiteral.length; k++) {
+ args[k + 1] = new CPPTemplateNonTypeArgument(
+ new EvalFixed(CPPBasicType.CHAR, PRVALUE, IntegralValue.create(stringLiteral[k])));
+ }
+
+ data = new LookupData(((CPPASTLiteralExpression) exp).getOperatorName(), args, exp);
+ IBinding litTpl = resolveFunction(data, tplFunctions, true, false);
+
+ // Do we have valid template and non-template bindings?
+ if (ret != null && !(ret instanceof IProblemBinding)) {
+ // Do we have valid template and non-template bindings?
+ if (litTpl instanceof ICPPFunctionInstance) {
+ // Ambiguity? It has two valid options, and the spec says it shouldn't
+ return new ProblemBinding(data.getLookupName(), exp, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP,
+ tplFunctions);
+ }
+ } else {
+ if (litTpl instanceof ICPPFunctionInstance) {
+ // Only the template binding is valid
+ ret = litTpl;
+ } else {
+ // Couldn't find a valid operator
+ return ret;
+ }
+ }
} else if (kind == IASTLiteralExpression.lk_char_constant) {
/*
* 2.14.8.6
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java
index e667de7196..96d652981f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java
@@ -80,7 +80,7 @@ public class TypeInstantiationRequest {
return true;
if (type1 == null || type2 == null)
return false;
- return type1.isSameType(type1);
+ return type1.isSameType(type2);
}
private boolean equals(ICPPTemplateParameterMap map1, ICPPTemplateParameterMap map2) {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index 3ac5234545..5fb9f7bf57 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -34,8 +34,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IConsoleParser;
@@ -67,6 +65,7 @@ import org.eclipse.cdt.internal.core.build.Messages;
import org.eclipse.cdt.internal.core.model.BinaryRunner;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.cdt.internal.core.parser.ParserSettings2;
+import org.eclipse.cdt.utils.CommandLineUtil;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IContainer;
@@ -449,7 +448,7 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
String[] path = pathStr.split(File.pathSeparator);
for (String dir : path) {
Path commandPath = Paths.get(dir, command);
- if (Files.exists(commandPath)) {
+ if (Files.exists(commandPath) && Files.isRegularFile(commandPath)) {
return commandPath;
} else {
if (Platform.getOS().equals(Platform.OS_WIN32)
@@ -840,50 +839,8 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
* @return List of arg Strings
*/
private List<String> stripArgs(String argString) {
- Pattern p0 = Pattern.compile("('(.*?)').*"); //$NON-NLS-1$
- Pattern p1 = Pattern.compile("([\\-](\\w|[\\-])+[=]\\\".*?\\\").*"); //$NON-NLS-1$
- Pattern p2 = Pattern.compile("([\\-](\\w|[\\-])+[=]'.*?').*"); //$NON-NLS-1$
- Pattern p3 = Pattern.compile("([\\-](\\w|[\\-])+[=][^\\s]+).*"); //$NON-NLS-1$
- Pattern p4 = Pattern.compile("([^\\s]+).*"); //$NON-NLS-1$
- boolean finished = false;
- List<String> args = new ArrayList<>();
- while (!finished) {
- Matcher m0 = p0.matcher(argString);
- if (m0.matches()) {
- argString = argString.replaceFirst("'.*?'", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
- String s = m0.group(2).trim(); // strip single quotes
- args.add(s);
- } else {
- Matcher m1 = p1.matcher(argString);
- if (m1.matches()) {
- argString = argString.replaceFirst("[\\-](\\w|[\\-])+[=]\\\".*?\\\"", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
- String s = m1.group(1).trim();
- args.add(s);
- } else {
- Matcher m2 = p2.matcher(argString);
- if (m2.matches()) {
- argString = argString.replaceFirst("[\\-](\\w|[\\-])+[=]'.*?'", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
- String s = m2.group(1).trim();
- args.add(s);
- } else {
- Matcher m3 = p3.matcher(argString);
- if (m3.matches()) {
- argString = argString.replaceFirst("[\\-](\\w|[\\-])+[=][^\\s]+", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
- args.add(m3.group(1).trim());
- } else {
- Matcher m4 = p4.matcher(argString);
- if (m4.matches()) {
- argString = argString.replaceFirst("[^\\s]+", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
- args.add(m4.group(1).trim());
- } else {
- finished = true;
- }
- }
- }
- }
- }
- }
- return args;
+ String[] args = CommandLineUtil.argumentsToArrayUnixStyle(argString);
+ return new ArrayList<>(Arrays.asList(args));
}
private boolean infoChanged = false;
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java
index 413295e5b3..0bcdb51465 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java
@@ -190,10 +190,19 @@ public class ElfParser extends AbstractCExtension implements IBinaryParser {
try {
/* No PHdr.PT_INTERP found in the hints meaning we need to read the file itself */
- return Arrays.stream(new Elf(path.toOSString()).getPHdrs()).anyMatch(phdr -> phdr.p_type == PHdr.PT_INTERP);
+ return Arrays.stream(getPHdrs(path)).anyMatch(phdr -> phdr.p_type == PHdr.PT_INTERP);
} catch (IOException e) {
CCorePlugin.log(e);
}
return false;
}
+
+ private static PHdr[] getPHdrs(IPath path) throws IOException {
+ Elf elf = new Elf(path.toOSString());
+ try {
+ return elf.getPHdrs();
+ } finally {
+ elf.dispose();
+ }
+ }
}
diff --git a/core/org.eclipse.cdt.ui.tests/pom.xml b/core/org.eclipse.cdt.ui.tests/pom.xml
index 2b0ffa6241..017485f793 100644
--- a/core/org.eclipse.cdt.ui.tests/pom.xml
+++ b/core/org.eclipse.cdt.ui.tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -65,6 +65,7 @@
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} ${extra.vmargs.indexer.timeout} ${extra.vmargs.displayhelper.timeoutmultipler}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<includes>
<include>**/AutomatedSuite.*</include>
</includes>
diff --git a/core/org.eclipse.cdt.ui/.settings/.api_filters b/core/org.eclipse.cdt.ui/.settings/.api_filters
new file mode 100644
index 0000000000..736a9f302c
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/.settings/.api_filters
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.cdt.ui" version="2">
+ <resource path="META-INF/MANIFEST.MF" type="org.eclipse.cdt.ui.actions.DeleteResConfigsAction">
+ <filter comment="DeleteResConfigsAction has been deprecated since CDT 8.0" id="305324134">
+ <message_arguments>
+ <message_argument value="org.eclipse.cdt.ui.actions.DeleteResConfigsAction"/>
+ <message_argument value="org.eclipse.cdt.ui_6.6.100"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="META-INF/MANIFEST.MF" type="org.eclipse.cdt.ui.actions.ExcludeFromBuildAction">
+ <filter comment="ExcludeFromBuildAction has been deprecated since CDT 8.0" id="305324134">
+ <message_arguments>
+ <message_argument value="org.eclipse.cdt.ui.actions.ExcludeFromBuildAction"/>
+ <message_argument value="org.eclipse.cdt.ui_6.6.100"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
index a49a64c566..222c320ff9 100644
--- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
+++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
-Bundle-Version: 6.6.100.qualifier
+Bundle-Version: 6.6.200.qualifier
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CommentsTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CommentsTabPage.java
index 92960a4e20..c6af215050 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CommentsTabPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CommentsTabPage.java
@@ -99,8 +99,7 @@ public class CommentsTabPage extends FormatterTabPage {
// createPrefFalseTrue(globalGroup, numColumns, FormatterMessages.CommentsTabPage_do_not_join_lines, DefaultCodeFormatterConstants.FORMATTER_JOIN_LINES_IN_COMMENTS, true);
// Line comment group
- final Group commentGroup = createGroup(numColumns, composite,
- FormatterMessages.CommentsTabPage_group1_title);
+ final Group commentGroup = createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group1_title);
// final CheckboxPreference singleLineCommentsOnFirstColumn= createPrefFalseTrue(lineCommentGroup, numColumns, FormatterMessages.CommentsTabPage_format_line_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, false);
// ((GridData) singleLineCommentsOnFirstColumn.getControl().getLayoutData()).horizontalIndent= indent;
createPrefFalseTrue(commentGroup, numColumns, FormatterMessages.CommentsTabPage_block_comment,
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java
deleted file mode 100644
index 1de2e3cfdf..0000000000
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Intel Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Intel Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICContainer;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.internal.ui.actions.ActionMessages;
-import org.eclipse.cdt.internal.ui.actions.DeleteResConfigsHandler;
-import org.eclipse.cdt.ui.CUIPlugin;
-import org.eclipse.cdt.ui.newui.AbstractPage;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-
-/**
- * Action which deletes resource description. (If resource description is missing
- * one from parent is normally used)
- * @deprecated as of CDT 8.0 now using {@link DeleteResConfigsHandler}
- */
-@Deprecated
-public class DeleteResConfigsAction implements IWorkbenchWindowPulldownDelegate2, IObjectActionDelegate {
-
- protected ArrayList<IResource> objects = null;
- private ArrayList<ResCfgData> outData = null;
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- objects = null;
- outData = null;
-
- if (!selection.isEmpty()) {
- // case for context menu
- if (selection instanceof IStructuredSelection) {
- Object[] obs = ((IStructuredSelection) selection).toArray();
- if (obs.length > 0) {
- for (int i = 0; i < obs.length; i++) {
- IResource res = null;
- // only folders and files may be affected by this action
- if (obs[i] instanceof ICContainer || obs[i] instanceof ITranslationUnit)
- res = ((ICElement) obs[i]).getResource();
- // project's configuration cannot be deleted
- else if (obs[i] instanceof IResource && !(obs[i] instanceof IProject))
- res = (IResource) obs[i];
- if (res != null) {
- IProject p = res.getProject();
- if (!p.isOpen())
- continue;
-
- if (!CoreModel.getDefault().isNewStyleProject(p))
- continue;
-
- IPath path = res.getProjectRelativePath();
- // getting description in read-only mode
- ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(p, false);
- if (prjd == null)
- continue;
- ICConfigurationDescription[] cfgds = prjd.getConfigurations();
- if (cfgds == null || cfgds.length == 0)
- continue;
- for (ICConfigurationDescription cfgd : cfgds) {
- ICResourceDescription rd = cfgd.getResourceDescription(path, true);
- if (rd != null) {
- if (objects == null)
- objects = new ArrayList<>();
- objects.add(res);
- break; // stop configurations scanning
- }
- }
- }
- }
- }
- }
- }
- action.setEnabled(objects != null);
- }
-
- @Override
- public void run(IAction action) {
- openDialog();
- }
-
- private void openDialog() {
- if (objects == null || objects.size() == 0)
- return;
- // create list of configurations to delete
-
- ListSelectionDialog dialog = new ListSelectionDialog(CUIPlugin.getActiveWorkbenchShell(), objects,
- createSelectionDialogContentProvider(), new LabelProvider() {
- }, ActionMessages.DeleteResConfigsAction_0);
- dialog.setTitle(ActionMessages.DeleteResConfigsAction_1);
- if (dialog.open() == Window.OK) {
- Object[] selected = dialog.getResult();
- if (selected != null && selected.length > 0) {
- for (Object element : selected) {
- ((ResCfgData) element).delete();
- AbstractPage.updateViews(((ResCfgData) element).res);
- }
- }
- }
- }
-
- // Stores data for resource description with its "parents".
- class ResCfgData {
- IResource res;
- ICProjectDescription prjd;
- ICConfigurationDescription cfgd;
- ICResourceDescription rdesc;
-
- public ResCfgData(IResource res2, ICProjectDescription prjd2, ICConfigurationDescription cfgd2,
- ICResourceDescription rdesc2) {
- res = res2;
- prjd = prjd2;
- cfgd = cfgd2;
- rdesc = rdesc2;
- }
-
- // performs deletion
- public void delete() {
- try {
- cfgd.removeResourceDescription(rdesc);
- CoreModel.getDefault().setProjectDescription(res.getProject(), prjd);
- } catch (CoreException e) {
- }
- }
-
- @Override
- public String toString() {
- return "[" + cfgd.getName() + "] for " + res.getName(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private IStructuredContentProvider createSelectionDialogContentProvider() {
- return new IStructuredContentProvider() {
-
- @Override
- public Object[] getElements(Object inputElement) {
- if (outData != null)
- return outData.toArray();
-
- outData = new ArrayList<>();
- List<?> ls = (List<?>) inputElement;
- Iterator<?> it = ls.iterator();
- IProject proj = null;
- ICProjectDescription prjd = null;
- ICConfigurationDescription[] cfgds = null;
-
- // creating list of all res descs for all objects
- while (it.hasNext()) {
- IResource res = (IResource) it.next();
- IPath path = res.getProjectRelativePath();
- if (res.getProject() != proj) {
- proj = res.getProject();
- prjd = CoreModel.getDefault().getProjectDescription(proj);
- cfgds = prjd.getConfigurations();
- }
- if (cfgds != null) {
- for (ICConfigurationDescription cfgd : cfgds) {
- ICResourceDescription rd = cfgd.getResourceDescription(path, true);
- if (rd != null)
- outData.add(new ResCfgData(res, prjd, cfgd, rd));
- }
- }
- }
- return outData.toArray();
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
- }
-
- @Override
- public void dispose() {
- objects = null;
- }
-
- // doing nothing
- @Override
- public void init(IWorkbenchWindow window) {
- }
-
- @Override
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- @Override
- public Menu getMenu(Control parent) {
- return null;
- }
-
- @Override
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
-}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java
deleted file mode 100644
index 71ba1b511a..0000000000
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildAction.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Intel Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Intel Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICContainer;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICSourceEntry;
-import org.eclipse.cdt.core.settings.model.util.CDataUtil;
-import org.eclipse.cdt.internal.ui.actions.ActionMessages;
-import org.eclipse.cdt.internal.ui.actions.ExcludeFromBuildHandler;
-import org.eclipse.cdt.internal.ui.newui.Messages;
-import org.eclipse.cdt.ui.CUIPlugin;
-import org.eclipse.cdt.ui.newui.AbstractPage;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-
-/**
- * Action which excludes resources from build.
- * @deprecated as of CDT 8.0 now using {@link ExcludeFromBuildHandler}
- */
-@Deprecated
-public class ExcludeFromBuildAction implements IWorkbenchWindowPulldownDelegate2, IObjectActionDelegate {
-
- protected ArrayList<IResource> objects = null;
- protected ArrayList<String> cfgNames = null;
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- objects = null;
- cfgNames = null;
- boolean cfgsOK = true;
-
- if (!selection.isEmpty()) {
- // case for context menu
- if (selection instanceof IStructuredSelection) {
- Object[] obs = ((IStructuredSelection) selection).toArray();
- if (obs.length > 0) {
- for (int i = 0; i < obs.length && cfgsOK; i++) {
- // if project selected, don't do anything
- if ((obs[i] instanceof IProject) || (obs[i] instanceof ICProject)) {
- cfgsOK = false;
- break;
- }
- IResource res = null;
- // only folders and files may be affected by this action
- if (obs[i] instanceof ICContainer || obs[i] instanceof ITranslationUnit) {
- res = ((ICElement) obs[i]).getResource();
- } else if (obs[i] instanceof IResource) {
- // project's configuration cannot be deleted
- res = (IResource) obs[i];
- }
- if (res != null) {
- ICConfigurationDescription[] cfgds = getCfgsRead(res);
- if (cfgds == null || cfgds.length == 0)
- continue;
-
- if (objects == null)
- objects = new ArrayList<>();
- objects.add(res);
- if (cfgNames == null) {
- cfgNames = new ArrayList<>(cfgds.length);
- for (int j = 0; j < cfgds.length; j++) {
- if (!canExclude(res, cfgds[j])) {
- cfgNames = null;
- cfgsOK = false;
- break;
- }
- cfgNames.add(cfgds[j].getName());
- }
- } else {
- if (cfgNames.size() != cfgds.length) {
- cfgsOK = false;
- } else {
- for (int j = 0; j < cfgds.length; j++) {
- if (!canExclude(res, cfgds[j]) || !cfgNames.contains(cfgds[j].getName())) {
- cfgsOK = false;
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- action.setEnabled(cfgsOK && objects != null);
- }
-
- private boolean canExclude(IResource res, ICConfigurationDescription cfg) {
- IPath p = res.getFullPath();
- ICSourceEntry[] ent = cfg.getSourceEntries();
- boolean state = CDataUtil.isExcluded(p, ent);
- return CDataUtil.canExclude(p, (res instanceof IFolder), !state, ent);
- }
-
- private void setExclude(IResource res, ICConfigurationDescription cfg, boolean exclude) {
- try {
- ICSourceEntry[] newEntries = CDataUtil.setExcluded(res.getFullPath(), (res instanceof IFolder), exclude,
- cfg.getSourceEntries());
- cfg.setSourceEntries(newEntries);
- } catch (CoreException e) {
- CUIPlugin.log(e);
- }
- }
-
- @Override
- public void run(IAction action) {
- openDialog();
- }
-
- private ICConfigurationDescription[] getCfgsRead(IResource res) {
- IProject p = res.getProject();
- if (!p.isOpen())
- return null;
- if (!CoreModel.getDefault().isNewStyleProject(p))
- return null;
- ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(p, false);
- if (prjd == null)
- return null;
- return prjd.getConfigurations();
- }
-
- private void openDialog() {
- if (objects == null || objects.size() == 0)
- return;
- // create list of configurations to delete
-
- ListSelectionDialog dialog = new ListSelectionDialog(CUIPlugin.getActiveWorkbenchShell(), cfgNames,
- createSelectionDialogContentProvider(), new LabelProvider() {
- }, ActionMessages.ExcludeFromBuildAction_0);
- dialog.setTitle(ActionMessages.ExcludeFromBuildAction_1);
-
- boolean[] status = new boolean[cfgNames.size()];
- Iterator<IResource> it = objects.iterator();
- while (it.hasNext()) {
- IResource res = it.next();
- ICConfigurationDescription[] cfgds = getCfgsRead(res);
- IPath p = res.getFullPath();
- for (int i = 0; i < cfgds.length; i++) {
- boolean b = CDataUtil.isExcluded(p, cfgds[i].getSourceEntries());
- if (b)
- status[i] = true;
- }
- }
- ArrayList<String> lst = new ArrayList<>();
- for (int i = 0; i < status.length; i++)
- if (status[i])
- lst.add(cfgNames.get(i));
- if (lst.size() > 0)
- dialog.setInitialElementSelections(lst);
-
- if (dialog.open() == Window.OK) {
- Object[] selected = dialog.getResult(); // may be empty
- Iterator<IResource> it2 = objects.iterator();
- while (it2.hasNext()) {
- IResource res = it2.next();
- IProject p = res.getProject();
- if (!p.isOpen())
- continue;
- // get writable description
- ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(p, true);
- if (prjd == null)
- continue;
- ICConfigurationDescription[] cfgds = prjd.getConfigurations();
- for (int i = 0; i < cfgds.length; i++) {
- boolean exclude = false;
- for (int j = 0; j < selected.length; j++) {
- if (cfgds[i].getName().equals(selected[j])) {
- exclude = true;
- break;
- }
- }
- setExclude(res, cfgds[i], exclude);
- }
- try {
- CoreModel.getDefault().setProjectDescription(p, prjd);
- } catch (CoreException e) {
- CUIPlugin.logError(Messages.AbstractPage_11 + e.getLocalizedMessage());
- }
- AbstractPage.updateViews(res);
- }
- }
- }
-
- private IStructuredContentProvider createSelectionDialogContentProvider() {
- return new IStructuredContentProvider() {
- @Override
- public Object[] getElements(Object inputElement) {
- return cfgNames.toArray();
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
- }
-
- @Override
- public void dispose() {
- objects = null;
- }
-
- // doing nothing
- @Override
- public void init(IWorkbenchWindow window) {
- }
-
- @Override
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- @Override
- public Menu getMenu(Control parent) {
- return null;
- }
-
- @Override
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/build/ToolChainPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/build/ToolChainPreferencePage.java
index dd465d3e4a..4920592f39 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/build/ToolChainPreferencePage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/build/ToolChainPreferencePage.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.ui.build;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import org.eclipse.cdt.core.build.IToolChain;
@@ -314,8 +315,24 @@ public class ToolChainPreferencePage extends PreferencePage implements IWorkbenc
}
try {
- if (!toolChains.equals(manager.getAllToolChains())) {
- manager.setToolChainOrder(toolChains);
+ Collection<IToolChain> latestToolchains = manager.getAllToolChains();
+ if (!toolChains.equals(latestToolchains)) {
+
+ List<IToolChain> newOrderedList = new ArrayList<>();
+ for (IToolChain toolChain : toolChains) {
+ if (latestToolchains.contains(toolChain)) { //Still there? - for example: existing user defined tool chain would have been removed
+ newOrderedList.add(toolChain);
+ }
+ }
+
+ //add the remaining list at the end - for example: newly added user defined tool chains
+ for (IToolChain toolChain : latestToolchains) {
+ if (!newOrderedList.contains(toolChain)) {
+ newOrderedList.add(toolChain);
+ }
+ }
+
+ manager.setToolChainOrder(newOrderedList);
}
} catch (CoreException e) {
CUIPlugin.log(e.getStatus());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
index 7d04e8e287..8de06a776f 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
@@ -567,7 +567,7 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa
* which do not share ICProjectDescription instance.
* But some changes may be saved wrong if they are affected
* by data from another property pages (Discovery options etc).
-
+
* To enable 2nd mode, just create the following file:
* <workspace>/.metadata/.plugins/org.eclipse.cdt.ui/apply_mode
*/
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java
index ecb71b4fe9..223c259230 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java
@@ -258,7 +258,7 @@ public abstract class CDTCommonProjectWizard extends BasicNewResourceWizard
new SubProgressMonitor(fMonitor, 40));
fMonitor.worked(10);
} catch (CoreException e) {
- CUIPlugin.log(e);
+ CUIPlugin.errorDialog(getShell(), title, message, e, true);
} finally {
fMonitor.done();
}
diff --git a/core/pom.xml b/core/pom.xml
index 2cfe23338e..f8e3c166c7 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt-parent</artifactId>
diff --git a/cross/org.eclipse.cdt.build.crossgcc-feature/feature.xml b/cross/org.eclipse.cdt.build.crossgcc-feature/feature.xml
index aeea59dcc3..78045faf3a 100644
--- a/cross/org.eclipse.cdt.build.crossgcc-feature/feature.xml
+++ b/cross/org.eclipse.cdt.build.crossgcc-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.build.crossgcc"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.build.crossgcc"
license-feature="org.eclipse.license"
diff --git a/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml b/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml
index 4be216954f..08eb0cbe8a 100644
--- a/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml
+++ b/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/cross/org.eclipse.cdt.launch.remote-feature/feature.xml b/cross/org.eclipse.cdt.launch.remote-feature/feature.xml
index 2852619b94..f7e4eaf26a 100644
--- a/cross/org.eclipse.cdt.launch.remote-feature/feature.xml
+++ b/cross/org.eclipse.cdt.launch.remote-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.launch.remote"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/cross/org.eclipse.cdt.launch.remote-feature/pom.xml b/cross/org.eclipse.cdt.launch.remote-feature/pom.xml
index f23120e4d3..76f22f4b66 100644
--- a/cross/org.eclipse.cdt.launch.remote-feature/pom.xml
+++ b/cross/org.eclipse.cdt.launch.remote-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/cross/org.eclipse.cdt.launch.serial-feature/feature.xml b/cross/org.eclipse.cdt.launch.serial-feature/feature.xml
index 52133fcf4a..33092673c5 100644
--- a/cross/org.eclipse.cdt.launch.serial-feature/feature.xml
+++ b/cross/org.eclipse.cdt.launch.serial-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.launch.serial.feature"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/cross/org.eclipse.cdt.launch.serial.ui/META-INF/MANIFEST.MF b/cross/org.eclipse.cdt.launch.serial.ui/META-INF/MANIFEST.MF
index a4df1d0052..05910bea83 100644
--- a/cross/org.eclipse.cdt.launch.serial.ui/META-INF/MANIFEST.MF
+++ b/cross/org.eclipse.cdt.launch.serial.ui/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: org.eclipse.cdt.launch.serial.ui;singleton:=true
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.200.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.13.0",
diff --git a/cross/pom.xml b/cross/pom.xml
index ec598f3763..d1d8efe748 100644
--- a/cross/pom.xml
+++ b/cross/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.cross-parent</artifactId>
diff --git a/debug/org.eclipse.cdt.debug.application.doc/pom.xml b/debug/org.eclipse.cdt.debug.application.doc/pom.xml
index f59a96047b..b9547e245c 100644
--- a/debug/org.eclipse.cdt.debug.application.doc/pom.xml
+++ b/debug/org.eclipse.cdt.debug.application.doc/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/debug/org.eclipse.cdt.debug.application.product/debug.product b/debug/org.eclipse.cdt.debug.application.product/debug.product
index cbd186ba53..b1f9d56d79 100644
--- a/debug/org.eclipse.cdt.debug.application.product/debug.product
+++ b/debug/org.eclipse.cdt.debug.application.product/debug.product
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
-<product name="Stand-alone C/C++ GDB Debugger" uid="org.eclipse.cdt.debug.application.product" id="org.eclipse.cdt.debug.application.product" application="org.eclipse.cdt.debug.application.app" version="9.10.0.qualifier" useFeatures="false" includeLaunchers="true">
+<product name="Stand-alone C/C++ GDB Debugger" uid="org.eclipse.cdt.debug.application.product" id="org.eclipse.cdt.debug.application.product" application="org.eclipse.cdt.debug.application.app" version="9.11.0.qualifier" useFeatures="false" includeLaunchers="true">
<aboutInfo>
<image path="/org.eclipse.cdt.debug.application/icons/about.png"/>
diff --git a/debug/org.eclipse.cdt.debug.application.product/pom.xml b/debug/org.eclipse.cdt.debug.application.product/pom.xml
index 43636fbc44..48bcc6c0ae 100644
--- a/debug/org.eclipse.cdt.debug.application.product/pom.xml
+++ b/debug/org.eclipse.cdt.debug.application.product/pom.xml
@@ -11,7 +11,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/debug/org.eclipse.cdt.debug.application.tests/pom.xml b/debug/org.eclipse.cdt.debug.application.tests/pom.xml
index d48b93f1b0..399ffcde2a 100644
--- a/debug/org.eclipse.cdt.debug.application.tests/pom.xml
+++ b/debug/org.eclipse.cdt.debug.application.tests/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -36,6 +36,7 @@
<product>org.eclipse.cdt.debug.application.product</product>
<application>org.eclipse.cdt.debug.application.app</application>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<includes>
<include>**/AllTests.*</include>
</includes>
diff --git a/debug/org.eclipse.cdt.debug.application/plugin.properties b/debug/org.eclipse.cdt.debug.application/plugin.properties
index b58a06aaa5..26d801d1c9 100644
--- a/debug/org.eclipse.cdt.debug.application/plugin.properties
+++ b/debug/org.eclipse.cdt.debug.application/plugin.properties
@@ -41,6 +41,6 @@ DebugRemoteExecutableMenu.label=&Remote Executable...
DebugCore.description=Debug a corefile
DebugCore.name=Debug Core File
DebugCoreMenu.label=Debug &Core File...
-aboutText=Eclipse Stand-alone C/C++ GDB Graphical Debugger\n\nRelease 9.10.0\n
+aboutText=Eclipse Stand-alone C/C++ GDB Graphical Debugger\n\nRelease 9.11.0\n
ProductDesc=Eclipse Stand-alone C/C++ GDB Debugger
ProductName=Stand-alone C/C++ GDB Debugger
diff --git a/debug/org.eclipse.cdt.debug.application/pom.xml b/debug/org.eclipse.cdt.debug.application/pom.xml
index 25d0db0adb..8fec367c9d 100644
--- a/debug/org.eclipse.cdt.debug.application/pom.xml
+++ b/debug/org.eclipse.cdt.debug.application/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>org.eclipse.cdt.debug-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<version>1.1.400-SNAPSHOT</version>
diff --git a/debug/org.eclipse.cdt.debug.dap-feature/feature.xml b/debug/org.eclipse.cdt.debug.dap-feature/feature.xml
index 43ad007db0..5cba2213a1 100644
--- a/debug/org.eclipse.cdt.debug.dap-feature/feature.xml
+++ b/debug/org.eclipse.cdt.debug.dap-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.debug.dap"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/debug/org.eclipse.cdt.debug.dap/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.dap/META-INF/MANIFEST.MF
index 78fb69d419..771ad41fb6 100644
--- a/debug/org.eclipse.cdt.debug.dap/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.dap/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.debug.dap;singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.apache.commons.io,
org.eclipse.core.runtime,
@@ -20,7 +20,7 @@ Require-Bundle: org.apache.commons.io,
com.google.gson;bundle-version="2.8.2",
org.eclipse.lsp4j.jsonrpc,
org.eclipse.cdt.launch,
- org.eclipse.lsp4e.debug,
+ org.eclipse.lsp4e.debug;bundle-version="0.11.0",
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.cdt.debug.core,
@@ -28,7 +28,8 @@ Require-Bundle: org.apache.commons.io,
org.eclipse.lsp4j.jsonrpc.debug,
com.google.guava,
org.eclipse.xtext.xbase.lib,
- org.eclipse.cdt.dsf.gdb;bundle-version="5.7.200"
+ org.eclipse.cdt.dsf.gdb;bundle-version="5.7.200",
+ org.eclipse.cdt.debug.ui
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.cdt.debug.dap
Bundle-Activator: org.eclipse.cdt.debug.dap.Activator
diff --git a/debug/org.eclipse.cdt.debug.dap/debug-servers/package.json b/debug/org.eclipse.cdt.debug.dap/debug-servers/package.json
index d4138cf6e6..ad29782a63 100644
--- a/debug/org.eclipse.cdt.debug.dap/debug-servers/package.json
+++ b/debug/org.eclipse.cdt.debug.dap/debug-servers/package.json
@@ -7,6 +7,6 @@
"license": "EPL-2.0",
"scripts": {},
"dependencies": {
- "cdt-gdb-adapter": "https://ci.eclipse.org/cdt/view/all/job/cdt-gdb-adapter-master/lastSuccessfulBuild/artifact/cdt-gdb-adapter-v0.0.13.tgz"
+ "cdt-gdb-adapter": "^0.0.15-next.20191209022935.3b94420.0"
}
}
diff --git a/debug/org.eclipse.cdt.debug.dap/debug-servers/yarn.lock b/debug/org.eclipse.cdt.debug.dap/debug-servers/yarn.lock
index b44dd8e56d..6fa8cba9e8 100644
--- a/debug/org.eclipse.cdt.debug.dap/debug-servers/yarn.lock
+++ b/debug/org.eclipse.cdt.debug.dap/debug-servers/yarn.lock
@@ -2,12 +2,14 @@
# yarn lockfile v1
-"cdt-gdb-adapter@https://ci.eclipse.org/cdt/view/all/job/cdt-gdb-adapter-master/lastSuccessfulBuild/artifact/cdt-gdb-adapter-v0.0.13.tgz":
- version "0.0.13"
- resolved "https://ci.eclipse.org/cdt/view/all/job/cdt-gdb-adapter-master/lastSuccessfulBuild/artifact/cdt-gdb-adapter-v0.0.13.tgz#177b674b04459a660b6b800137bfd23e89ffa278"
+cdt-gdb-adapter@^0.0.15-next.20191209022935.3b94420.0:
+ version "0.0.15-next.20191209022935.3b94420.0"
+ resolved "https://registry.yarnpkg.com/cdt-gdb-adapter/-/cdt-gdb-adapter-0.0.15-next.20191209022935.3b94420.0.tgz#c905cc2bee76ff866f2a30dd76181bcbca5370ab"
+ integrity sha512-n3YHtih5ZlECnyhzt7ErjRdUprwHxuwfV2vOf3TXXkr8iZeFodoIB7mN1wQ8kpfrPG61wbwJyVC2nw3ceMu7Qg==
dependencies:
node-addon-api "^1.6.2"
- vscode-debugadapter "^1.32.1"
+ vscode-debugadapter "^1.37.1"
+ vscode-debugprotocol "^1.37.0"
minimist@0.0.8:
version "0.0.8"
@@ -26,7 +28,7 @@ node-addon-api@^1.6.2:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.1.tgz#cf813cd69bb8d9100f6bdca6755fc268f54ac492"
integrity sha512-2+DuKodWvwRTrCfKOeR24KIc5unKjOh8mz17NCzVnHWfjAdDqbfbjqh7gUT+BkXBRQM52+xCHciKWonJ3CbJMQ==
-vscode-debugadapter@^1.32.1:
+vscode-debugadapter@^1.37.1:
version "1.37.1"
resolved "https://registry.yarnpkg.com/vscode-debugadapter/-/vscode-debugadapter-1.37.1.tgz#7d7076e64e9786fe4fcb0c156e1ed24184a9fb2b"
integrity sha512-g/xNsUdkrd0DifaoRJ4+wypSMsMbK47fGpetpmIOnOQiDFjtYKvqxsgyUZ4BOj2jKP2Xa40B4YXfUUJpqreWJg==
@@ -34,7 +36,7 @@ vscode-debugadapter@^1.32.1:
mkdirp "^0.5.1"
vscode-debugprotocol "1.37.0"
-vscode-debugprotocol@1.37.0:
+vscode-debugprotocol@1.37.0, vscode-debugprotocol@^1.37.0:
version "1.37.0"
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.37.0.tgz#e8c4694a078d18ea1a639553a7a241b35c1e6f6d"
integrity sha512-ppZLEBbFRVNsK0YpfgFi/x2CDyihx0F+UpdKmgeJcvi05UgSXYdO0n9sDVYwoGvvYQPvlpDQeWuY0nloOC4mPA==
diff --git a/debug/org.eclipse.cdt.debug.dap/pom.xml b/debug/org.eclipse.cdt.debug.dap/pom.xml
index 01aa6cac23..5629a7aa3a 100644
--- a/debug/org.eclipse.cdt.debug.dap/pom.xml
+++ b/debug/org.eclipse.cdt.debug.dap/pom.xml
@@ -8,11 +8,11 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>1.0.100-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.debug.dap</artifactId>
<packaging>eclipse-plugin</packaging>
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/Activator.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/Activator.java
index b5823b45e9..983d5ec779 100644
--- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/Activator.java
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/Activator.java
@@ -12,7 +12,9 @@
package org.eclipse.cdt.debug.dap;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.lsp4e.debug.debugmodel.DSPDebugElement;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -29,6 +31,8 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+
+ Platform.getAdapterManager().registerAdapters(new DapDisassemblyBackendFactory(), DSPDebugElement.class);
}
@Override
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/CDTDebugProtocol.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/CDTDebugProtocol.java
index 1d65e23365..40a74f73af 100644
--- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/CDTDebugProtocol.java
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/CDTDebugProtocol.java
@@ -10,6 +10,11 @@
*******************************************************************************/
package org.eclipse.cdt.debug.dap;
+import java.util.Objects;
+
+import org.eclipse.lsp4j.debug.DisassembleArguments;
+import org.eclipse.lsp4j.debug.services.IDebugProtocolServer;
+import org.eclipse.lsp4j.debug.util.Preconditions;
import org.eclipse.lsp4j.jsonrpc.validation.NonNull;
import org.eclipse.xtext.xbase.lib.Pure;
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder;
@@ -32,11 +37,8 @@ public class CDTDebugProtocol {
return this.body;
}
- public void setBody(@NonNull final MemoryContents address) {
- if (address == null) {
- throw new IllegalArgumentException("Property must not be null: body"); //$NON-NLS-1$
- }
- this.body = address;
+ public void setBody(@NonNull final MemoryContents body) {
+ this.body = Preconditions.checkNotNull(body, "body"); //$NON-NLS-1$
}
@Override
@@ -93,11 +95,8 @@ public class CDTDebugProtocol {
return this.data;
}
- public void setData(@NonNull final String address) {
- if (address == null) {
- throw new IllegalArgumentException("Property must not be null: data"); //$NON-NLS-1$
- }
- this.data = address;
+ public void setData(@NonNull final String data) {
+ this.data = Preconditions.checkNotNull(data, "data"); //$NON-NLS-1$
}
@Pure
@@ -107,10 +106,7 @@ public class CDTDebugProtocol {
}
public void setAddress(@NonNull final String address) {
- if (address == null) {
- throw new IllegalArgumentException("Property must not be null: address"); //$NON-NLS-1$
- }
- this.address = address;
+ this.address = Preconditions.checkNotNull(address, "address"); //$NON-NLS-1$
}
@Override
@@ -177,10 +173,7 @@ public class CDTDebugProtocol {
}
public void setAddress(@NonNull final String address) {
- if (address == null) {
- throw new IllegalArgumentException("Property must not be null: address"); //$NON-NLS-1$
- }
- this.address = address;
+ this.address = Preconditions.checkNotNull(address, "address"); //$NON-NLS-1$
}
@Pure
@@ -190,10 +183,7 @@ public class CDTDebugProtocol {
}
public void setLength(@NonNull final Long length) {
- if (length == null) {
- throw new IllegalArgumentException("Property must not be null: length"); //$NON-NLS-1$
- }
- this.length = length;
+ this.length = Preconditions.checkNotNull(length, "length"); //$NON-NLS-1$
}
@Pure
@@ -201,11 +191,8 @@ public class CDTDebugProtocol {
return this.offset;
}
- public void setOffset(@NonNull final Long length) {
- if (length == null) {
- throw new IllegalArgumentException("Property must not be null: offset"); //$NON-NLS-1$
- }
- this.offset = length;
+ public void setOffset(final Long offset) {
+ this.offset = offset;
}
@Override
@@ -256,6 +243,60 @@ public class CDTDebugProtocol {
return false;
return true;
}
+ }
+
+ /**
+ * An extension to standard {@link DisassembleArguments} that can
+ * be passed to {@link IDebugProtocolServer#disassemble(DisassembleArguments)}
+ *
+ * When endMemoryReference is provided, the disassemble command will return
+ * the minimum number of instructions to get to the end address or number
+ * of lines (instructionCount), whichever is smaller.
+ */
+ public static class CDTDisassembleArguments extends DisassembleArguments {
+
+ private String endMemoryReference;
+
+ @Pure
+ public String getEndMemoryReference() {
+ return this.endMemoryReference;
+ }
+
+ public void setEndMemoryReference(final String endMemoryReference) {
+ this.endMemoryReference = endMemoryReference;
+ }
+ @Override
+ @Pure
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this);
+ b.add("memoryReference", this.getMemoryReference()); //$NON-NLS-1$
+ b.add("offset", this.getOffset()); //$NON-NLS-1$
+ b.add("instructionOffset", this.getInstructionOffset()); //$NON-NLS-1$
+ b.add("instructionCount", this.getInstructionCount()); //$NON-NLS-1$
+ b.add("resolveSymbols", this.getResolveSymbols()); //$NON-NLS-1$
+ b.add("endMemoryReference", this.endMemoryReference); //$NON-NLS-1$
+ return b.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + Objects.hash(endMemoryReference);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CDTDisassembleArguments other = (CDTDisassembleArguments) obj;
+ return Objects.equals(endMemoryReference, other.endMemoryReference);
+ }
}
-} \ No newline at end of file
+}
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDebugTarget.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDebugTarget.java
index 419e125d3e..fe00ba2d9c 100644
--- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDebugTarget.java
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDebugTarget.java
@@ -94,5 +94,4 @@ public class DapDebugTarget extends DSPDebugTarget implements IMemoryBlockRetrie
}
return new MemoryBlock(this, expression, bigBaseAddress, context);
}
-
}
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackend.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackend.java
new file mode 100644
index 0000000000..1ee8183942
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackend.java
@@ -0,0 +1,382 @@
+package org.eclipse.cdt.debug.dap;
+
+import static org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils.DEBUG;
+
+import java.math.BigInteger;
+import java.text.MessageFormat;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
+import org.eclipse.cdt.debug.dap.CDTDebugProtocol.CDTDisassembleArguments;
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AbstractDisassemblyBackend;
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils;
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.ErrorPosition;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Position;
+import org.eclipse.lsp4e.debug.debugmodel.DSPDebugTarget;
+import org.eclipse.lsp4e.debug.debugmodel.DSPStackFrame;
+import org.eclipse.lsp4j.debug.DisassembleResponse;
+import org.eclipse.lsp4j.debug.DisassembledInstruction;
+import org.eclipse.lsp4j.debug.Source;
+
+@SuppressWarnings("restriction")
+public class DapDisassemblyBackend extends AbstractDisassemblyBackend {
+
+ private DSPStackFrame dspStackFrame;
+
+ @Override
+ public boolean supportsDebugContext(IAdaptable context) {
+ return context instanceof DSPStackFrame;
+ }
+
+ @Override
+ public boolean hasDebugContext() {
+ return dspStackFrame != null;
+ }
+
+ @Override
+ public SetDebugContextResult setDebugContext(IAdaptable context) {
+ assert context instanceof DSPStackFrame;
+ SetDebugContextResult setDebugContextResult = new SetDebugContextResult();
+ if (context instanceof DSPStackFrame) {
+
+ DSPStackFrame newDspStackFrame = (DSPStackFrame) context;
+ setDebugContextResult.contextChanged = !newDspStackFrame.equals(dspStackFrame);
+ dspStackFrame = newDspStackFrame;
+ // sessionId should have been boolean and been hasSessionId, only null/non-null is relevant
+ setDebugContextResult.sessionId = ""; //$NON-NLS-1$
+ if (!setDebugContextResult.contextChanged) {
+ fCallback.gotoFrameIfActive(dspStackFrame.getDepth());
+ }
+ } else {
+ setDebugContextResult.contextChanged = true;
+ setDebugContextResult.sessionId = null;
+ }
+
+ return setDebugContextResult;
+ }
+
+ @Override
+ public void clearDebugContext() {
+ dspStackFrame = null;
+ }
+
+ @Override
+ public void retrieveFrameAddress(int frame) {
+ fCallback.setUpdatePending(false);
+ fCallback.asyncExec(() -> {
+ int addressBits = dspStackFrame.getFrameInstructionAddressBits();
+ BigInteger address = dspStackFrame.getFrameInstructionAddress();
+ if (addressBits != fCallback.getAddressSize()) {
+ fCallback.addressSizeChanged(addressBits);
+ }
+ if (frame == 0) {
+ fCallback.updatePC(address);
+ } else {
+ fCallback.gotoFrame(frame, address);
+ }
+ });
+ }
+
+ @Override
+ public int getFrameLevel() {
+ return dspStackFrame.getDepth();
+ }
+
+ @Override
+ public boolean isSuspended() {
+ return dspStackFrame.getDebugTarget().isSuspended();
+ }
+
+ @Override
+ public boolean hasFrameContext() {
+
+ return false;
+ }
+
+ @Override
+ public String getFrameFile() {
+
+ return null;
+ }
+
+ @Override
+ public int getFrameLine() {
+
+ return 0;
+ }
+
+ /**
+ * Retrieves disassembly based on either (a) start and end address range, or
+ * (b) file, line number, and line count. If the caller specifies both sets
+ * of information, the implementation should honor (b) and ignore (a).
+ */
+ @Override
+ public void retrieveDisassembly(BigInteger startAddress, BigInteger endAddress, String file, int lineNumber,
+ int lines, boolean mixed, boolean showSymbols, boolean showDisassembly, int linesHint) {
+ CDTDisassembleArguments args = new CDTDisassembleArguments();
+ args.setMemoryReference("0x" + startAddress.toString(16)); //$NON-NLS-1$
+ args.setInstructionCount((long) lines);
+ args.setEndMemoryReference("1+0x" + endAddress.toString(16)); //$NON-NLS-1$
+ CompletableFuture<DisassembleResponse> future = dspStackFrame.getDebugProtocolServer().disassemble(args);
+ future.thenAcceptAsync(res -> {
+ fCallback.asyncExec(() -> insertDisassembly(startAddress, endAddress, res, showSymbols, showDisassembly));
+ });
+ }
+
+ /**
+ * @param startAddress
+ * an address the caller is hoping will be covered by this
+ * insertion. I.e., [mixedInstructions] may or may not contain
+ * that address; the caller wants to know if it does, and so we
+ * indicate that via our return value. Can be null to indicate n/a,
+ * in which case we return true as long as any instruction was inserted
+ * as long as any instruction was inserted
+ * @param endAddress
+ * cut-off address. Any elements in [mixedInstructions] that
+ * extend beyond this address are ignored.
+ * @param mixedInstructions
+ * @param showSymbols
+ * @param showDisassembly
+ * @return whether [startAddress] was inserted
+ */
+ private void insertDisassembly(BigInteger startAddress, BigInteger endAddress, DisassembleResponse response,
+ boolean showSymbols, boolean showDisassembly) {
+ if (!fCallback.hasViewer() || dspStackFrame == null) {
+ if (DEBUG) {
+ System.out.println(
+ MessageFormat.format("insertDisassembly ignored at {0} : missing context: [dspStackFrame={1}]", //$NON-NLS-1$
+ DisassemblyUtils.getAddressText(startAddress), dspStackFrame));
+ }
+ if (dspStackFrame == null) {
+ fCallback.setUpdatePending(false);
+ }
+ return;
+ }
+ if (DEBUG)
+ System.out.println("insertDisassembly " + DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
+ boolean updatePending = fCallback.getUpdatePending();
+ assert updatePending;
+ if (!updatePending) {
+ // safe-guard in case something weird is going on
+ return;
+ }
+
+ boolean insertedAnyAddress = false;
+ try {
+ fCallback.lockScroller();
+
+ AddressRangePosition p = null;
+ Source location = null;
+ DisassembledInstruction[] instructions = response.getInstructions();
+ for (int i = 0; i < instructions.length; ++i) {
+ DisassembledInstruction instruction = instructions[i];
+ if (instruction.getLocation() != null) {
+ location = instruction.getLocation();
+ }
+ assert location != null;
+ String file = null;
+ if (location != null) {
+ file = location.getPath();
+ }
+ Long line = instruction.getLine();
+ int lineNumber = (line == null ? 0 : line.intValue()) - 1;
+ BigInteger address = getAddress(instruction);
+ if (startAddress == null) {
+ startAddress = address;
+ fCallback.setGotoAddressPending(address);
+ }
+ if (p == null || !p.containsAddress(address)) {
+ p = fCallback.getPositionOfAddress(address);
+ }
+ if (p instanceof ErrorPosition && p.fValid) {
+ p.fValid = false;
+ fCallback.getDocument().addInvalidAddressRange(p);
+ } else if (p == null || address.compareTo(endAddress) > 0) {
+ if (DEBUG)
+ System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ return;
+ } else if (p.fValid) {
+ if (DEBUG)
+ System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ if (!p.fAddressOffset.equals(address)) {
+ // override probably unaligned disassembly
+ p.fValid = false;
+ fCallback.getDocument().addInvalidAddressRange(p);
+ } else {
+ continue;
+ }
+ }
+ boolean hasSource = false;
+ if (file != null && lineNumber >= 0) {
+ p = fCallback.insertSource(p, address, file, lineNumber);
+ hasSource = fCallback.getStorageForFile(file) != null;
+ }
+ // insert symbol label
+ String functionName;
+ int offset;
+ String symbol = instruction.getSymbol();
+ if (symbol != null) {
+ String[] split = symbol.split("\\+", 2); //$NON-NLS-1$
+ functionName = split[0];
+ if (split.length > 1) {
+ try {
+ offset = Integer.parseInt(split[1]);
+ } catch (NumberFormatException e) {
+ offset = 0;
+ }
+ } else {
+ offset = 0;
+ }
+ } else {
+ functionName = null;
+ offset = 0;
+ }
+ if (functionName != null && !functionName.isEmpty() && offset == 0) {
+ p = fCallback.getDocument().insertLabel(p, address, functionName,
+ showSymbols && (!hasSource || showDisassembly));
+ }
+ // determine instruction byte length
+ BigInteger instrLength = null;
+ if (i < instructions.length - 1) {
+ instrLength = getAddress(instructions[i + 1]).subtract(address).abs();
+ } else {
+ // cannot determine length of last instruction
+ break;
+ }
+ String funcOffset = instruction.getSymbol();
+ if (funcOffset == null) {
+ funcOffset = ""; //$NON-NLS-1$
+ }
+
+ BigInteger opCodes = null;
+ if (instruction.getInstructionBytes() != null) {
+ opCodes = new BigInteger(instruction.getInstructionBytes().replace(" ", ""), 16); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ p = fCallback.getDocument().insertDisassemblyLine(p, address, instrLength.intValue(), funcOffset,
+ opCodes, instruction.getInstruction(), file, lineNumber);
+ if (p == null) {
+ break;
+ }
+ insertedAnyAddress = true;
+
+ }
+
+ } catch (BadLocationException e) {
+ // should not happen
+ DisassemblyUtils.internalError(e);
+ } finally {
+ fCallback.setUpdatePending(false);
+ if (insertedAnyAddress) {
+ fCallback.updateInvalidSource();
+ fCallback.unlockScroller();
+ fCallback.doPending();
+ fCallback.updateVisibleArea();
+ } else {
+ fCallback.unlockScroller();
+ }
+ }
+ }
+
+ private BigInteger getAddress(DisassembledInstruction instruction) {
+ if (instruction.getAddress().startsWith("0x")) { //$NON-NLS-1$
+ return new BigInteger(instruction.getAddress().substring(2), 16);
+ } else {
+ return new BigInteger(instruction.getAddress(), 10);
+ }
+ }
+
+ @Override
+ public Object insertSource(Position pos, BigInteger address, String file, int lineNumber) {
+ ISourceLookupDirector lookupDirector = getSourceLookupDirector();
+ return lookupDirector.getSourceElement(file);
+ }
+
+ private ISourceLookupDirector getSourceLookupDirector() {
+ if (dspStackFrame == null) {
+ return null;
+ }
+ DSPDebugTarget debugTarget = dspStackFrame.getDebugTarget();
+ if (debugTarget == null) {
+ return null;
+ }
+ ILaunch launch = debugTarget.getLaunch();
+ if (launch == null) {
+ return null;
+ }
+ ISourceLocator sourceLocator = launch.getSourceLocator();
+ if (sourceLocator instanceof ISourceLookupDirector) {
+ ISourceLookupDirector lookupDirector = (ISourceLookupDirector) sourceLocator;
+ return lookupDirector;
+ }
+ return null;
+ }
+
+ @Override
+ public void gotoSymbol(String symbol) {
+ String.class.getClass();
+
+ }
+
+ @Override
+ public void retrieveDisassembly(String file, int lines, BigInteger endAddress, boolean mixed, boolean showSymbols,
+ boolean showDisassembly) {
+ String.class.getClass();
+
+ }
+
+ @Override
+ public String evaluateExpression(String expression) {
+ CompletableFuture<IVariable> evaluate = dspStackFrame.evaluate(expression);
+ try {
+ IVariable iVariable = evaluate.get();
+ return iVariable.getValue().getValueString();
+ } catch (InterruptedException e) {
+ return null;
+ } catch (ExecutionException | DebugException | NumberFormatException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public void dispose() {
+ String.class.getClass();
+
+ }
+
+ @Override
+ protected void handleError(IStatus status) {
+ Activator.log(status);
+ }
+
+ @Override
+ public BigInteger evaluateAddressExpression(String expression, boolean suppressError) {
+ CompletableFuture<IVariable> evaluate = dspStackFrame.evaluate(expression);
+ try {
+ IVariable variable = evaluate.get();
+ return DisassemblyUtils.decodeAddress(variable.getValue().getValueString());
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ return null;
+ } catch (ExecutionException | DebugException | NumberFormatException e) {
+ if (!suppressError) {
+ DapDisassemblyBackend.this.handleError(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0,
+ "Expression does not evaluate to an address (" //$NON-NLS-1$
+ + e.getMessage() + ")", //$NON-NLS-1$
+ null));
+ }
+ return null;
+ }
+
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackendFactory.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackendFactory.java
new file mode 100644
index 0000000000..18f268c30f
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapDisassemblyBackendFactory.java
@@ -0,0 +1,29 @@
+package org.eclipse.cdt.debug.dap;
+
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.lsp4e.debug.debugmodel.DSPStackFrame;
+
+public class DapDisassemblyBackendFactory implements IAdapterFactory {
+
+ private static final Class<?>[] ADAPTERS = { IDisassemblyBackend.class };
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
+ if (IDisassemblyBackend.class.equals(adapterType)) {
+ if (adaptableObject instanceof DSPStackFrame) {
+ DSPStackFrame dspDebugElement = (DSPStackFrame) adaptableObject;
+ if (dspDebugElement.getDebugTarget() instanceof DapDebugTarget) {
+ return (T) new DapDisassemblyBackend();
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Class<?>[] getAdapterList() {
+ return ADAPTERS;
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/ICDTDebugProtocolServer.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/ICDTDebugProtocolServer.java
index 11c7593cb6..27a34f7b32 100644
--- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/ICDTDebugProtocolServer.java
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/ICDTDebugProtocolServer.java
@@ -26,5 +26,4 @@ public interface ICDTDebugProtocolServer extends IDebugProtocolServer {
default CompletableFuture<MemoryContents> memory(MemoryRequestArguments args) {
throw new UnsupportedOperationException();
}
-
}
diff --git a/debug/org.eclipse.cdt.debug.standalone-feature/feature.xml b/debug/org.eclipse.cdt.debug.standalone-feature/feature.xml
index e32e4cb510..23deb5df32 100644
--- a/debug/org.eclipse.cdt.debug.standalone-feature/feature.xml
+++ b/debug/org.eclipse.cdt.debug.standalone-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.debug.standalone"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
index 84e9d379c7..69cff113b3 100644
--- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Export-Package: org.eclipse.cdt.debug.internal.ui;x-friends:="org.eclipse.cdt.ds
org.eclipse.cdt.debug.internal.ui.dialogfields;x-friends:="org.eclipse.cdt.dsf.gdb.ui",
org.eclipse.cdt.debug.internal.ui.dialogs;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.disassembly.commands;x-internal:=true,
- org.eclipse.cdt.debug.internal.ui.disassembly.dsf;x-friends:="org.eclipse.cdt.dsf.ui",
+ org.eclipse.cdt.debug.internal.ui.disassembly.dsf;x-friends:="org.eclipse.cdt.dsf.ui,org.eclipse.cdt.debug.dap",
org.eclipse.cdt.debug.internal.ui.disassembly.editor;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.disassembly.viewer;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.editors;x-internal:=true,
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java
index 5dde9afa17..bf1f3dd53d 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java
@@ -50,6 +50,19 @@ public class DisassemblyUtils {
}
public static BigInteger decodeAddress(String string) {
+ // Handle case where address has type info, such as:
+ // {int (const char *, ...)} 0x7ffff7a48e80 <__printf>
+ if (string.startsWith("{")) { //$NON-NLS-1$
+ int indexOf = string.indexOf('}');
+ if (indexOf >= 0 && indexOf < string.length()) {
+ string = string.substring(indexOf + 1);
+ }
+ indexOf = string.indexOf('<');
+ if (indexOf >= 0) {
+ string = string.substring(0, indexOf);
+ }
+ string = string.trim();
+ }
if (string.startsWith("0x")) { //$NON-NLS-1$
return new BigInteger(string.substring(2), 16);
}
diff --git a/debug/org.eclipse.cdt.gdb-feature/feature.xml b/debug/org.eclipse.cdt.gdb-feature/feature.xml
index 31cbfc817c..7189e7bebc 100644
--- a/debug/org.eclipse.cdt.gdb-feature/feature.xml
+++ b/debug/org.eclipse.cdt.gdb-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gdb"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.gdb"
license-feature="org.eclipse.license"
diff --git a/debug/org.eclipse.cdt.gdb-feature/pom.xml b/debug/org.eclipse.cdt.gdb-feature/pom.xml
index 1e782ea802..f98a08d325 100644
--- a/debug/org.eclipse.cdt.gdb-feature/pom.xml
+++ b/debug/org.eclipse.cdt.gdb-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/debug/org.eclipse.cdt.gnu.debug-feature/feature.xml b/debug/org.eclipse.cdt.gnu.debug-feature/feature.xml
index 644c08ae30..f541c54a48 100644
--- a/debug/org.eclipse.cdt.gnu.debug-feature/feature.xml
+++ b/debug/org.eclipse.cdt.gnu.debug-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.debug"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/debug/pom.xml b/debug/pom.xml
index 99490813ba..4dbbf8169f 100644
--- a/debug/pom.xml
+++ b/debug/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.debug-parent</artifactId>
diff --git a/disable_intro_in_tests.ini b/disable_intro_in_tests.ini
new file mode 100644
index 0000000000..ceec1e159d
--- /dev/null
+++ b/disable_intro_in_tests.ini
@@ -0,0 +1,3 @@
+# Bug 552745 - we can't showIntro on CI machine because there is no working webkit there and due to bug 552716 that causes
+# eclipse to have a hard crash
+org.eclipse.ui/showIntro=false \ No newline at end of file
diff --git a/doc/org.eclipse.cdt.doc.isv/pom.xml b/doc/org.eclipse.cdt.doc.isv/pom.xml
index 1bf2a63d9c..a89e7ef2ee 100644
--- a/doc/org.eclipse.cdt.doc.isv/pom.xml
+++ b/doc/org.eclipse.cdt.doc.isv/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/doc/org.eclipse.cdt.doc.user/pom.xml b/doc/org.eclipse.cdt.doc.user/pom.xml
index 464d0fa032..a3221201b6 100644
--- a/doc/org.eclipse.cdt.doc.user/pom.xml
+++ b/doc/org.eclipse.cdt.doc.user/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests/META-INF/MANIFEST.MF
index 0b3820efbb..b15e28d868 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DSF-GDB test fragment
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests;singleton:=true
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/META-INF/MANIFEST.MF
index eaebd5d7a6..222d010a16 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DSF-GDB test fragment
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.tests;singleton:=true
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.cdt.dsf.gdb
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF
index d8a7d4c4ef..b41fa97f10 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF
@@ -37,6 +37,8 @@ Export-Package: org.eclipse.cdt.dsf.gdb.internal.ui;x-friends:="org.eclipse.cdt.
org.eclipse.cdt.dsf.gdb.internal.ui.commands;x-internal:=true,
org.eclipse.cdt.dsf.gdb.internal.ui.console;x-friends:="org.eclipse.cdt.examples.dsf.gdb",
org.eclipse.cdt.dsf.gdb.internal.ui.console.actions;x-internal:=true,
+ org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;x-internal:=true,
+ org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;x-internal:=true,
org.eclipse.cdt.dsf.gdb.internal.ui.disassembly;x-internal:=true,
org.eclipse.cdt.dsf.gdb.internal.ui.launching;x-friends:="org.eclipse.cdt.debug.gdbjtag.ui,org.eclipse.cdt.examples.dsf.gdb,org.eclipse.cdt.docker.launcher",
org.eclipse.cdt.dsf.gdb.internal.ui.memory;x-internal:=true,
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout.png
new file mode 100644
index 0000000000..061b593caa
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout@2x.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout@2x.png
new file mode 100644
index 0000000000..23540f72b6
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/flatLayout@2x.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout.png
new file mode 100644
index 0000000000..64822eaa0d
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout@2x.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout@2x.png
new file mode 100644
index 0000000000..b84fb01bf1
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/dlcl16/hierarchicalLayout@2x.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/collapse_all.gif b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/collapse_all.gif
new file mode 100644
index 0000000000..b004e7c337
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/collapse_all.gif
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/existingFiles.gif b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/existingFiles.gif
new file mode 100644
index 0000000000..b226e41c52
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/existingFiles.gif
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/expand_all.gif b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/expand_all.gif
new file mode 100644
index 0000000000..d66de6d100
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/expand_all.gif
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout.png
new file mode 100644
index 0000000000..13f83a2374
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout@2x.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout@2x.png
new file mode 100644
index 0000000000..280561aeb4
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/flatLayout@2x.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout.png
new file mode 100644
index 0000000000..665aa5cee3
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout@2x.png b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout@2x.png
new file mode 100644
index 0000000000..84039be3a9
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/elcl16/hierarchicalLayout@2x.png
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/view16/debugsources_view.gif b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/view16/debugsources_view.gif
new file mode 100644
index 0000000000..37b4705463
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/view16/debugsources_view.gif
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/refresh.gif b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/refresh.gif
new file mode 100644
index 0000000000..b6b8dc6836
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/refresh.gif
Binary files differ
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties
index 14cee021f4..bb0e517600 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties
@@ -36,6 +36,7 @@ tracepoints.action.page.label=Actions
tracepointActionsPrefPage.name=Tracepoint Actions\u0020
dynamicPrintf.property.common=Common
action.addDynamicPrintf.label=Add Dynamic-Printf...
+debugSourcesRefresh.name=Refresh
# Tracepoints
view.traceControl.name=Trace Control
@@ -59,6 +60,7 @@ action.fetchMoreChildren.label=Fetch More Children
# OS view
view.osresources.name=OS Resources
+view.debugsources.name=Debug Sources
command.connect.description = Connect to selected processes
command.connect.name = Connect
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
index 75ae7454c9..bc74c689b2 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
@@ -296,6 +296,14 @@
name="%view.osresources.name"
icon="icons/full/view16/osresources_view.gif">
</view>
+ <view
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesView"
+ icon="icons/full/view16/debugsources_view.gif"
+ id="org.eclipse.cdt.dsf.gdb.ui.debugsources.view"
+ name="%view.debugsources.name"
+ restorable="true">
+ </view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
@@ -327,6 +335,18 @@
id="org.eclipse.cdt.debug.ui.debuggerConsoleView">
</viewShortcut>
</perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.debug.ui.DebugPerspective">
+ <view
+ relative="org.eclipse.ui.console.ConsoleView"
+ visible="false"
+ relationship="stack"
+ id="org.eclipse.cdt.dsf.gdb.ui.debugsources.view">
+ </view>
+ <viewShortcut
+ id="org.eclipse.cdt.dsf.gdb.ui.debugsources.view">
+ </viewShortcut>
+ </perspectiveExtension>
</extension>
<extension
point="org.eclipse.ui.commands">
@@ -630,4 +650,25 @@
name="GDB Remote Serial">
</wizard2>
</extension>
+ <extension
+ point="org.eclipse.debug.ui.contextViewBindings">
+ <contextViewBinding
+ autoOpen="false"
+ contextId="org.eclipse.cdt.debug.ui.debugging"
+ viewId="org.eclipse.cdt.dsf.gdb.ui.debugsources.view">
+ </contextViewBinding>
+ </extension>
+ <extension point="org.eclipse.ui.viewActions">
+ <viewContribution
+ id="org.eclipse.cdt.dsf.gdb.ui.debugsources.view.refresh"
+ targetID="org.eclipse.cdt.dsf.gdb.ui.debugsources.view">
+ <action
+ class="org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesViewRefresh"
+ icon="icons/refresh.gif"
+ id="org.eclipse.cdt.dsf.gdb.ui.debugsources.view.refresh"
+ label="%debugSourcesRefresh.name"
+ toolbarPath="additions">
+ </action>
+ </viewContribution>
+ </extension>
</plugin>
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesLabelProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesLabelProvider.java
new file mode 100644
index 0000000000..87ce3a4709
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesLabelProvider.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import java.io.File;
+import java.util.Set;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesTreeElement.FileExist;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.Display;
+
+public class DebugSourcesLabelProvider extends ColumnLabelProvider {
+ private int index;
+ private boolean flattenFoldersWithNoFiles = true;
+ private boolean showExistingFilesOnly = true;
+
+ /**
+ *
+ * @param index
+ * of column
+ */
+ public DebugSourcesLabelProvider(int index) {
+ this.index = index;
+ }
+
+ public void setFlattenFoldersWithNoFiles(boolean flattenFoldersWithNoFiles) {
+ this.flattenFoldersWithNoFiles = flattenFoldersWithNoFiles;
+ }
+
+ public boolean isFlattenFoldersWithNoFiles() {
+ return flattenFoldersWithNoFiles;
+ }
+
+ public void setShowExistingFilesOnly(boolean showExistingFilesOnly) {
+ this.showExistingFilesOnly = showExistingFilesOnly;
+ }
+
+ public boolean isShowExistingFilesOnly() {
+ return showExistingFilesOnly;
+ }
+
+ @Override
+ public String getText(Object element) {
+ return getLabel(element, index);
+ }
+
+ private String getLabel(Object element, int columnIdx) {
+ String emptyString = ""; //$NON-NLS-1$
+ if (element instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement node = (DebugSourcesTreeElement) element;
+ if (columnIdx == 0) {
+ Set<DebugSourcesTreeElement> children;
+ StringBuilder sb = new StringBuilder();
+ sb.append(node.getName());
+ if (flattenFoldersWithNoFiles) {
+ while (true) {
+ if (node.getFullPath() != null) {
+ break;
+ }
+ children = node.getChildren(showExistingFilesOnly);
+
+ if (children.size() != 1) {
+ break;
+ }
+ DebugSourcesTreeElement child = children.iterator().next();
+ if (child.getFullPath() != null) {
+ break;
+ }
+
+ node = child;
+ if (sb.length() > 0 && sb.charAt(sb.length() - 1) != File.separatorChar) {
+ sb.append(File.separatorChar);
+ }
+ sb.append(node.getName());
+ }
+ }
+ return sb.toString();
+ }
+ if (columnIdx == 1) {
+ return node.hasChildren() ? emptyString : (String) node.getFullPath();
+ }
+ }
+ return emptyString;
+ }
+
+ @Override
+ public Color getForeground(Object element) {
+ if (index == 1) {
+ if (element instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement node = (DebugSourcesTreeElement) element;
+ if (node.getExists() == FileExist.NO) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ }
+ }
+ }
+
+ return super.getForeground(element);
+ }
+
+ @Override
+ public Font getFont(Object element) {
+ // TODO Auto-generated method stub
+ return super.getFont(element);
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.java
new file mode 100644
index 0000000000..d1502b7967
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ */
+public class DebugSourcesMessages extends NLS {
+
+ public static String DebugSourcesMessages_name_column;
+ public static String DebugSourcesMessages_path_column;
+ public static String DebugSourcesMessages_unknown;
+
+ public static String DebugSourcesMessages_filter_search_tooltip;
+ public static String DebugSourcesMessages_sort_name_column_tooltip;
+ public static String DebugSourcesMessages_sort_path_column_tooltip;
+
+ public static String DebugSourcesExpandAction_name;
+ public static String DebugSourcesExpandAction_description;
+ public static String DebugSourcesCollapseAction_name;
+ public static String DebugSourcesCollapseAction_description;
+ public static String DebugSourcesFlattendedTree_name;
+ public static String DebugSourcesFlattendedTree_description;
+ public static String DebugSourcesNormalTree_description;
+ public static String DebugSourcesNormalTree_name;
+ public static String DebugSourcesShowExistingFilesOnly_description;
+ public static String DebugSourcesShowExistingFilesOnly_name;
+ public static String DebugSourcesView_unrooted;
+
+ public static String GdbDebugSourcesPreferences_name;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(DebugSourcesMessages.class.getName(), DebugSourcesMessages.class);
+ }
+
+ private DebugSourcesMessages() {
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.properties
new file mode 100644
index 0000000000..f90c7c064c
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesMessages.properties
@@ -0,0 +1,35 @@
+##########################################################################
+# Copyright (c) 2018, 2019 Kichwa Coders and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Baha El-Kassaby - Initial API and implementation
+##########################################################################
+
+DebugSourcesMessages_name_column=Name
+DebugSourcesMessages_path_column=Path
+DebugSourcesMessages_unknown=Unknown
+
+DebugSourcesMessages_filter_search_tooltip=Search on debug sources file names
+DebugSourcesMessages_sort_name_column_tooltip=Left-click on the \"Name\" column to sort by name
+DebugSourcesMessages_sort_path_column_tooltip=Left-click on the \"Path\" column to sort by path
+
+DebugSourcesExpandAction_name=Expand
+DebugSourcesExpandAction_description=Expand the tree structure
+DebugSourcesCollapseAction_name=Collapse
+DebugSourcesCollapseAction_description=Collapse the tree structure
+DebugSourcesFlattendedTree_name=Flat View
+DebugSourcesFlattendedTree_description=Display tree by flattening folders with no files.
+DebugSourcesNormalTree_description=Normal tree view
+DebugSourcesNormalTree_name=Normal View
+DebugSourcesShowExistingFilesOnly_description=Show only files that are found on disk.
+DebugSourcesShowExistingFilesOnly_name=Show
+DebugSourcesView_unrooted=<unrooted>
+
+GdbDebugSourcesPreferences_name=Preferences...
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeContentProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeContentProvider.java
new file mode 100644
index 0000000000..f11a37ed80
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeContentProvider.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import java.util.Set;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+
+public class DebugSourcesTreeContentProvider implements ITreeContentProvider {
+ private boolean flattenFoldersWithNoFiles = true;
+ private boolean showExistingFilesOnly = true;
+
+ public DebugSourcesTreeContentProvider() {
+ }
+
+ public void setFlattenFoldersWithNoFiles(boolean flattenFoldersWithNoFiles) {
+ this.flattenFoldersWithNoFiles = flattenFoldersWithNoFiles;
+ }
+
+ public boolean isFlattenFoldersWithNoFiles() {
+ return flattenFoldersWithNoFiles;
+ }
+
+ public void setShowExistingFilesOnly(boolean showExistingFilesOnly) {
+ this.showExistingFilesOnly = showExistingFilesOnly;
+ }
+
+ public boolean isShowExistingFilesOnly() {
+ return showExistingFilesOnly;
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement tree = (DebugSourcesTreeElement) inputElement;
+ Set<DebugSourcesTreeElement> children = tree.getChildren(showExistingFilesOnly);
+ return children.toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement tree = (DebugSourcesTreeElement) parentElement;
+ Set<DebugSourcesTreeElement> children = tree.getChildren(showExistingFilesOnly);
+
+ if (flattenFoldersWithNoFiles) {
+ if (children.size() == 1) {
+ DebugSourcesTreeElement child = children.iterator().next();
+ if (child.getFullPath() == null) {
+ return getChildren(child);
+ }
+ }
+ }
+ return children.toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ if (element == null)
+ return null;
+ if (element instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement node = (DebugSourcesTreeElement) element;
+ DebugSourcesTreeElement parent = node.getParent();
+ if (parent == null) {
+ return null;
+ }
+ if (flattenFoldersWithNoFiles) {
+ DebugSourcesTreeElement grandParent = parent.getParent();
+ if (grandParent != null) {
+ Set<DebugSourcesTreeElement> children = grandParent.getChildren(showExistingFilesOnly);
+ if (children.size() == 1) {
+ return getParent(parent);
+ }
+ }
+ }
+ return parent;
+ }
+ return null;
+
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof DebugSourcesTreeElement) {
+ return getChildren(element).length > 0;
+ }
+ return false;
+ }
+
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeElement.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeElement.java
new file mode 100644
index 0000000000..a5ccee1ed6
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesTreeElement.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import java.util.LinkedHashSet;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * A basic tree used to display source files in the debug view
+ */
+public class DebugSourcesTreeElement {
+
+ public enum FileExist {
+ YES, NO, UNKNOWN;
+ }
+
+ // preserve insertion order with LinkedHashSet
+ private final Set<DebugSourcesTreeElement> children = new LinkedHashSet<>();
+ private final String name;
+ private final String fullPath;
+ private DebugSourcesTreeElement parent;
+ private FileExist exists;
+
+ /**
+ *
+ * @param name part of the path
+ * @param exists
+ */
+ public DebugSourcesTreeElement(String name, FileExist exists) {
+ this.name = name;
+ this.fullPath = null;
+ this.exists = exists;
+ }
+
+ /**
+ * If node is a leaf, add the fullPath as well
+ *
+ * @param name part of the path
+ * @param leafData full path of the file
+ */
+ private DebugSourcesTreeElement(String name, String fullPath, FileExist exist) {
+ this.name = name;
+ this.fullPath = fullPath;
+ this.exists = exist;
+ }
+
+ /**
+ *
+ * @param name part of the path
+ * @param exists
+ * @return a new node if not already existing, existing node otherwise
+ */
+ public DebugSourcesTreeElement addNode(String name, FileExist exists) {
+ for (DebugSourcesTreeElement child : children) {
+ if (child.name.equals(name)) {
+ if (exists == FileExist.YES) {
+ child.exists = FileExist.YES;
+ }
+ return child;
+ }
+ }
+ return addChild(new DebugSourcesTreeElement(name, exists));
+ }
+
+ /**
+ *
+ * @param name part of the path
+ * @param fullPath of leaf
+ * @return a new leaf if not already existing, existing leaf otherwise
+ */
+ public DebugSourcesTreeElement addLeaf(String name, String fullPath, FileExist exists) {
+ for (DebugSourcesTreeElement child : children) {
+ if (child.name.equals(name)) {
+ return child;
+ }
+ }
+ return addChild(new DebugSourcesTreeElement(name, fullPath, exists));
+ }
+
+ private DebugSourcesTreeElement addChild(DebugSourcesTreeElement child) {
+ children.add(child);
+ return child;
+ }
+
+ /**
+ *
+ * @return list of children of the node
+ */
+ public Set<DebugSourcesTreeElement> getChildren() {
+ return children;
+ }
+
+ /**
+ *
+ * @param filesThatMayExistOnly only include files that may exist
+ * @return list of children of the node
+ */
+ public Set<DebugSourcesTreeElement> getChildren(boolean filesThatMayExistOnly) {
+ if (filesThatMayExistOnly) {
+ return children.stream().filter(c -> c.getExists() != FileExist.NO).collect(Collectors.toSet());
+ } else {
+ return children;
+ }
+ }
+
+ /**
+ *
+ * @return true if node has children, false otherwise
+ */
+ public boolean hasChildren() {
+ if (children != null && children.size() > 0)
+ return true;
+ return false;
+ }
+
+ /**
+ *
+ * @return name of the file or folder segment
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ *
+ * @return full path to file (or null if not a file)
+ */
+ public String getFullPath() {
+ return fullPath;
+ }
+
+ /**
+ * Return true for leaf data that really exists on disk.
+ *
+ * This can be used to display differently.
+ */
+ public FileExist getExists() {
+ return exists;
+ }
+
+ /**
+ *
+ * @return node parent
+ */
+ public DebugSourcesTreeElement getParent() {
+ return parent;
+ }
+
+ /**
+ * Set parent of node
+ *
+ * @param parent
+ */
+ public void setParent(DebugSourcesTreeElement parent) {
+ this.parent = parent;
+ }
+
+ public void setExist(FileExist exists) {
+ this.exists = exists;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toString(getName());
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((exists == null) ? 0 : exists.hashCode());
+ result = prime * result + ((fullPath == null) ? 0 : fullPath.hashCode());
+ result = prime * result + ((parent == null) ? 0 : parent.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DebugSourcesTreeElement other = (DebugSourcesTreeElement) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (exists != other.exists)
+ return false;
+ if (fullPath == null) {
+ if (other.fullPath != null)
+ return false;
+ } else if (!fullPath.equals(other.fullPath))
+ return false;
+ if (parent == null) {
+ if (other.parent != null)
+ return false;
+ } else if (!parent.equals(other.parent))
+ return false;
+ return true;
+ }
+
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesView.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesView.java
new file mode 100644
index 0000000000..4a76461cb9
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesView.java
@@ -0,0 +1,736 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Tracy Miranda / Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Objects;
+import java.util.Set;
+
+import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceNotFoundElement;
+import org.eclipse.cdt.debug.internal.core.sourcelookup.ICSourceNotFoundDescription;
+import org.eclipse.cdt.debug.internal.ui.sourcelookup.CSourceNotFoundEditorInput;
+import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
+import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
+import org.eclipse.cdt.dsf.datamodel.DMContexts;
+import org.eclipse.cdt.dsf.datamodel.IDMContext;
+import org.eclipse.cdt.dsf.debug.service.ICachingService;
+import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
+import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesTreeElement.FileExist;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesCollapseAction;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesExpandAction;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesFlattendedTree;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesNormalTree;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions.DebugSourcesShowExistingFilesOnly;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles.IDebugSourceFileInfo;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles.IDebugSourceFilesChangedEvent;
+import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
+import org.eclipse.cdt.dsf.service.DsfServicesTracker;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.contexts.DebugContextEvent;
+import org.eclipse.debug.ui.contexts.IDebugContextListener;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.ide.FileStoreEditorInput;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.ViewPart;
+
+@SuppressWarnings("restriction")
+public class DebugSourcesView extends ViewPart implements IDebugContextListener {
+
+ public static final String ID = "org.eclipse.cdt.dsf.gdb.ui.debugsources.view"; //$NON-NLS-1$
+ private static final String KEY_FLATTEN_FOLDERS_WITH_NO_FILES = "KEY_FLATTEN_FOLDERS_WITH_NO_FILES"; //$NON-NLS-1$
+ private static final String KEY_SHOW_EXISTING_FILES_ONLY = "KEY_SHOW_EXISTING_FILES_ONLY"; //$NON-NLS-1$
+
+ private DsfSession fSession;
+ private TreeViewer viewer;
+ private DebugSourcesViewComparator<DebugSourcesTreeElement> comparator;
+ private IContainerDMContext dmcontext;
+ private DebugSourcesTreeElement debugTree;
+ private IMemento fMemento;
+
+ public DebugSourcesView() {
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ final DebugPatternFilter filter = new DebugPatternFilter();
+
+ int treeStyle = SWT.MULTI | SWT.FULL_SELECTION | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
+ FilteredTree tree = new FilteredTree(composite, treeStyle, filter, true, true);
+ tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ tree.getFilterControl().setToolTipText(DebugSourcesMessages.DebugSourcesMessages_filter_search_tooltip);
+ viewer = tree.getViewer();
+ viewer.getTree().setLinesVisible(true);
+ viewer.getTree().setHeaderVisible(true);
+ viewer.setContentProvider(new DebugSourcesTreeContentProvider());
+ viewer.setUseHashlookup(true);
+
+ comparator = new DebugSourcesViewComparator<>();
+
+ createColumns(viewer);
+
+ loadState();
+
+ viewer.setComparator(comparator);
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ IStructuredSelection thisSelection = (IStructuredSelection) event.getSelection();
+ Object selectedNode = thisSelection.getFirstElement();
+ if (selectedNode instanceof DebugSourcesTreeElement) {
+ DebugSourcesTreeElement node = (DebugSourcesTreeElement) selectedNode;
+ // only leafs can be opened!
+ if (!node.hasChildren()) {
+ openSourceFile(node.getFullPath());
+ }
+ }
+ }
+ });
+
+ createActions(viewer);
+
+ registerForEvents();
+ DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow())
+ .addDebugContextListener(this);
+
+ }
+
+ @Override
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ fMemento = memento;
+ super.init(site, memento);
+ }
+
+ public void loadState() {
+ boolean flattenFoldersWithNoFiles = true;
+ boolean showExistingFilesOnly = true;
+
+ if (fMemento != null) {
+ Boolean b = fMemento.getBoolean(KEY_FLATTEN_FOLDERS_WITH_NO_FILES);
+ if (b != null) {
+ flattenFoldersWithNoFiles = b;
+ }
+ b = fMemento.getBoolean(KEY_SHOW_EXISTING_FILES_ONLY);
+ if (b != null) {
+ showExistingFilesOnly = b;
+ }
+ }
+
+ if (viewer != null) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+
+ contentProvider.setFlattenFoldersWithNoFiles(flattenFoldersWithNoFiles);
+ contentProvider.setShowExistingFilesOnly(showExistingFilesOnly);
+ for (int i = 0; i < viewer.getTree().getColumnCount(); i++) {
+ DebugSourcesLabelProvider labelProvider = (DebugSourcesLabelProvider) viewer.getLabelProvider(i);
+ labelProvider.setFlattenFoldersWithNoFiles(flattenFoldersWithNoFiles);
+ labelProvider.setShowExistingFilesOnly(showExistingFilesOnly);
+ }
+
+ }
+ }
+
+ @Override
+ public void saveState(IMemento memento) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer.getContentProvider();
+ memento.putBoolean(KEY_FLATTEN_FOLDERS_WITH_NO_FILES, contentProvider.isFlattenFoldersWithNoFiles());
+ memento.putBoolean(KEY_SHOW_EXISTING_FILES_ONLY, contentProvider.isShowExistingFilesOnly());
+ super.saveState(memento);
+ }
+
+ private void createColumns(TreeViewer viewer) {
+ String[] titles = { DebugSourcesMessages.DebugSourcesMessages_name_column,
+ DebugSourcesMessages.DebugSourcesMessages_path_column };
+ String[] tooltips = { DebugSourcesMessages.DebugSourcesMessages_sort_name_column_tooltip,
+ DebugSourcesMessages.DebugSourcesMessages_sort_path_column_tooltip };
+ int[] bounds = { 300, 800 };
+ ColumnViewerToolTipSupport.enableFor(viewer);
+
+ for (int i = 0; i < titles.length; i++) {
+ TreeViewerColumn tc = createTreeViewerColumn(viewer, titles[i], bounds[i], i);
+ tc.getColumn().setToolTipText(tooltips[i]);
+ tc.setLabelProvider(new DebugSourcesLabelProvider(i));
+ }
+ }
+
+ private TreeViewerColumn createTreeViewerColumn(TreeViewer viewer, String title, int bound, final int colNumber) {
+ final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
+ final TreeColumn column = viewerColumn.getColumn();
+ column.setText(title);
+ column.setWidth(bound);
+ column.setResizable(true);
+ column.setMoveable(true);
+ if (colNumber == 0)
+ comparator.setColumn(e -> e.getName(), colNumber);
+ if (colNumber == 1)
+ comparator.setColumn(e -> e.getFullPath() != null ? e.getFullPath() : e.getName(), colNumber);
+
+ column.addSelectionListener(getSelectionAdapter(column, colNumber));
+ return viewerColumn;
+ }
+
+ private SelectionAdapter getSelectionAdapter(final TreeColumn column, final int index) {
+ SelectionAdapter selectionAdapter = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (index == 0)
+ comparator.setColumn(e1 -> e1.getName(), index);
+ if (index == 1)
+ comparator.setColumn(e1 -> e1.getFullPath() != null ? e1.getFullPath() : e1.getName(), index);
+ int dir = comparator.getDirection();
+ viewer.getTree().setSortDirection(dir);
+ viewer.getTree().setSortColumn(column);
+ viewer.refresh();
+ // This is due to the tree collapsing to level 2 at every comparison
+ viewer.expandAll();
+ }
+ };
+ return selectionAdapter;
+ }
+
+ private void createActions(TreeViewer viewer) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ IToolBarManager toolBar = actionBars.getToolBarManager();
+ toolBar.add(new DebugSourcesExpandAction(viewer));
+ toolBar.add(new DebugSourcesCollapseAction(viewer));
+ toolBar.add(new DebugSourcesFlattendedTree(viewer));
+ toolBar.add(new DebugSourcesNormalTree(viewer));
+ toolBar.add(new DebugSourcesShowExistingFilesOnly(viewer));
+ }
+
+ private DsfSession getSession() {
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ return null;
+ }
+
+ // Get the debug selection to know what the user is looking at in the Debug view
+ IAdaptable context = DebugUITools.getDebugContext();
+ if (context == null) {
+ return null;
+ }
+
+ // Extract the data model context to use with the DSF services
+ IDMContext dmcontext = context.getAdapter(IDMContext.class);
+ if (dmcontext == null) {
+ // Not dealing with a DSF session
+ return null;
+ }
+
+ // Extract DSF session id from the DM context
+ String sessionId = dmcontext.getSessionId();
+ // Get the full DSF session to have access to the DSF executor
+ DsfSession session = DsfSession.getSession(sessionId);
+ if (session == null) {
+ // It could be that this session is no longer active
+ return null;
+ }
+
+ if (!session.isActive() || session.getExecutor().isShutdown()) {
+ return null;
+ }
+
+ return session;
+ }
+
+ private void asyncExecRegisterForEvents() {
+ if (getSite() == null || getSite().getShell() == null || getSite().getShell().getDisplay() == null
+ || getSite().getShell().getDisplay().isDisposed()) {
+ return;
+ }
+ getSite().getShell().getDisplay().asyncExec(this::registerForEvents);
+ }
+
+ private void registerForEvents() {
+ DsfSession session = getSession();
+ if (session == null) {
+ return;
+ }
+
+ // Get the debug selection to know what the user is looking at in the Debug view
+ IAdaptable context = DebugUITools.getDebugContext();
+ if (context == null) {
+ return;
+ }
+
+ // Extract the data model context to use with the DSF services
+ IDMContext dmcontext = context.getAdapter(IDMContext.class);
+ if (dmcontext == null) {
+ // Not dealing with a DSF session
+ return;
+ }
+
+ registerForEvents(session);
+
+ // Show the current frame if there is one
+ displaySourceFiles(session, dmcontext);
+ }
+
+ @Override
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ viewer.getControl().dispose();
+ DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow())
+ .removeDebugContextListener(this);
+ if (fSession != null) {
+ DsfSession lastSession = fSession;
+ if (!lastSession.getExecutor().isShutdown()) {
+ lastSession.getExecutor().submit(new DsfRunnable() {
+ @Override
+ public void run() {
+ lastSession.removeServiceEventListener(DebugSourcesView.this);
+ }
+ });
+ }
+ }
+ }
+
+ /**
+ * This method registers with the specified session to receive DSF events.
+ *
+ * @param session
+ * The session for which we want to receive events
+ */
+ private void registerForEvents(DsfSession session) {
+ if (session != null) {
+ if (fSession != session) {
+ if (fSession != null) {
+ DsfSession lastSession = fSession;
+ if (!lastSession.getExecutor().isShutdown()) {
+ lastSession.getExecutor().submit(new DsfRunnable() {
+ @Override
+ public void run() {
+ lastSession.removeServiceEventListener(DebugSourcesView.this);
+ }
+ });
+ }
+ }
+ fSession = session;
+ fSession.getExecutor().submit(new DsfRunnable() {
+
+ @Override
+ public void run() {
+ fSession.addServiceEventListener(DebugSourcesView.this, null);
+ }
+
+ });
+ }
+ }
+ }
+
+ private void displaySourceFiles(DsfSession session, IDMContext dmcontext) {
+ if (session.getExecutor().isShutdown()) {
+ // can't do anything
+ return;
+ }
+
+ IContainerDMContext containerDMContext = DMContexts.getAncestorOfType(dmcontext, IContainerDMContext.class);
+ if (containerDMContext == null || Objects.equals(containerDMContext, this.dmcontext)) {
+ return;
+ }
+ this.dmcontext = containerDMContext;
+ session.getExecutor().submit(new DsfRunnable() {
+ @Override
+ public void run() {
+ DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
+ IDebugSourceFiles srcService = tracker.getService(IDebugSourceFiles.class);
+ // Don't forgot to dispose of a tracker before it goes out of scope
+ tracker.dispose();
+
+ if (srcService == null) {
+ // service not available. The debug session
+ // is probably terminating.
+ return;
+ }
+
+ // Get the full DSF session to have access to the DSF executor
+ srcService.getSources(containerDMContext,
+ new DataRequestMonitor<IDebugSourceFileInfo[]>(session.getExecutor(), null) {
+ @Override
+ protected void handleSuccess() {
+ // The service called 'handleSuccess()' so we know there is no error.
+ IDebugSourceFileInfo[] srcFileInfo = getData();
+ // We have a frame context. It is just a 'pointer' though.
+ // We need to get the data associated with it.
+ // Populate the tree synchronously
+ PopulateTreeJob populateTreeJob = new PopulateTreeJob(srcFileInfo);
+ CheckFileExistenceJob checkFileExistenceJob = new CheckFileExistenceJob();
+
+ populateTreeJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ debugTree = populateTreeJob.getTree();
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!viewer.getControl().isDisposed()) {
+ viewer.setInput(debugTree);
+ }
+ }
+ });
+ if (checkFileExistenceJob.getState() == Job.RUNNING)
+ checkFileExistenceJob.cancel();
+ checkFileExistenceJob.schedule();
+ }
+ });
+ checkFileExistenceJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!viewer.getControl().isDisposed()) {
+ viewer.refresh();
+ }
+ }
+ });
+ }
+ });
+ // return all populate and file check jobs already running and cancel them.
+ IJobManager jobMan = Job.getJobManager();
+ Job[] populateJobS = jobMan.find(POPULATE_FAMILY);
+ for (Job job : populateJobS) {
+ job.cancel();
+ }
+ Job[] fileCheckJobS = jobMan.find(FILECHECK_FAMILY);
+ for (Job job : fileCheckJobS) {
+ job.cancel();
+ }
+ populateTreeJob.schedule();
+ }
+
+ @Override
+ protected void handleError() {
+ // Ignore errors when we select elements
+ // that don't contain frames
+ }
+ });
+ }
+ });
+ }
+
+ // This method must be public for the DSF callback to be found
+ @DsfServiceEventHandler
+ public void eventReceived(ISuspendedDMEvent event) {
+ asyncExecRegisterForEvents();
+ }
+
+ // This method must be public for the DSF callback to be found
+ @DsfServiceEventHandler
+ public void eventReceived(IDebugSourceFilesChangedEvent event) {
+ asyncExecRegisterForEvents();
+ }
+
+ public boolean canRefresh() {
+ return getSession() != null;
+ }
+
+ public void refresh() {
+ this.dmcontext = null; // force the refresh
+ DsfSession session = getSession();
+ if (session == null) {
+ return;
+ }
+ session.getExecutor().submit(new DsfRunnable() {
+
+ @Override
+ public void run() {
+ DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
+ IDebugSourceFiles srcService = tracker.getService(IDebugSourceFiles.class);
+ // Don't forgot to dispose of a tracker before it goes out of scope
+ tracker.dispose();
+
+ if (srcService instanceof ICachingService) {
+ ICachingService cache = (ICachingService) srcService;
+ cache.flushCache(dmcontext);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
+ if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
+ registerForEvents();
+ }
+ }
+
+ private void openSourceFile(String fullPath) {
+ if (fullPath == null) {
+ return;
+ }
+ Path path = Paths.get(fullPath);
+ boolean exists = Files.exists(path);
+ IEditorInput editorInput = null;
+ String editorId = null;
+ if (exists) {
+ try {
+ URI uriLocation = path.toUri();
+ IFileStore fileStore = EFS.getStore(uriLocation);
+ editorInput = new FileStoreEditorInput(fileStore);
+ editorId = IDE.getEditorDescriptorForFileStore(fileStore, false).getId();
+ } catch (CoreException e1) {
+ CSourceNotFoundElement element = new CSourceNotFoundElement(new TempElement(), null, fullPath);
+ editorInput = new CSourceNotFoundEditorInput(element);
+ editorId = ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID;
+ }
+ } else {
+ CSourceNotFoundElement element = new CSourceNotFoundElement(new TempElement(), null, fullPath);
+ editorInput = new CSourceNotFoundEditorInput(element);
+ editorId = ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID;
+ }
+ IWorkbenchPage page = CUIPlugin.getActivePage();
+ try {
+ page.openEditor(editorInput, editorId);
+ } catch (PartInitException e) {
+ GdbUIPlugin.log(e);
+ }
+ }
+
+ private class TempElement implements IAdaptable, ICSourceNotFoundDescription {
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
+ if (adapter == ICSourceNotFoundDescription.class)
+ return (T) this;
+ return null;
+ }
+
+ @Override
+ public String getDescription() {
+ return DebugSourcesMessages.DebugSourcesMessages_unknown;
+ }
+
+ @Override
+ public boolean isAddressOnly() {
+ return false;
+ }
+ }
+
+ class DebugPatternFilter extends PatternFilter {
+
+ @Override
+ protected boolean isLeafMatch(Viewer viewer, Object element) {
+ String name = ((DebugSourcesTreeElement) element).getName();
+ String path = ((DebugSourcesTreeElement) element).getFullPath();
+ return wordMatches(path) || wordMatches(name);
+ }
+ }
+
+ private static final String POPULATE_FAMILY = "populateJobFamily"; //$NON-NLS-1$
+ private static final String FILECHECK_FAMILY = "fileCheckJobFamily"; //$NON-NLS-1$
+
+ /**
+ * Job used to populate the tree
+ *
+ */
+ class PopulateTreeJob extends Job {
+
+ private IDebugSourceFileInfo[] srcFileInfo;
+ private DebugSourcesTreeElement populateTree;
+
+ public PopulateTreeJob(IDebugSourceFileInfo[] srcFileInfo) {
+ super("Populate Tree Job"); //$NON-NLS-1$
+ this.srcFileInfo = srcFileInfo;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (srcFileInfo == null)
+ return Status.CANCEL_STATUS;
+ populateTree = populateTree(srcFileInfo, monitor);
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return POPULATE_FAMILY.equals(family);
+ }
+
+ public DebugSourcesTreeElement getTree() {
+ return populateTree;
+ }
+
+ private DebugSourcesTreeElement populateTree(IDebugSourceFileInfo[] srcFileInfo, IProgressMonitor monitor) {
+ DebugSourcesTreeElement debugTree = new DebugSourcesTreeElement("", FileExist.UNKNOWN); //$NON-NLS-1$
+ DebugSourcesTreeElement current = debugTree;
+ for (int i = 0; i < srcFileInfo.length; i++) {
+ DebugSourcesTreeElement root = current;
+ DebugSourcesTreeElement parent = root;
+ String path = srcFileInfo[i].getPath();
+ if (path == null) {
+ continue;
+ }
+ // Use Path API to clean the path
+ try {
+ Path p = Paths.get(path);
+ Path filename = p.getFileName();
+ // add root
+ Path pRoot = p.getRoot();
+ if (pRoot == null || !p.isAbsolute()) {
+ current = current.addLeaf(DebugSourcesMessages.DebugSourcesView_unrooted, p.toString(),
+ FileExist.UNKNOWN);
+ } else if (pRoot.equals(filename)) {
+ current = current.addLeaf(srcFileInfo[i].getName(), p.toString(), FileExist.UNKNOWN);
+ } else {
+ current = current.addNode(pRoot.toString(), FileExist.UNKNOWN);
+ }
+ parent = current;
+ // Add each sub-path
+ Path normalizedPath = p.normalize();
+ for (Path subpath : normalizedPath) {
+ if (subpath.equals(filename)) { // this is a leaf
+ current = current.addLeaf(srcFileInfo[i].getName(), p.toString(), FileExist.UNKNOWN);
+ } else {
+ current = current.addNode(subpath.toString(), FileExist.UNKNOWN);
+ }
+ current.setParent(parent);
+ parent = current;
+ }
+ current = root;
+ parent = root;
+ } catch (InvalidPathException e) {
+ GdbUIPlugin.log(e);
+ }
+ if (monitor != null && monitor.isCanceled()) {
+ return current;
+ }
+ }
+ return current;
+ }
+ }
+
+ /**
+ * Job used to check the existence of a file, updates the tree accordingly
+ *
+ */
+ class CheckFileExistenceJob extends Job {
+
+ public CheckFileExistenceJob() {
+ super("Checking file existence"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ DebugSourcesTreeElement tmpTree = debugTree;
+ traverseDebugTree(tmpTree, monitor);
+ debugTree = tmpTree;
+ if (monitor != null && monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ } catch (Exception e) {
+ GdbUIPlugin.log(e);
+ }
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return FILECHECK_FAMILY.equals(family);
+ }
+
+ /**
+ * Sets the file exist field of a leaf node
+ *
+ * @param child
+ * @param monitor
+ */
+ private void traverseDebugTree(DebugSourcesTreeElement child, IProgressMonitor monitor) {
+ Set<DebugSourcesTreeElement> children = child.getChildren();
+ for (DebugSourcesTreeElement each : children) {
+ String path = each.getFullPath();
+ if (path != null) {
+ Path p = Paths.get(path);
+ boolean exists = Files.exists(p);
+ each.setExist(exists ? FileExist.YES : FileExist.NO);
+ // if leaf, and it exists, we need to make the parent nodes exist too
+ if (!each.hasChildren() && exists) {
+ traverseParent(each);
+ }
+ }
+ if (monitor != null && monitor.isCanceled())
+ return;
+
+ traverseDebugTree(each, monitor);
+ }
+ if (child.getExists() == FileExist.UNKNOWN) {
+ child.setExist(FileExist.NO);
+ }
+ }
+
+ private void traverseParent(DebugSourcesTreeElement node) {
+ DebugSourcesTreeElement parent = node.getParent();
+ if (parent.getExists() != FileExist.YES) {
+ parent.setExist(FileExist.YES);
+ if (parent.getParent() != null) {
+ traverseParent(parent);
+ }
+ }
+ }
+ }
+
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesViewComparator.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesViewComparator.java
new file mode 100644
index 0000000000..b15e836b71
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/DebugSourcesViewComparator.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+import java.util.function.Function;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+
+/**
+ * Comparator used for the Debug Sources Table viewer
+ *
+ */
+public class DebugSourcesViewComparator<T> extends ViewerComparator {
+
+ private Function<T, Comparable<?>> func;
+
+ private int propertyIndex;
+
+ private enum Direction {
+ ASCENDING, DESCENDING;
+
+ /**
+ *
+ * @param direction the previous direction
+ * @return the new direction
+ */
+ public static Direction toggle(Direction direction) {
+ return direction == ASCENDING ? DESCENDING : ASCENDING;
+ }
+ }
+
+ private Direction direction = Direction.DESCENDING;
+
+ public DebugSourcesViewComparator(Function<T, Comparable<?>> func) {
+ this.func = func;
+ }
+
+ public DebugSourcesViewComparator() {
+ this.propertyIndex = 0;
+ direction = Direction.DESCENDING;
+ }
+
+ public int getDirection() {
+ return direction == Direction.DESCENDING ? SWT.DOWN : SWT.UP;
+ }
+
+ public void setColumn(Function<T, Comparable<?>> column, int idx) {
+ this.func = column;
+ if (idx == this.propertyIndex) {
+ // Same column as last sort; toggle the direction
+ direction = Direction.toggle(direction);
+ } else {
+ // New column
+ this.propertyIndex = idx;
+ direction = Direction.DESCENDING;
+ }
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ Comparable s1 = func.apply((T) e1);
+ Comparable s2 = func.apply((T) e2);
+ int rc = s1.compareTo(s2);
+ // If descending order, flip the direction
+ if (direction.equals(Direction.DESCENDING)) {
+ rc = -rc;
+ }
+ return rc;
+ }
+
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/IDebugSourcesImagesConst.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/IDebugSourcesImagesConst.java
new file mode 100644
index 0000000000..bcd29f864e
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/IDebugSourcesImagesConst.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2919 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources;
+
+/**
+ *
+ */
+public interface IDebugSourcesImagesConst {
+
+ public static final String IMG_COLLAPSE_DEBUG_SOURCES = "icons/full/elcl16/collapse_all.gif"; //$NON-NLS-1$
+
+ public static final String IMG_EXPAND_DEBUG_SOURCES = "icons/full/elcl16/expand_all.gif"; //$NON-NLS-1$
+
+ public static final String IMG_FLAT_LAYOUT = "icons/full/elcl16/flatLayout.png"; //$NON-NLS-1$
+
+ public static final String IMG_NORMAL_LAYOUT = "icons/full/elcl16/hierarchicalLayout.png"; //$NON-NLS-1$
+
+ public static final String IMG_SHOW_EXISTING_FILES_ONLY = "icons/full/elcl16/existingFiles.gif"; //$NON-NLS-1$
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesCollapseAction.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesCollapseAction.java
new file mode 100644
index 0000000000..77a0c16617
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesCollapseAction.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesMessages;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.IDebugSourcesImagesConst;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceLocator;
+import org.eclipse.jface.viewers.TreeViewer;
+
+/**
+ * Action to collapse of the nodes of the Debug Sources tree
+ */
+public class DebugSourcesCollapseAction extends Action {
+
+ private final TreeViewer viewer;
+
+ public DebugSourcesCollapseAction(TreeViewer viewer) {
+ super();
+ this.viewer = viewer;
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ setEnabled(false);
+ }
+ setText(DebugSourcesMessages.DebugSourcesCollapseAction_name);
+ setToolTipText(DebugSourcesMessages.DebugSourcesCollapseAction_description);
+ Optional<ImageDescriptor> descriptor = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID,
+ IDebugSourcesImagesConst.IMG_COLLAPSE_DEBUG_SOURCES);
+ descriptor.ifPresent(this::setImageDescriptor);
+ }
+
+ @Override
+ public void run() {
+ if (viewer != null) {
+ viewer.collapseAll();
+ }
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesExpandAction.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesExpandAction.java
new file mode 100644
index 0000000000..d02a1f9590
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesExpandAction.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Baha El-Kassaby - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesMessages;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.IDebugSourcesImagesConst;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceLocator;
+import org.eclipse.jface.viewers.TreeViewer;
+
+/**
+ * Action to Expand all the nodes of the Debug Sources tree
+ */
+public class DebugSourcesExpandAction extends Action {
+
+ private final TreeViewer viewer;
+
+ public DebugSourcesExpandAction(TreeViewer viewer) {
+ this.viewer = viewer;
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ setEnabled(false);
+ }
+ setText(DebugSourcesMessages.DebugSourcesExpandAction_name);
+ setToolTipText(DebugSourcesMessages.DebugSourcesExpandAction_description);
+ Optional<ImageDescriptor> descriptor = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID,
+ IDebugSourcesImagesConst.IMG_EXPAND_DEBUG_SOURCES);
+ descriptor.ifPresent(this::setImageDescriptor);
+ }
+
+ @Override
+ public void run() {
+ if (viewer != null) {
+ viewer.expandAll();
+ }
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesFlattendedTree.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesFlattendedTree.java
new file mode 100644
index 0000000000..efced7519f
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesFlattendedTree.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham- Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesLabelProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesMessages;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesTreeContentProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.IDebugSourcesImagesConst;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceLocator;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class DebugSourcesFlattendedTree extends Action {
+ private final TreeViewer viewer;
+
+ public DebugSourcesFlattendedTree(TreeViewer viewer) {
+ super(null, IAction.AS_RADIO_BUTTON);
+ this.viewer = viewer;
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ setEnabled(false);
+ }
+ setText(DebugSourcesMessages.DebugSourcesFlattendedTree_name);
+ setToolTipText(DebugSourcesMessages.DebugSourcesFlattendedTree_description);
+ Optional<ImageDescriptor> descriptor = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID,
+ IDebugSourcesImagesConst.IMG_FLAT_LAYOUT);
+ descriptor.ifPresent(this::setImageDescriptor);
+ if (viewer != null) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+ setChecked(contentProvider.isFlattenFoldersWithNoFiles());
+ }
+ }
+
+ @Override
+ public void run() {
+ if (isChecked()) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+ contentProvider.setFlattenFoldersWithNoFiles(true);
+ for (int i = 0; i < viewer.getTree().getColumnCount(); i++) {
+ DebugSourcesLabelProvider labelProvider = (DebugSourcesLabelProvider) viewer.getLabelProvider(i);
+ labelProvider.setFlattenFoldersWithNoFiles(true);
+ }
+ viewer.refresh(true);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesNormalTree.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesNormalTree.java
new file mode 100644
index 0000000000..3ec7609394
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesNormalTree.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham- Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesLabelProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesMessages;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesTreeContentProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.IDebugSourcesImagesConst;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceLocator;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class DebugSourcesNormalTree extends Action {
+ private final TreeViewer viewer;
+
+ public DebugSourcesNormalTree(TreeViewer viewer) {
+ super(null, IAction.AS_RADIO_BUTTON);
+ this.viewer = viewer;
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ setEnabled(false);
+ }
+ setText(DebugSourcesMessages.DebugSourcesNormalTree_name);
+ setToolTipText(DebugSourcesMessages.DebugSourcesNormalTree_description);
+ Optional<ImageDescriptor> descriptor = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID,
+ IDebugSourcesImagesConst.IMG_NORMAL_LAYOUT);
+ descriptor.ifPresent(this::setImageDescriptor);
+ if (viewer != null) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+ setChecked(!contentProvider.isFlattenFoldersWithNoFiles());
+ }
+ }
+
+ @Override
+ public void run() {
+ if (isChecked()) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+ contentProvider.setFlattenFoldersWithNoFiles(false);
+ for (int i = 0; i < viewer.getTree().getColumnCount(); i++) {
+ DebugSourcesLabelProvider labelProvider = (DebugSourcesLabelProvider) viewer.getLabelProvider(i);
+ labelProvider.setFlattenFoldersWithNoFiles(false);
+ }
+ viewer.refresh(true);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesShowExistingFilesOnly.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesShowExistingFilesOnly.java
new file mode 100644
index 0000000000..5501325cc3
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesShowExistingFilesOnly.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham- Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesLabelProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesMessages;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesTreeContentProvider;
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.IDebugSourcesImagesConst;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceLocator;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class DebugSourcesShowExistingFilesOnly extends Action {
+ private final TreeViewer viewer;
+
+ public DebugSourcesShowExistingFilesOnly(TreeViewer viewer) {
+ super(null, IAction.AS_CHECK_BOX);
+ this.viewer = viewer;
+ if (viewer == null || viewer.getControl().isDisposed()) {
+ setEnabled(false);
+ }
+ setText(DebugSourcesMessages.DebugSourcesShowExistingFilesOnly_name);
+ setToolTipText(DebugSourcesMessages.DebugSourcesShowExistingFilesOnly_description);
+ Optional<ImageDescriptor> descriptor = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID,
+ IDebugSourcesImagesConst.IMG_SHOW_EXISTING_FILES_ONLY);
+ descriptor.ifPresent(this::setImageDescriptor);
+ if (viewer != null) {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer
+ .getContentProvider();
+ setChecked(contentProvider.isShowExistingFilesOnly());
+ }
+ }
+
+ @Override
+ public void run() {
+ DebugSourcesTreeContentProvider contentProvider = (DebugSourcesTreeContentProvider) viewer.getContentProvider();
+ boolean showExistingFilesOnly = contentProvider.isShowExistingFilesOnly();
+ showExistingFilesOnly = !showExistingFilesOnly;
+ contentProvider.setShowExistingFilesOnly(showExistingFilesOnly);
+
+ for (int i = 0; i < viewer.getTree().getColumnCount(); i++) {
+ DebugSourcesLabelProvider labelProvider = (DebugSourcesLabelProvider) viewer.getLabelProvider(i);
+ labelProvider.setShowExistingFilesOnly(showExistingFilesOnly);
+ }
+
+ setChecked(showExistingFilesOnly);
+ viewer.refresh(true);
+ }
+
+} \ No newline at end of file
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesViewRefresh.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesViewRefresh.java
new file mode 100644
index 0000000000..4fe1396877
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/debugsources/actions/DebugSourcesViewRefresh.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham- Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.actions;
+
+import org.eclipse.cdt.dsf.gdb.internal.ui.debugsources.DebugSourcesView;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.contexts.DebugContextEvent;
+import org.eclipse.debug.ui.contexts.IDebugContextListener;
+import org.eclipse.debug.ui.contexts.IDebugContextService;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+public class DebugSourcesViewRefresh implements IViewActionDelegate, IDebugContextListener, IActionDelegate2 {
+
+ private IViewPart view;
+ private IAction action;
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.action = action;
+ updateEnablement();
+ }
+
+ @Override
+ public void init(IViewPart view) {
+ this.view = view;
+ if (view != null) {
+ IDebugContextService debugContextService = DebugUITools.getDebugContextManager()
+ .getContextService(view.getSite().getWorkbenchWindow());
+ debugContextService.addPostDebugContextListener(this);
+ }
+ updateEnablement();
+ }
+
+ private void updateEnablement() {
+ if (view instanceof DebugSourcesView) {
+ DebugSourcesView debugSourcesView = (DebugSourcesView) view;
+ action.setEnabled(debugSourcesView.canRefresh());
+ } else {
+ action.setEnabled(false);
+ }
+ }
+
+ @Override
+ public void init(IAction action) {
+ this.action = action;
+ updateEnablement();
+ }
+
+ @Override
+ public void dispose() {
+ if (view != null) {
+ DebugUITools.getDebugContextManager().getContextService(view.getSite().getWorkbenchWindow())
+ .removePostDebugContextListener(this);
+ view = null;
+ }
+ updateEnablement();
+ }
+
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
+ updateEnablement();
+ }
+
+ @Override
+ public void run(IAction action) {
+ throw new UnsupportedOperationException("call runWithEvent instead"); //$NON-NLS-1$
+ }
+
+ @Override
+ public void runWithEvent(IAction action, Event event) {
+ if (view instanceof DebugSourcesView) {
+ DebugSourcesView debugSourcesView = (DebugSourcesView) view;
+ debugSourcesView.refresh();
+ }
+ }
+
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
index f040489bed..9d97873b2b 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
-Bundle-Version: 5.7.300.qualifier
+Bundle-Version: 5.8.0.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBSourceLookup.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBSourceLookup.java
index 3a292ea795..739f4e9f1e 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBSourceLookup.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBSourceLookup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Kichwa Coders and others.
+ * Copyright (c) 2015, 2018 Kichwa Coders and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,6 +13,10 @@
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
@@ -24,13 +28,19 @@ import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
-import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
+import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent;
+import org.eclipse.cdt.dsf.datamodel.IDMContext;
+import org.eclipse.cdt.dsf.debug.service.ICachingService;
+import org.eclipse.cdt.dsf.debug.service.command.CommandCache;
+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.launching.GdbSourceLookupDirector;
import org.eclipse.cdt.dsf.mi.service.CSourceLookup;
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
+import org.eclipse.cdt.dsf.mi.service.command.output.MiSourceFilesInfo;
+import org.eclipse.cdt.dsf.mi.service.command.output.MiSourceFilesInfo.SourceFileInfo;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -40,9 +50,16 @@ import org.eclipse.core.runtime.Status;
*
* @since 5.0
*/
-public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
+public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup, IDebugSourceFiles, ICachingService {
- private ICommandControl fCommand;
+ private static class DebugSourceFilesChangedEvent extends AbstractDMEvent<IDMContext>
+ implements IDebugSourceFilesChangedEvent {
+ public DebugSourceFilesChangedEvent(IDMContext context) {
+ super(context);
+ }
+ }
+
+ private ICommandControlService fCommand;
private CommandFactory fCommandFactory;
private Map<ISourceLookupDMContext, CSourceLookupDirector> fDirectors = new HashMap<>();
/**
@@ -50,6 +67,8 @@ public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
*/
private Map<String, String> fCachedEntries = Collections.emptyMap();
+ private CommandCache fDebugSourceFilesCache;
+
public GDBSourceLookup(DsfSession session) {
super(session);
}
@@ -65,12 +84,14 @@ public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
}
private void doInitialize(RequestMonitor rm) {
- fCommand = getServicesTracker().getService(ICommandControl.class);
+ fCommand = getServicesTracker().getService(ICommandControlService.class);
fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory();
- register(new String[] { IGDBSourceLookup.class.getName(), GDBSourceLookup.class.getName() },
- new Hashtable<String, String>());
+ fDebugSourceFilesCache = new CommandCache(getSession(), fCommand);
+ fDebugSourceFilesCache.setContextAvailable(fCommand.getContext(), true);
+ register(new String[] { IGDBSourceLookup.class.getName(), GDBSourceLookup.class.getName(),
+ IDebugSourceFiles.class.getName() }, new Hashtable<String, String>());
rm.done();
}
@@ -120,10 +141,9 @@ public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
rm.done(false);
} else {
/*
- * Issue the clear and set commands back to back so that the
- * executor thread atomically changes the source lookup settings.
- * Any commands to GDB issued after this call will get the new
- * source substitute settings.
+ * Issue the clear and set commands back to back so that the executor thread
+ * atomically changes the source lookup settings. Any commands to GDB issued
+ * after this call will get the new source substitute settings.
*/
CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) {
@Override
@@ -143,14 +163,19 @@ public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
fCachedEntries = entries;
CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) {
@Override
- protected void handleFailure() {
- /*
- * We failed to apply the changes. Clear the cache as it does
- * not represent the state of the backend. However we don't have
- * a good recovery here, so on future sourceContainersChanged()
- * calls we will simply reissue the substitutions.
- */
- fCachedEntries = null;
+ protected void handleCompleted() {
+ // Reset the list of source files when source path substitutions change
+ fDebugSourceFilesCache.reset();
+ getSession().dispatchEvent(new DebugSourceFilesChangedEvent(sourceLookupCtx), getProperties());
+ if (!isSuccess()) {
+ /*
+ * We failed to apply the changes. Clear the cache as it does not represent the
+ * state of the backend. However we don't have a good recovery here, so on
+ * future sourceContainersChanged() calls we will simply reissue the
+ * substitutions.
+ */
+ fCachedEntries = null;
+ }
rm.done();
}
};
@@ -160,6 +185,100 @@ public class GDBSourceLookup extends CSourceLookup implements IGDBSourceLookup {
fCommandFactory.createMISetSubstitutePath(sourceLookupCtx, entry.getKey(), entry.getValue()),
new DataRequestMonitor<MIInfo>(getExecutor(), countingRm));
}
+
+ }
+
+ private static final class DebugSourceFileInfo implements IDebugSourceFileInfo {
+ private final SourceFileInfo miInfo;
+
+ private DebugSourceFileInfo(SourceFileInfo miInfo) {
+ if (miInfo == null)
+ throw new IllegalArgumentException("The SourceFileInfo provided is null"); //$NON-NLS-1$
+ this.miInfo = miInfo;
+ }
+
+ @Override
+ public String getName() {
+ // we get the file name without the path
+ String name = miInfo != null ? miInfo.getFile() : null;
+ if (name == null)
+ return name;
+ try {
+ Path p = Paths.get(name);
+ name = p.getFileName() != null ? p.getFileName().toString() : ""; //$NON-NLS-1$
+ } catch (InvalidPathException e) {
+ // do nothing
+ }
+ return name;
+ }
+
+ @Override
+ public String getPath() {
+ // we get the file name without the path
+ String path = miInfo != null ? miInfo.getFullName() : null;
+ if (path == null)
+ return path;
+ try {
+ Path p = Paths.get(path);
+ path = p.toString();
+ } catch (InvalidPathException e) {
+ // do nothing
+ }
+ return path;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((miInfo == null) ? 0 : miInfo.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DebugSourceFileInfo other = (DebugSourceFileInfo) obj;
+ if (miInfo == null) {
+ if (other.miInfo != null)
+ return false;
+ } else if (!miInfo.equals(other.miInfo))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "DebugSourceFileInfo [miInfo=" + miInfo + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}
+ @Override
+ public void getSources(final IDMContext dmc, final DataRequestMonitor<IDebugSourceFileInfo[]> rm) {
+ fDebugSourceFilesCache.execute(fCommandFactory.createMiFileListExecSourceFiles(dmc),
+ new DataRequestMonitor<MiSourceFilesInfo>(getExecutor(), rm) {
+ @Override
+ protected void handleSuccess() {
+ IDebugSourceFileInfo[] result = null;
+ MiSourceFilesInfo sourceFiles = getData();
+ SourceFileInfo[] info = sourceFiles.getSourceFiles();
+ result = Arrays.asList(info).stream().map(DebugSourceFileInfo::new)
+ .toArray(IDebugSourceFileInfo[]::new);
+ rm.setData(result);
+ rm.done();
+ }
+ });
+ }
+
+ @Override
+ public void flushCache(IDMContext context) {
+ fDebugSourceFilesCache.reset();
+ getSession().dispatchEvent(new DebugSourceFilesChangedEvent(fCommand.getContext()), getProperties());
+ }
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IDebugSourceFiles.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IDebugSourceFiles.java
new file mode 100644
index 0000000000..0bd066cc43
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IDebugSourceFiles.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham (Kichwa Coders) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.gdb.service;
+
+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
+import org.eclipse.cdt.dsf.datamodel.IDMContext;
+import org.eclipse.cdt.dsf.datamodel.IDMEvent;
+import org.eclipse.cdt.dsf.service.IDsfService;
+
+/**
+ * Provides the ability to obtain the list of source files for the given debug
+ * context. For GDB this is using the -file-list-exec-source-files command
+ *
+ * @since 5.8
+ */
+public interface IDebugSourceFiles extends IDsfService {
+
+ /**
+ * Data type for what is returned by
+ * {@link IDebugSourceFiles#getSources(IDMContext, DataRequestMonitor)}
+ */
+ public interface IDebugSourceFileInfo {
+
+ /**
+ * The name of the source file as it appears in the debug information. This may
+ * be relative, just the name, or absolute. Use {@link #getPath()} for the
+ * absolute path to the file name.
+ *
+ * @return name of the file
+ */
+ public String getName();
+
+ /**
+ * The absolute path of the the file.
+ *
+ * @return path to the file
+ */
+ public String getPath();
+ }
+
+ /**
+ * Event indicating that the list of the files may have changed for the given context.
+ */
+ public interface IDebugSourceFilesChangedEvent extends IDMEvent<IDMContext> {
+ }
+
+ /**
+ * Retrieves the list of sources data/files for the given context.
+ *
+ * @param context
+ * execution context
+ * @param rm
+ * Request completion monitor.
+ */
+ void getSources(IDMContext context, DataRequestMonitor<IDebugSourceFileInfo[]> rm);
+} \ No newline at end of file
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java
index a1aef54458..7e1287d02d 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java
@@ -120,6 +120,7 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecUncall;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecUntil;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIFileExecAndSymbols;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIFileExecFile;
+import org.eclipse.cdt.dsf.mi.service.command.commands.MIFileListExecSourceFiles;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIFileSymbolFile;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBExit;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSet;
@@ -254,6 +255,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIVarSetFormatInfo;
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarShowAttributesInfo;
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarShowFormatInfo;
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarUpdateInfo;
+import org.eclipse.cdt.dsf.mi.service.command.output.MiSourceFilesInfo;
/**
* Factory to create MI/CLI commands.
@@ -739,6 +741,11 @@ public class CommandFactory {
return new MIFileExecFile(dmc);
}
+ /** @since 5.8*/
+ public ICommand<MiSourceFilesInfo> createMiFileListExecSourceFiles(IDMContext ctx) {
+ return new MIFileListExecSourceFiles(ctx);
+ }
+
public ICommand<MIInfo> createMIFileSymbolFile(ICommandControlDMContext dmc, String file) {
return new MIFileSymbolFile(dmc, file);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIFileListExecSourceFiles.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIFileListExecSourceFiles.java
new file mode 100644
index 0000000000..c58b4e41e6
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIFileListExecSourceFiles.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham (Kichwa Coders) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.mi.service.command.commands;
+
+import org.eclipse.cdt.dsf.datamodel.IDMContext;
+import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput;
+import org.eclipse.cdt.dsf.mi.service.command.output.MiSourceFilesInfo;
+
+/**
+ *
+ * -file-list-exec-source-files
+ *
+ * Returns the list of source files for the current execution context. It
+ * outputs both filename and full (absolute path) file name of a source file.
+ *
+ * @since 5.8
+ */
+public class MIFileListExecSourceFiles extends MICommand<MiSourceFilesInfo> {
+
+ public MIFileListExecSourceFiles(IDMContext ctx) {
+ super(ctx, "-file-list-exec-source-files"); //$NON-NLS-1$
+ }
+
+ @Override
+ public MiSourceFilesInfo getResult(MIOutput out) {
+ return new MiSourceFilesInfo(out);
+ }
+} \ No newline at end of file
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MiSourceFilesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MiSourceFilesInfo.java
new file mode 100644
index 0000000000..f1441cfde0
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MiSourceFilesInfo.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 Kichwa Coders and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Jonah Graham (Kichwa Coders) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.dsf.mi.service.command.output;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Example output is:
+ *
+ * <pre>
+ * (gdb) -file-list-exec-source-files
+ * ^done,files=[{file=foo.c,fullname=/home/foo.c},
+ * {file=/home/bar.c,fullname=/home/bar.c},
+ * {file=gdb_could_not_find_fullpath.c}]
+ * </pre>
+ *
+ * @since 5.8
+ */
+public class MiSourceFilesInfo extends MIInfo {
+
+ private SourceFileInfo[] sourceFileInfos;
+
+ public MiSourceFilesInfo(MIOutput record) {
+ super(record);
+ parse();
+ if (sourceFileInfos == null) {
+ sourceFileInfos = new SourceFileInfo[0];
+ }
+ }
+
+ /**
+ * Returns array of source files infos
+ *
+ * @return
+ */
+ public SourceFileInfo[] getSourceFiles() {
+ return sourceFileInfos;
+ }
+
+ private void parse() {
+ if (isDone()) {
+ MIOutput out = getMIOutput();
+ MIResultRecord rr = out.getMIResultRecord();
+ if (rr != null) {
+ MIResult[] results = rr.getMIResults();
+ for (int i = 0; i < results.length; i++) {
+ String var = results[i].getVariable();
+ if (var.equals("files")) { //$NON-NLS-1$
+ MIValue value = results[i].getMIValue();
+ if (value instanceof MIList) {
+ parseResults((MIList) value);
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ private void parseResults(MIList list) {
+ MIValue[] miValues = list.getMIValues();
+ List<SourceFileInfo> infos = new LinkedList<>();
+ if (miValues != null) {
+ for (MIValue miValue : miValues) {
+ if (miValue instanceof MITuple) {
+ MITuple miTuple = (MITuple) miValue;
+ SourceFileInfo info = new SourceFileInfo();
+ info.parse(miTuple.getMIResults());
+ infos.add(info);
+ }
+ }
+ }
+ sourceFileInfos = infos.toArray(new SourceFileInfo[infos.size()]);
+ }
+
+ public static class SourceFileInfo {
+ private String file;
+ private String fullname;
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFullName(String fullname) {
+ this.fullname = fullname;
+ }
+
+ public String getFullName() {
+ return fullname;
+ }
+
+ private void parse(MIResult[] results) {
+ for (MIResult result : results) {
+ String variable = result.getVariable();
+ MIValue miVal = result.getMIValue();
+ if (!(miVal instanceof MIConst)) {
+ continue;
+ }
+ String value = ((MIConst) miVal).getCString();
+ switch (variable) {
+ case "file": //$NON-NLS-1$
+ file = value;
+ break;
+ case "fullname": //$NON-NLS-1$
+ fullname = value;
+ break;
+ }
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((file == null) ? 0 : file.hashCode());
+ result = prime * result + ((fullname == null) ? 0 : fullname.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SourceFileInfo other = (SourceFileInfo) obj;
+ if (file == null) {
+ if (other.file != null)
+ return false;
+ } else if (!file.equals(other.file))
+ return false;
+ if (fullname == null) {
+ if (other.fullname != null)
+ return false;
+ } else if (!fullname.equals(other.fullname))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "SourceFileInfo [file=" + file + ", fullname=" + fullname + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/feature.xml b/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/feature.xml
index 28e8cccdf7..f7984badbb 100644
--- a/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/feature.xml
+++ b/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.dsf"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/dsf-gdb/org.eclipse.cdt.gnu.multicorevisualizer-feature/feature.xml b/dsf-gdb/org.eclipse.cdt.gnu.multicorevisualizer-feature/feature.xml
index 6fe342dd08..8c9ff65d21 100644
--- a/dsf-gdb/org.eclipse.cdt.gnu.multicorevisualizer-feature/feature.xml
+++ b/dsf-gdb/org.eclipse.cdt.gnu.multicorevisualizer-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.multicorevisualizer"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml
index de9a2ff2bd..de93e28eac 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -59,7 +59,7 @@
<configuration>
<useUIHarness>false</useUIHarness>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier} -Dcdt.tests.dsf.gdb.versions=${cdt.tests.dsf.gdb.versions}</argLine>
- <appArgLine>-debug ./dsf.debug.options</appArgLine>
+ <appArgLine>-debug ./dsf.debug.options -pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<includes>
<include>**/${dsf.gdb.tests.gdbTestSuite}</include>
</includes>
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
index 0a97f39caf..43af9dbbc2 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2016 Ericsson and others.
+ * Copyright (c) 2007, 2018 Ericsson and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -67,6 +67,8 @@ import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
import org.eclipse.cdt.dsf.debug.service.IStack.IVariableDMContext;
import org.eclipse.cdt.dsf.debug.service.IStack.IVariableDMData;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles.IDebugSourceFileInfo;
import org.eclipse.cdt.dsf.gdb.service.IGDBMemory2;
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses;
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
@@ -107,6 +109,8 @@ public class SyncUtil {
private static ISourceLookup fSourceLookup;
+ private static IDebugSourceFiles fDebugSourceFiles;
+
// Static list of register names as obtained directly from GDB.
// We make it static, key'ed on each version of gdb, so it does not
// get re-set for every test.
@@ -128,7 +132,7 @@ public class SyncUtil {
fMemory = tracker.getService(IMemory.class);
fCommandFactory = fGdbControl.getCommandFactory();
fSourceLookup = tracker.getService(ISourceLookup.class);
-
+ fDebugSourceFiles = tracker.getService(IDebugSourceFiles.class);
tracker.dispose();
};
fSession.getExecutor().submit(runnable).get();
@@ -979,4 +983,21 @@ public class SyncUtil {
return query.get();
}
+
+ /**
+ * Get the sources from the debugger.
+ *
+ * Wrapper around
+ * {@link IDebugSourceFiles#getSources(IDMContext, DataRequestMonitor)}
+ */
+ public static IDebugSourceFileInfo[] getSources(IDMContext ctx) throws Exception {
+ Query<IDebugSourceFileInfo[]> query = new Query<IDebugSourceFileInfo[]>() {
+ @Override
+ protected void execute(DataRequestMonitor<IDebugSourceFileInfo[]> rm) {
+ fDebugSourceFiles.getSources(ctx, rm);
+ }
+ };
+ fDebugSourceFiles.getExecutor().execute(query);
+ return query.get();
+ }
}
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java
index c4bb8c8d64..94c20e34cb 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/SourceLookupTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Kichwa Coders and others.
+ * Copyright (c) 2015, 2018 Kichwa Coders and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -54,6 +54,8 @@ import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
import org.eclipse.cdt.dsf.debug.sourcelookup.DsfSourceLookupDirector;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles;
+import org.eclipse.cdt.dsf.gdb.service.IDebugSourceFiles.IDebugSourceFileInfo;
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
@@ -1157,4 +1159,58 @@ public class SourceLookupTest extends BaseParametrizedTestCase {
*/
waitUntil("Timeout waiting for launches to terminate", () -> launch1.isTerminated() && launch2.isTerminated());
}
+
+ /**
+ * Helper method that actually performs the test/assertions for
+ * {@link IDebugSourceFiles#getSources(IDMContext, DataRequestMonitor)} tests.
+ */
+ private void testGetSourcesListInner(String path) throws Throwable {
+ IDebugSourceFileInfo[] sources = SyncUtil.getSources(SyncUtil.getContainerContext());
+ String expectedPath = Paths.get(path, SOURCE_NAME).toString();
+ boolean anyMatch = Arrays.asList(sources).stream().anyMatch(source -> {
+ return source.getPath().equals(expectedPath);
+ });
+ assertTrue(anyMatch);
+ }
+
+ /**
+ * Test for {@link IDebugSourceFiles#getSources(IDMContext, DataRequestMonitor)}
+ * with source path substitution on. Therefore make sure there is an entry
+ * for the resolved source path of {@value #SOURCE_NAME}
+ */
+ private void testGetSourcesList(String execName) throws Throwable {
+ doMappingAndLaunch(execName, true);
+ testGetSourcesListInner(SOURCE_ABSPATH);
+ }
+
+ /**
+ * Test for {@link IDebugSourceFiles#getSources(IDMContext, DataRequestMonitor)}
+ * with no source path substitution on. Therefore make sure there is an entry
+ * for the build path of {@value #SOURCE_NAME}
+ */
+ @Test
+ public void testGetSourcesListNoSourceLookup() throws Throwable {
+ doLaunch(EXEC_PATH + EXEC_AC_NAME);
+ testGetSourcesListInner(BUILD_ABSPATH);
+ }
+
+ @Test
+ public void testGetSourcesListAC() throws Throwable {
+ testGetSourcesList(EXEC_AC_NAME);
+ }
+
+ @Test
+ public void testGetSourcesListAN() throws Throwable {
+ testGetSourcesList(EXEC_AN_NAME);
+ }
+
+ @Test
+ public void testGetSourcesListRC() throws Throwable {
+ testGetSourcesList(EXEC_RC_NAME);
+ }
+
+ @Test
+ public void testGetSourcesListRN() throws Throwable {
+ testGetSourcesList(EXEC_RN_NAME);
+ }
}
diff --git a/dsf-gdb/pom.xml b/dsf-gdb/pom.xml
index 0557a5cf44..2f5f010b10 100644
--- a/dsf-gdb/pom.xml
+++ b/dsf-gdb/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.dsf-gdb-parent</artifactId>
diff --git a/dsf/org.eclipse.cdt.examples.dsf-feature/feature.xml b/dsf/org.eclipse.cdt.examples.dsf-feature/feature.xml
index 3a4433c1fb..4d7debaa73 100644
--- a/dsf/org.eclipse.cdt.examples.dsf-feature/feature.xml
+++ b/dsf/org.eclipse.cdt.examples.dsf-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.examples.dsf"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.examples.dsf"
license-feature="org.eclipse.license"
diff --git a/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml b/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml
index a6204d20ad..edf8c67bdb 100644
--- a/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml
+++ b/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/dsf/pom.xml b/dsf/pom.xml
index a55a1d3138..c865f2860c 100644
--- a/dsf/pom.xml
+++ b/dsf/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.dsf-parent</artifactId>
diff --git a/jtag/org.eclipse.cdt.debug.dap.gdbjtag-feature/feature.xml b/jtag/org.eclipse.cdt.debug.dap.gdbjtag-feature/feature.xml
index 1abd314111..21906a7211 100644
--- a/jtag/org.eclipse.cdt.debug.dap.gdbjtag-feature/feature.xml
+++ b/jtag/org.eclipse.cdt.debug.dap.gdbjtag-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.debug.dap.gdbjtag"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF
index 98eedcba27..000958c0c1 100644
--- a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.cdt.debug.dap.gdbjtag;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.100.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.dap.gdbjtag.Activator
Require-Bundle: org.apache.commons.io,
org.eclipse.core.runtime,
diff --git a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/Activator.java b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/Activator.java
index b66d075a72..475c7f3ea0 100644
--- a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/Activator.java
+++ b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/Activator.java
@@ -13,7 +13,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/feature.xml b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/feature.xml
index 9b16ef1b5c..c875f0fba3 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/feature.xml
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.debug.gdbjtag"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml
index f11b446721..89afdc22ce 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF
index ce222d6120..cee554fa5a 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: GDB Hardware Debugging Tests
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core.tests;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.tests.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.tests.dsf.gdb;bundle-version="2.3.0",
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml
index 3433133ec3..64fc60091c 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml
@@ -7,11 +7,11 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.100-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.debug.gdbjtag.core.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>
@@ -59,7 +59,7 @@
<configuration>
<useUIHarness>false</useUIHarness>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier} -Dcdt.tests.dsf.gdb.versions=${cdt.tests.dsf.gdb.versions}</argLine>
- <appArgLine>-debug ./dsf.debug.options</appArgLine>
+ <appArgLine>-debug ./dsf.debug.options -pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<includes>
<include>**/${dsf.gdb.tests.gdbTestSuite}</include>
</includes>
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java
index 05167246fd..9281bb5fc2 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2018 Kichwa Coders and others.
+ * Copyright (c) 2016, 2019 Kichwa Coders and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -67,8 +67,9 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase {
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, X86_64_INIT);
}
} else {
- setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "file " + TEST_PROGRAM_NAME); //$NON-NLS-1$
- setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "run"); //$NON-NLS-1$
+ String comments = "# Commented line\n\n \n # Commented indented line\n";
+ setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, comments + "file " + TEST_PROGRAM_NAME); //$NON-NLS-1$
+ setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, comments + "run"); //$NON-NLS-1$
}
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
index 2017101759..f299161faf 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
-Bundle-Version: 9.3.100.qualifier
+Bundle-Version: 9.4.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties
index 47099c2d51..c25660b81d 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties
@@ -13,6 +13,7 @@
# IBM Corporation
# John Dallaway - migrate device extensions to core plugin, bug 538282
# John Dallaway - SEGGER J-Link extension, bug 548281
+# John Dallaway - PEmicro extension, bug 552597
###############################################################################
launchConfig.name=GDB Hardware Debugging
pluginName=Eclipse GDB Hardware Debug Core Plug-in
@@ -25,6 +26,7 @@ MacraigorUsb2Demon.name=Macraigor USB2Demon
GenericSerial.name=Generic Serial
OpenOCDPipe.name=OpenOCD (via pipe)
OpenOCDSocket.name=OpenOCD (via socket)
+PEMicro.name=PEmicro
SeggerJLink.name=SEGGER J-Link
Generic.name=Generic TCP/IP
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
index 7c9c4a61d2..3c2e244bf7 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
@@ -58,6 +58,11 @@
name="%OpenOCDSocket.name">
</device>
<device
+ class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
+ id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
+ name="%PEMicro.name">
+ </device>
+ <device
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
name="%SeggerJLink.name">
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
index 59f169e6ed..89c623f064 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
@@ -489,6 +489,11 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
if (userCmd.length() > 0) {
String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
+ // Remove empty or commented lines
+ commands = Arrays.stream(commands)
+ .filter(line -> !line.trim().isEmpty() && !line.trim().startsWith("#")) //$NON-NLS-1$
+ .toArray(String[]::new);
+
CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
crm.setDoneCount(commands.length);
for (int i = 0; i < commands.length; ++i) {
@@ -715,6 +720,11 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
+ // Remove empty or commented lines
+ commands = Arrays.stream(commands)
+ .filter(line -> !line.trim().isEmpty() && !line.trim().startsWith("#")) //$NON-NLS-1$
+ .toArray(String[]::new);
+
CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
crm.setDoneCount(commands.length);
for (int i = 0; i < commands.length; ++i) {
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/PEMicro.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/PEMicro.java
new file mode 100644
index 0000000000..0fc57d3c05
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/PEMicro.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2019 QNX Software Systems and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Andy Jin - Hardware debugging UI improvements, bug 229946
+ * John Dallaway - PEmicro extension, bug 552597
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
+
+import java.util.Collection;
+
+/**
+ * @since 9.4
+ */
+public class PEMicro extends DefaultGDBJtagDeviceImpl {
+
+ @Override
+ public String getDefaultPortNumber() {
+ return "7224"; //$NON-NLS-1$
+ }
+
+ @Override
+ public void doDelay(int delay, Collection<String> commands) {
+ /* not supported */
+ }
+
+ @Override
+ public void doHalt(Collection<String> commands) {
+ /* not supported */
+ }
+
+ @Override
+ public void doReset(Collection<String> commands) {
+ doResetAndHalt(commands);
+ doContinue(commands);
+ }
+
+ @Override
+ public void doResetAndHalt(Collection<String> commands) {
+ addCmd(commands, "monitor reset"); //$NON-NLS-1$
+ }
+
+}
diff --git a/jtag/pom.xml b/jtag/pom.xml
index 3fe4bc3512..bbfa9f5dca 100644
--- a/jtag/pom.xml
+++ b/jtag/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.jtag-parent</artifactId>
diff --git a/launch/org.eclipse.cdt.docker.launcher-feature/feature.xml b/launch/org.eclipse.cdt.docker.launcher-feature/feature.xml
index 52043a70c2..783d531614 100644
--- a/launch/org.eclipse.cdt.docker.launcher-feature/feature.xml
+++ b/launch/org.eclipse.cdt.docker.launcher-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.docker.launcher"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%provider"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/launch/org.eclipse.cdt.docker.launcher-feature/pom.xml b/launch/org.eclipse.cdt.docker.launcher-feature/pom.xml
index 9ba01fc8ad..1345a9126b 100644
--- a/launch/org.eclipse.cdt.docker.launcher-feature/pom.xml
+++ b/launch/org.eclipse.cdt.docker.launcher-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/launch/pom.xml b/launch/pom.xml
index 359b616908..a84fe7b3ce 100644
--- a/launch/pom.xml
+++ b/launch/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.launch-parent</artifactId>
diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb-feature/feature.xml b/llvm/org.eclipse.cdt.llvm.dsf.lldb-feature/feature.xml
index d0e6c6dfea..de302bfae0 100644
--- a/llvm/org.eclipse.cdt.llvm.dsf.lldb-feature/feature.xml
+++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.llvm.dsf.lldb"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF
index ba620943f7..c45ed6ab50 100644
--- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF
+++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.llvm.dsf.lldb.core;singleton:=true
-Bundle-Version: 1.0.1.qualifier
+Bundle-Version: 1.100.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core,
diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/LLDBPreferenceInitializer.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/LLDBPreferenceInitializer.java
index 503a9c3994..e0f31a10bc 100644
--- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/LLDBPreferenceInitializer.java
+++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/LLDBPreferenceInitializer.java
@@ -26,11 +26,12 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences;
*/
public class LLDBPreferenceInitializer extends AbstractPreferenceInitializer {
- private static final String XCODE_BUNDLED_LLDB_PATH = "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi"; //$NON-NLS-1$
+ private static final String XCODE_BUNDLED_LLDB_MI_PATH = "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi"; //$NON-NLS-1$
private static String getDefaultCommand() {
- if (Platform.getOS().equals(Platform.OS_MACOSX) && new File(XCODE_BUNDLED_LLDB_PATH).exists()) {
- return XCODE_BUNDLED_LLDB_PATH;
+ // Note: As of Xcode 11.1, lldb-mi is not included anymore
+ if (Platform.getOS().equals(Platform.OS_MACOSX) && new File(XCODE_BUNDLED_LLDB_MI_PATH).exists()) {
+ return XCODE_BUNDLED_LLDB_MI_PATH;
}
return ILLDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT;
}
diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
index 201d719d92..62f645a678 100644
--- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
+++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
@@ -234,6 +234,7 @@ public class LLDBLaunch extends GdbLaunch {
// 370.0.40 => Xcode 8.3.1
// 902.0.79.7 => Xcode 9.4.1
// 1000.11.37.1 => Xcode 10.0
+ // 1100.0.28.19 => Xcode 11.1 (lldb-mi not included anymore)
//
// Note that a LLDB built from source on macOS can report the same
// Apple-style version even for different LLDB/Clang-style version
diff --git a/llvm/org.eclipse.cdt.managedbuilder.llvm-feature/feature.xml b/llvm/org.eclipse.cdt.managedbuilder.llvm-feature/feature.xml
index ab97f9342c..4751b85b7b 100644
--- a/llvm/org.eclipse.cdt.managedbuilder.llvm-feature/feature.xml
+++ b/llvm/org.eclipse.cdt.managedbuilder.llvm-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.managedbuilder.llvm"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.managedbuilder.llvm.ui"
license-feature="org.eclipse.license"
diff --git a/llvm/pom.xml b/llvm/pom.xml
index 183209a7b7..caa2fb9906 100644
--- a/llvm/pom.xml
+++ b/llvm/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.llvm-parent</artifactId>
diff --git a/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml b/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml
index 33ff372494..667aeebc00 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml
+++ b/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.core.lrparser.feature"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.core.lrparser"
license-feature="org.eclipse.license"
diff --git a/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml b/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml
index 67bdd276d8..307285da1c 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml
+++ b/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.core.lrparser.sdk"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.core.lrparser.source"
license-feature="org.eclipse.license"
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
index 0d8f81a034..20996aa3a9 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
@@ -216,7 +216,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
if(e instanceof TemplateIDErrorException){
//IScanner completePreprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
//IParser<IASTTranslationUnit> completeParser = getCompleteParser(preprocessor, index, parserProperties);
-
+
ISecondaryParser<IASTTranslationUnit> completeParser = getCompleteParser((ITokenStream)parser, preprocessor, index, parserProperties);
//completeParser.setAction(parser.getAction());
//((ISecondaryParser)completeParser).setTokenMap((ITokenStream)parser);
diff --git a/lrparser/pom.xml b/lrparser/pom.xml
index 618b1c9e1a..7d0795bcf4 100644
--- a/lrparser/pom.xml
+++ b/lrparser/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.lrparser-parent</artifactId>
diff --git a/lsp/org.eclipse.cdt.lsp-feature/feature.xml b/lsp/org.eclipse.cdt.lsp-feature/feature.xml
index 30f7f64a37..6c9a724e8c 100644
--- a/lsp/org.eclipse.cdt.lsp-feature/feature.xml
+++ b/lsp/org.eclipse.cdt.lsp-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.lsp"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%featureProvider"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/lsp/org.eclipse.cdt.lsp.core.tests/META-INF/MANIFEST.MF b/lsp/org.eclipse.cdt.lsp.core.tests/META-INF/MANIFEST.MF
index cbb7ac89ed..6df0787718 100644
--- a/lsp/org.eclipse.cdt.lsp.core.tests/META-INF/MANIFEST.MF
+++ b/lsp/org.eclipse.cdt.lsp.core.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: "Tests for LSP4E C/C++ Support"
Bundle-SymbolicName: org.eclipse.cdt.lsp.core.tests
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: org.eclipse.cdt.lsp.core.tests
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/lsp/org.eclipse.cdt.lsp.core.tests/pom.xml b/lsp/org.eclipse.cdt.lsp.core.tests/pom.xml
index 4428654140..c543309c7f 100644
--- a/lsp/org.eclipse.cdt.lsp.core.tests/pom.xml
+++ b/lsp/org.eclipse.cdt.lsp.core.tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -25,6 +25,7 @@
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
<!-- else, if you have no UI tests, use this block -->
<!-- <useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
diff --git a/lsp/pom.xml b/lsp/pom.xml
index 5f4c45cec6..89896815e6 100644
--- a/lsp/pom.xml
+++ b/lsp/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.lsp-parent</artifactId>
diff --git a/memory/org.eclipse.cdt.debug.ui.memory-feature/feature.xml b/memory/org.eclipse.cdt.debug.ui.memory-feature/feature.xml
index a940b8f2ad..e2e10fd1e9 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory-feature/feature.xml
+++ b/memory/org.eclipse.cdt.debug.ui.memory-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.debug.ui.memory"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/memory/pom.xml b/memory/pom.xml
index c10f7cd85b..b020dc621f 100644
--- a/memory/pom.xml
+++ b/memory/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.memory-parent</artifactId>
diff --git a/native/org.eclipse.cdt.native.serial/META-INF/MANIFEST.MF b/native/org.eclipse.cdt.native.serial/META-INF/MANIFEST.MF
index 1a90e5ed72..9347970cf0 100644
--- a/native/org.eclipse.cdt.native.serial/META-INF/MANIFEST.MF
+++ b/native/org.eclipse.cdt.native.serial/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Serial Port
Bundle-SymbolicName: org.eclipse.cdt.native.serial
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
Bundle-Vendor: Eclipse CDT
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.cdt.serial
diff --git a/native/org.eclipse.cdt.native.serial/jni/Makefile b/native/org.eclipse.cdt.native.serial/jni/Makefile
index 8c07bd926e..72c59e6e8a 100644
--- a/native/org.eclipse.cdt.native.serial/jni/Makefile
+++ b/native/org.eclipse.cdt.native.serial/jni/Makefile
@@ -1,5 +1,5 @@
#*******************************************************************************
-# Copyright (c) 2002, 2009 QNX Software Systems and others.
+# Copyright (c) 2002, 2019 QNX Software Systems and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -25,7 +25,8 @@ UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
LIBS = \
$(OS_DIR)/win32/x86_64/serial.dll \
- $(OS_DIR)/linux/x86_64/libserial.so
+ $(OS_DIR)/linux/x86_64/libserial.so \
+ $(OS_DIR)/macosx/x86_64/libserial.jnilib
else
ifeq ($(UNAME),Darwin)
LIBS = \
@@ -43,9 +44,14 @@ clean :
rebuild: clean all
+# Windows DLLs have a build timestamp in them. This makes it impossible to have reproducible builds.
+# However, x86_64-w64-mingw32-ld on Debian/Ubuntu has a patch that overrides the current date
+# using the SOURCE_DATE_EPOCH environment variable. Therefore we set SOURCE_DATE_EPOCH to a
+# consistent timestamp that can be reproduced. We base it off of the commit timestamp of the
+# most recent git commit in this directory.
$(OS_DIR)/win32/x86_64/serial.dll: serial.c
mkdir -p $(dir $@)
- x86_64-w64-mingw32-gcc -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" -shared -o $@ serial.c
+ SOURCE_DATE_EPOCH=$(shell git log -1 --pretty=format:%ct -- .) x86_64-w64-mingw32-gcc -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" -shared -o $@ serial.c
$(OS_DIR)/linux/x86_64/libserial.so: serial.c
mkdir -p $(dir $@)
@@ -57,4 +63,4 @@ $(OS_DIR)/linux/ppc64le/libserial.so: serial.c
$(OS_DIR)/macosx/x86_64/libserial.jnilib: serial.c
mkdir -p $(dir $@)
- clang $(CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin $(LDFLAGS) -dynamiclib -o $@ serial.c
+ x86_64-apple-darwin17-clang $(CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin $(LDFLAGS) -dynamiclib -o $@ serial.c
diff --git a/native/org.eclipse.cdt.native.serial/jni/Readme.md b/native/org.eclipse.cdt.native.serial/jni/Readme.md
new file mode 100644
index 0000000000..9e8d9f663b
--- /dev/null
+++ b/native/org.eclipse.cdt.native.serial/jni/Readme.md
@@ -0,0 +1,21 @@
+### How to rebuild natives.
+
+The goal of these instructions is to have a cross-platform build of the natives in CDT. Using tools in CDT's
+[docker](https://github.com/eclipse-cdt/cdt-infra/blob/master/docker/cdt-infra-eclipse-full/ubuntu-18.04/Dockerfile) build image
+(quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest).
+
+It is fairly straightforward to biuild the natives, run this command:
+
+```
+docker run --rm -it -v $(git rev-parse --show-toplevel):/work -w /work/$(git rev-parse --show-prefix) quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest make -C jni rebuild
+```
+
+However, the challenge is that dll files on Windows have a timestamp in them. To have reproducible builds, we need to have a reproducible
+timestamp. Therefore we use the commit time of the commit to derive a timestamp (See the Makefile for more info). Because we want
+to keep the DLL checked in so that contributors don't need to rebuild it all the time we need a way to have to check in the dll with
+the same commit time. To do this we use GIT_COMMITTER_DATE. So, after editing and committing your change, you need to rebuild one last
+time with the commit date and the commit it without changing the commit date again using:
+
+```
+GIT_COMMITTER_DATE=$(git log -1 --pretty=format:%cI -- .) git commit --amend -a --reuse-message=HEAD
+```
diff --git a/native/org.eclipse.cdt.native.serial/jni/serial.c b/native/org.eclipse.cdt.native.serial/jni/serial.c
index 216169c041..95d3b57f37 100644
--- a/native/org.eclipse.cdt.native.serial/jni/serial.c
+++ b/native/org.eclipse.cdt.native.serial/jni/serial.c
@@ -157,6 +157,9 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
// ignore parity
options.c_iflag |= IGNPAR;
+
+ // turn off those bits in the input flag that fiddle with CR and NL
+ options.c_iflag &= ~(ICRNL | INLCR | IGNCR);
options.c_cc[VMIN] = 0; // min chars to read
options.c_cc[VTIME] = 2; // 10ths second timeout
diff --git a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
index 268ae8165e..3abd110e91 100755
--- a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
+++ b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
index 4676dd78dd..164c975250 100755
--- a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
+++ b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
index e1c1019bfa..fa6b4ce6c0 100755
--- a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
+++ b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/pom.xml b/native/org.eclipse.cdt.native.serial/pom.xml
index d6db49c7da..85bafd96c3 100644
--- a/native/org.eclipse.cdt.native.serial/pom.xml
+++ b/native/org.eclipse.cdt.native.serial/pom.xml
@@ -19,16 +19,92 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>1.1.200-SNAPSHOT</version>
+ <version>1.1.300-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.native.serial</artifactId>
<packaging>eclipse-plugin</packaging>
<profiles>
<profile>
+ <id>build-native.all</id>
+ <activation>
+ <property>
+ <name>native</name>
+ <value>all</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>natives</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <exec executable="make" newenvironment="false" failOnError="true" dir="./jni">
+ <arg value="rebuild" />
+ </exec>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>build-native.docker</id>
+ <activation>
+ <property>
+ <name>native</name>
+ <value>docker</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>natives</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <exec executable="docker" newenvironment="false" failOnError="true">
+ <!-- docker run -\-rm -t -v $(git rev-parse -\-show-toplevel):/work -w /work/$(git rev-parse -\-show-prefix) quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest make -C jni rebuild -->
+ <arg value="run" />
+ <arg value="--rm" />
+ <arg value="-t" />
+ <arg value="-v" />
+ <arg value="${project.basedir}/../..:/work" />
+ <arg value="-w" />
+ <arg value="/work/native/org.eclipse.cdt.native.serial" />
+ <arg value="quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest" />
+ <arg value="make" />
+ <arg value="-C" />
+ <arg value="jni" />
+ <arg value="rebuild" />
+ </exec>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>build-native.linux.x86_64</id>
<activation>
<property>
diff --git a/native/pom.xml b/native/pom.xml
index 8694c8619f..1c33841a63 100644
--- a/native/pom.xml
+++ b/native/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.native-parent</artifactId>
diff --git a/pom.xml b/pom.xml
index ced29df201..06b059f1f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,18 +10,22 @@
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>CDT Parent</name>
<properties>
- <required-maven-version>3.3.1</required-maven-version>
- <tycho-version>1.4.0</tycho-version>
- <tycho-extras-version>1.4.0</tycho-extras-version>
+ <!-- Maven 3.6.1 and 3.6.2 do not work with Tycho, see Bug 551674
+ CDT enforces a minimum of 3.6.0 because that is what CDT's CI
+ runs with. It may work with older versions, but this is not
+ tested or supported. -->
+ <required-maven-version>[3.6.0]</required-maven-version>
+ <tycho-version>1.5.1</tycho-version>
+ <tycho-extras-version>1.5.1</tycho-extras-version>
<cbi-plugins.version>1.1.7</cbi-plugins.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<cdt-site>http://ci.eclipse.org/cdt/job/cdt-master/lastSuccessfulBuild/artifact/releng/org.eclipse.cdt.repo/target/repository</cdt-site>
- <simrel-site>https://download.eclipse.org/releases/2019-09</simrel-site>
+ <simrel-site>https://download.eclipse.org/releases/2019-12</simrel-site>
<repo-path>tools/cdt/builds/master/nightly</repo-path>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../../target/jacoco.exec</sonar.jacoco.reportPath>
@@ -438,6 +442,7 @@
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
</configuration>
</plugin>
</plugins>
@@ -460,6 +465,7 @@
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
</configuration>
</plugin>
</plugins>
@@ -592,6 +598,32 @@
<build>
<plugins>
<plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ <executions>
+ <execution>
+ <id>enforce-maven-version</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>${required-maven-version}</version>
+ </requireMavenVersion>
+ <requireJavaVersion>
+ <version>1.8</version>
+ </requireJavaVersion>
+ </rules>
+ <fail>true</fail>
+ <failFast>true</failFast>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.4</version>
@@ -697,7 +729,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.8.4</version>
+ <version>0.8.5</version>
<executions>
<execution>
<id>pre-test</id>
@@ -808,6 +840,7 @@
</dependencies>
<product>org.eclipse.platform.ide</product>
<argLine>${tycho.testArgLine} ${base.test.vmargs}</argLine>
+ <appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
</configuration>
</plugin>
<plugin>
@@ -873,7 +906,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.11.0</version>
+ <version>3.12.0</version>
<configuration>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
@@ -930,31 +963,7 @@
</execution>
</executions>
</plugin>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0-M2</version>
- <executions>
- <execution>
- <id>enforce-maven-version</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireMavenVersion>
- <version>${required-maven-version}</version>
- </requireMavenVersion>
- <requireJavaVersion>
- <version>1.8</version>
- </requireJavaVersion>
- </rules>
- <fail>true</fail>
- </configuration>
- </execution>
- </executions>
- </plugin>
+
</plugins>
</pluginManagement>
</build>
diff --git a/qt/org.eclipse.cdt.qt-feature/feature.xml b/qt/org.eclipse.cdt.qt-feature/feature.xml
index 50dd2c1000..241a45efa8 100644
--- a/qt/org.eclipse.cdt.qt-feature/feature.xml
+++ b/qt/org.eclipse.cdt.qt-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.qt"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/qt/org.eclipse.cdt.qt.core.tests/META-INF/MANIFEST.MF b/qt/org.eclipse.cdt.qt.core.tests/META-INF/MANIFEST.MF
index 8ed28c3c25..ba9242b709 100644
--- a/qt/org.eclipse.cdt.qt.core.tests/META-INF/MANIFEST.MF
+++ b/qt/org.eclipse.cdt.qt.core.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: QML Tests
Bundle-SymbolicName: org.eclipse.cdt.qt.core.tests
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.100",
diff --git a/qt/pom.xml b/qt/pom.xml
index 5f366ce24e..b28e6a0a28 100644
--- a/qt/pom.xml
+++ b/qt/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.qt-parent</artifactId>
diff --git a/releng/CDT.setup b/releng/CDT.setup
index 9df0b1396f..dcc36c0c8b 100644
--- a/releng/CDT.setup
+++ b/releng/CDT.setup
@@ -66,9 +66,9 @@
xsi:type="pde:APIBaselineTask"
id="baseline"
name="CDT"
- version="9.7"
+ version="9.9"
location="${workspace.location/../api.baseline}"
- remoteURI="https://download.eclipse.org/tools/cdt/builds/9.7/cdt-9.7.0-simrel-2019-03-rc2a/cdt-9.7.0-simrel-2019-03-rc2a.zip"/>
+ remoteURI="https://download.eclipse.org/tools/cdt/releases/9.9/cdt-9.9.0/"/>
<setupTask
xsi:type="git:GitCloneTask"
id="git.clone.cdt"
@@ -123,6 +123,10 @@
<requirement
name="org.junit.source"/>
<requirement
+ name="org.junit.jupiter.api"/>
+ <requirement
+ name="org.junit.jupiter.api.source"/>
+ <requirement
name="org.mockito"/>
<requirement
name="org.hamcrest"/>
@@ -198,9 +202,9 @@
<repository
url="https://download.eclipse.org/eclipse/updates/4.13/R-4.13-201909161045/"/>
<repository
- url="https://download.eclipse.org/tools/cdt/launchbar/2.4/launchbar-2.4.0-simrel-2019-09-m1/"/>
+ url="https://download.eclipse.org/tools/cdt/launchbar/2.4/launchbar-2.4.1-simrel-2019-12-m3/"/>
<repository
- url="http://download.eclipse.org/linuxtools/updates-docker-nightly-4.4/"/>
+ url="http://download.eclipse.org/linuxtools/updates-docker-nightly/"/>
<repository
url="https://download.eclipse.org/webtools/downloads/drops/R3.15.0/R-3.15.0-20190830034720/repository/"/>
<repository
@@ -208,11 +212,11 @@
<repository
url="http://download.eclipse.org/tm/terminal/updates/4.4milestones/"/>
<repository
- url="http://download.eclipse.org/tools/cdt/tools.templates/1.1/tools.template-1.1.1-simrel-2018-12a/"/>
+ url="https://download.eclipse.org/tools/cdt/tools.templates/1.1/tools.templates-1.1.2-simrel-2019-12-m3/"/>
<repository
url="https://download.eclipse.org/tm4e/releases/0.3.4/"/>
<repository
- url="https://download.eclipse.org/lsp4e/releases/0.11.0/"/>
+ url="http://download.eclipse.org/lsp4e/snapshots/"/>
</repositoryList>
</targlet>
</setupTask>
diff --git a/releng/org.eclipse.cdt-feature/feature.xml b/releng/org.eclipse.cdt-feature/feature.xml
index 1fc96c82c1..80f7e5705c 100644
--- a/releng/org.eclipse.cdt-feature/feature.xml
+++ b/releng/org.eclipse.cdt-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/org.eclipse.cdt-feature/p2.inf b/releng/org.eclipse.cdt-feature/p2.inf
index 552f6aa698..53dbab7274 100644
--- a/releng/org.eclipse.cdt-feature/p2.inf
+++ b/releng/org.eclipse.cdt-feature/p2.inf
@@ -1,3 +1,3 @@
instructions.configure=\
-org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/tools/cdt/releases/9.9,type:0,name:CDT,enabled:false); \
-org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/tools/cdt/releases/9.9,type:1,name:CDT,enabled:false);
+org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/tools/cdt/releases/9.11,type:0,name:CDT,enabled:false); \
+org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/tools/cdt/releases/9.11,type:1,name:CDT,enabled:false);
diff --git a/releng/org.eclipse.cdt-feature/pom.xml b/releng/org.eclipse.cdt-feature/pom.xml
index 1bb92c6ee6..844e86e7df 100644
--- a/releng/org.eclipse.cdt-feature/pom.xml
+++ b/releng/org.eclipse.cdt-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.native-feature/feature.xml b/releng/org.eclipse.cdt.native-feature/feature.xml
index cb1cd2d50f..6999035e69 100644
--- a/releng/org.eclipse.cdt.native-feature/feature.xml
+++ b/releng/org.eclipse.cdt.native-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.native"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/org.eclipse.cdt.platform-feature/feature.xml b/releng/org.eclipse.cdt.platform-feature/feature.xml
index b8b7fc3aaa..b4388dca2d 100644
--- a/releng/org.eclipse.cdt.platform-feature/feature.xml
+++ b/releng/org.eclipse.cdt.platform-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.platform"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/org.eclipse.cdt.repo/pom.xml b/releng/org.eclipse.cdt.repo/pom.xml
index aa5978e561..408309abfa 100644
--- a/releng/org.eclipse.cdt.repo/pom.xml
+++ b/releng/org.eclipse.cdt.repo/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.sdk-feature/feature.xml b/releng/org.eclipse.cdt.sdk-feature/feature.xml
index 7fe29e7a9a..723249a80e 100644
--- a/releng/org.eclipse.cdt.sdk-feature/feature.xml
+++ b/releng/org.eclipse.cdt.sdk-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.sdk"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/org.eclipse.cdt.sdk-feature/pom.xml b/releng/org.eclipse.cdt.sdk-feature/pom.xml
index 539fcaff31..e0b7113db2 100644
--- a/releng/org.eclipse.cdt.sdk-feature/pom.xml
+++ b/releng/org.eclipse.cdt.sdk-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.sdk/META-INF/MANIFEST.MF b/releng/org.eclipse.cdt.sdk/META-INF/MANIFEST.MF
index 53e2c5d2e9..e7ca80f44e 100644
--- a/releng/org.eclipse.cdt.sdk/META-INF/MANIFEST.MF
+++ b/releng/org.eclipse.cdt.sdk/META-INF/MANIFEST.MF
@@ -2,6 +2,6 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.sdk;singleton:=true
-Bundle-Version: 9.10.0.qualifier
+Bundle-Version: 9.11.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/releng/org.eclipse.cdt.target/cdt.target b/releng/org.eclipse.cdt.target/cdt.target
index 3be416a720..0fd87c5c0a 100644
--- a/releng/org.eclipse.cdt.target/cdt.target
+++ b/releng/org.eclipse.cdt.target/cdt.target
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="cdt" sequenceNumber="62">
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="cdt" sequenceNumber="64">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.gson" version="0.0.0"/>
@@ -17,9 +17,11 @@
<unit id="org.hamcrest.core" version="0.0.0"/>
<unit id="org.junit" version="0.0.0"/>
<unit id="org.junit.source" version="0.0.0"/>
+<unit id="org.junit.jupiter.api" version="0.0.0"/>
+<unit id="org.junit.jupiter.api.source" version="0.0.0"/>
<unit id="org.mockito" version="0.0.0"/>
<unit id="org.slf4j.impl.log4j12" version="0.0.0"/>
-<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository/"/>
+<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20191118194249/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.epp.logging.aeri.feature.feature.group" version="0.0.0"/>
@@ -56,7 +58,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.launchbar.feature.group" version="0.0.0"/>
<unit id="org.eclipse.launchbar.remote.feature.group" version="0.0.0"/>
-<repository location="https://download.eclipse.org/tools/cdt/launchbar/2.4/launchbar-2.4.0-simrel-2019-09-m1/"/>
+<repository location="https://download.eclipse.org/tools/cdt/launchbar/2.4/launchbar-2.4.1-simrel-2019-12-m3/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.linuxtools.docker.feature.feature.group" version="0.0.0"/>
@@ -81,7 +83,7 @@
<unit id="org.eclipse.tools.templates.freemarker.java11.source" version="0.0.0"/>
<unit id="org.eclipse.tools.templates.ui" version="0.0.0"/>
<unit id="org.eclipse.tools.templates.ui.source" version="0.0.0"/>
-<repository location="http://download.eclipse.org/tools/cdt/tools.templates/1.1/tools.template-1.1.1-simrel-2018-12a/"/>
+<repository location="https://download.eclipse.org/tools/cdt/tools.templates/1.1/tools.templates-1.1.2-simrel-2019-12-m3/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.tm4e.feature.feature.group" version="0.0.0"/>
@@ -90,7 +92,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.lsp4e" version="0.0.0"/>
<unit id="org.eclipse.lsp4e.debug" version="0.0.0"/>
-<repository location="https://download.eclipse.org/lsp4e/releases/0.11.0/"/>
+<repository location="http://download.eclipse.org/lsp4e/snapshots/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
diff --git a/releng/org.eclipse.cdt.target/pom.xml b/releng/org.eclipse.cdt.target/pom.xml
index 7f09073a97..257542368a 100644
--- a/releng/org.eclipse.cdt.target/pom.xml
+++ b/releng/org.eclipse.cdt.target/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.testing-feature/feature.xml b/releng/org.eclipse.cdt.testing-feature/feature.xml
index e3c77472a4..f6124a1510 100644
--- a/releng/org.eclipse.cdt.testing-feature/feature.xml
+++ b/releng/org.eclipse.cdt.testing-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.testing"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/org.eclipse.cdt.testing-feature/pom.xml b/releng/org.eclipse.cdt.testing-feature/pom.xml
index 64734902de..1316788faf 100644
--- a/releng/org.eclipse.cdt.testing-feature/pom.xml
+++ b/releng/org.eclipse.cdt.testing-feature/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.testing.repo/pom.xml b/releng/org.eclipse.cdt.testing.repo/pom.xml
index 42c7eb8df1..cfd77d7fc3 100644
--- a/releng/org.eclipse.cdt.testing.repo/pom.xml
+++ b/releng/org.eclipse.cdt.testing.repo/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt.testing/pom.xml b/releng/org.eclipse.cdt.testing/pom.xml
index 8c19ca8686..190a619130 100644
--- a/releng/org.eclipse.cdt.testing/pom.xml
+++ b/releng/org.eclipse.cdt.testing/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/releng/org.eclipse.cdt/META-INF/MANIFEST.MF b/releng/org.eclipse.cdt/META-INF/MANIFEST.MF
index 771a3fe26a..59b28998b8 100644
--- a/releng/org.eclipse.cdt/META-INF/MANIFEST.MF
+++ b/releng/org.eclipse.cdt/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt; singleton:=true
-Bundle-Version: 9.10.0.qualifier
+Bundle-Version: 9.11.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui.intro;bundle-version="[3.2.0,4.0.0)",
diff --git a/releng/org.eclipse.cdt/pom.xml b/releng/org.eclipse.cdt/pom.xml
index 73aaee25f1..b5d5c640fb 100644
--- a/releng/org.eclipse.cdt/pom.xml
+++ b/releng/org.eclipse.cdt/pom.xml
@@ -7,11 +7,11 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt</artifactId>
<packaging>eclipse-plugin</packaging>
diff --git a/releng/pom.xml b/releng/pom.xml
index e0d46c2af5..4354283e22 100644
--- a/releng/pom.xml
+++ b/releng/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.releng-parent</artifactId>
diff --git a/releng/scripts/check_code_cleanliness.sh b/releng/scripts/check_code_cleanliness.sh
index c83b4d9e84..c056004d73 100755
--- a/releng/scripts/check_code_cleanliness.sh
+++ b/releng/scripts/check_code_cleanliness.sh
@@ -1,99 +1,14 @@
#!/bin/bash
-###
-# This script is run automatically as part of gerrit validation jobs
-# to ensure that coding standards have been followed. It can also be
-# used to make code follow standards again.
-#
-# The overall design is to apply a number of fixes (formatting, trim
-# whitespace, etc) and then check if there are any modifications
-# in git.
-###
-
set -e
##
-# Format code
-##
-: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.9/eclipse}
-test ! -e check_code_cleanliness_workspace
-${ECLIPSE} \
- -consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
- -config $PWD/core/org.eclipse.cdt.core/.settings/org.eclipse.jdt.core.prefs \
- $PWD -data check_code_cleanliness_workspace
-rm -rf check_code_cleanliness_workspace
-
-##
-# Remove trailing whitespace.
-# The .gitattributes is used as a filter to identify files to check. Patters with
-# this "# check trailing whitespace" on the line before are checked
-##
-awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes |
- while read i ; do
- echo "Removing trailing whitespace on $i files"
- git ls-files -- "$i" | xargs sed -i 's/[ \t]*$//'
- done
-
-##
-# Add all file types to .gitattributes
-##
-git ls-files | sed -E '-es@^.*/([^/]+)$@\1@' '-es@.+\.@\\\*\\.@' | sort -u | while read i ; do
- if ! grep "^$i " .gitattributes > /dev/null
- then
- echo "MISSING $i in .gitattributes, adding as text, check if that is correct"
- echo "$i text # automatically added - please verify" >> .gitattributes
- fi
-done
-
-##
-# Copy JDT/PDE preferences
+# The script is shared by all the CDT projects. When running
+# local edits, you can, for example, do:
+# SCRIPT_URL=file:///scratch/eclipse/src/cdt/cdt-infra/scripts/check_code_cleanliness.sh ./check_code_cleanliness.sh
##
-git ls-files -- \*\*/.project ':!core/org.eclipse.cdt.core/.project' | while read i ; do
- d=`dirname $i`;
- if test ! -e $d/feature.xml; then
- mkdir -p $d/.settings
- cp core/org.eclipse.cdt.core/.settings/org.eclipse.jdt.* core/org.eclipse.cdt.core/.settings/org.eclipse.pde.* $d/.settings
- # For test plug-ins we are more lenient so don't warn on some items
- if echo $i | grep '\.tests[/\.]' > /dev/null; then
- sed -i \
- '-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.deprecation=warning@org.eclipse.jdt.core.compiler.problem.deprecation=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.emptyStatement=warning@org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.fieldHiding=warning@org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning@org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.forbiddenReference=error@org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning@' \
- '-es@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.unusedLocal=warning@org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning@org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning@org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore@' \
- '-es@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore@' \
- $d/.settings/org.eclipse.jdt.core.prefs
- sed -i \
- '-es@compilers.p.not-externalized-att=1@compilers.p.not-externalized-att=2@' \
- $d/.settings/org.eclipse.pde.prefs
- fi
- if echo $i | grep 'org.eclipse.cdt.examples.dsf' > /dev/null; then
- sed -i \
- '-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
- $d/.settings/org.eclipse.jdt.core.prefs
- fi
- fi
-done
-##
-# Check that none of the above caused any changes
-##
-if test -z "$(git status -s)"; then
- echo "Tree looks clean!"
-else
- echo "Tree is dirty - something needs to be cleaned up in your commit"
- echo "Result of git status"
- git status
- echo "Result of git diff"
- git diff
- echo "Tree is dirty - something needs to be cleaned up in your commit (see above for git status/diff)"
- exit 1
-fi
+: ${SCRIPT_URL:=https://raw.githubusercontent.com/eclipse-cdt/cdt-infra/master/scripts/check_code_cleanliness.sh}
+export COREPROJECT=core/org.eclipse.cdt.core
+echo Obtaining check_code_cleanliness.sh from $SCRIPT_URL
+curl -sL $SCRIPT_URL | bash
diff --git a/releng/scripts/check_mvn_plugin_versions.sh b/releng/scripts/check_mvn_plugin_versions.sh
index e167d8899c..60e2aec086 100755
--- a/releng/scripts/check_mvn_plugin_versions.sh
+++ b/releng/scripts/check_mvn_plugin_versions.sh
@@ -1,6 +1,6 @@
#!/bin/bash
###############################################################################
-# Copyright (c) 2015, 2017 Ericsson, EfficiOS Inc. and others
+# Copyright (c) 2015, 2019 Ericsson, EfficiOS Inc. and others
#
#
# This program and the accompanying materials
@@ -16,12 +16,19 @@
# Marc-André Laperle - Copied to CDT
###############################################################################
+set -u # run with unset flag error so that missing parameters cause build failure
+set -e # error out on any failed commands
+set -x # echo all commands used for debugging purposes
+
# Point ourselves to the script's directory (so it can be run "out-of-tree")
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-output=`mvn versions:display-plugin-updates -U -f $DIR/../../pom.xml`
+output="$(mktemp /tmp/check_mvn_plugin_versions.output.XXXXXX)"
+${MVN:-mvn} versions:display-plugin-updates -P build-standalone-debugger-rcp -U -B -f $DIR/../../pom.xml | tee $output
#filter only updates and show unique
-summary=`echo "${output}" | grep "\\->" | sort | uniq`
+# XXX: Jonah added the exclusion for sonar-maven-plugin as Eclipse's SonarQube installation is not new enough
+# XXX: see https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven#AnalyzingwithSonarQubeScannerforMaven-Compatibility
+summary=`cat $output | grep "\\->" | grep -v "org.codehaus.mojo:sonar-maven-plugin" | sort | uniq`
echo -e "Summary:\n${summary}"
#remove empty lines and count lines
diff --git a/remote/pom.xml b/remote/pom.xml
index ae316c81db..571cedb225 100644
--- a/remote/pom.xml
+++ b/remote/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.remote-parent</artifactId>
diff --git a/testsrunner/org.eclipse.cdt.testsrunner.feature/feature.xml b/testsrunner/org.eclipse.cdt.testsrunner.feature/feature.xml
index 86d73e7b53..3b7531611c 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner.feature/feature.xml
+++ b/testsrunner/org.eclipse.cdt.testsrunner.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.testsrunner.feature"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/testsrunner/pom.xml b/testsrunner/pom.xml
index 2032881848..b95747c435 100644
--- a/testsrunner/pom.xml
+++ b/testsrunner/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.testsrunner-parent</artifactId>
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml
index 09cca3645f..6d1e9759b4 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.arduino"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.arduino.ui"
license-feature="org.eclipse.license"
@@ -25,7 +25,7 @@
<import feature="org.eclipse.remote.serial" version="1.0.0"/>
<import feature="org.eclipse.remote" version="2.0.0"/>
<import feature="org.eclipse.remote.console" version="2.0.0"/>
- <import feature="org.eclipse.cdt" version="9.10.0"/>
+ <import feature="org.eclipse.cdt" version="9.11.0"/>
<import feature="org.eclipse.launchbar.remote" version="1.0.0"/>
</requires>
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core.tests/META-INF/MANIFEST.MF b/toolchains/arduino/org.eclipse.cdt.arduino.core.tests/META-INF/MANIFEST.MF
index ec1931740c..a81f953979 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.core.tests/META-INF/MANIFEST.MF
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.core.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: org.eclipse.cdt.arduino.core.tests
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.cdt.arduino.core;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/toolchains/arduino/pom.xml b/toolchains/arduino/pom.xml
index f08c3902a1..f5f28db449 100644
--- a/toolchains/arduino/pom.xml
+++ b/toolchains/arduino/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/upc/org.eclipse.cdt.bupc-feature/feature.xml b/upc/org.eclipse.cdt.bupc-feature/feature.xml
index eea0f87dc4..fab8a053dc 100644
--- a/upc/org.eclipse.cdt.bupc-feature/feature.xml
+++ b/upc/org.eclipse.cdt.bupc-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.bupc"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.managedbuilder.bupc.ui"
license-feature="org.eclipse.license"
diff --git a/upc/org.eclipse.cdt.core.parser.upc.feature/feature.xml b/upc/org.eclipse.cdt.core.parser.upc.feature/feature.xml
index fde15ab932..cb31b75d41 100644
--- a/upc/org.eclipse.cdt.core.parser.upc.feature/feature.xml
+++ b/upc/org.eclipse.cdt.core.parser.upc.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.core.parser.upc.feature"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.core.parser.upc"
license-feature="org.eclipse.license"
diff --git a/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/feature.xml b/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/feature.xml
index 8e36725862..c1e409ad67 100644
--- a/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/feature.xml
+++ b/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.core.parser.upc.sdk"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.core.parser.upc.source"
license-feature="org.eclipse.license"
diff --git a/upc/pom.xml b/upc/pom.xml
index 7f50ccfd5b..bfffa2a088 100644
--- a/upc/pom.xml
+++ b/upc/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.upc-parent</artifactId>
diff --git a/util/pom.xml b/util/pom.xml
index c0a44c30d3..651e03084d 100644
--- a/util/pom.xml
+++ b/util/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.util-parent</artifactId>
diff --git a/visualizer/org.eclipse.cdt.visualizer-feature/feature.xml b/visualizer/org.eclipse.cdt.visualizer-feature/feature.xml
index d9d070a6e8..ac78dc999d 100644
--- a/visualizer/org.eclipse.cdt.visualizer-feature/feature.xml
+++ b/visualizer/org.eclipse.cdt.visualizer-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.visualizer"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/visualizer/pom.xml b/visualizer/pom.xml
index 79725f1b41..ad9020e03f 100644
--- a/visualizer/pom.xml
+++ b/visualizer/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.visualizer-parent</artifactId>
diff --git a/windows/org.eclipse.cdt.msw-feature/feature.xml b/windows/org.eclipse.cdt.msw-feature/feature.xml
index f18cf36ca2..7baafdcf3e 100644
--- a/windows/org.eclipse.cdt.msw-feature/feature.xml
+++ b/windows/org.eclipse.cdt.msw-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.msw"
label="C/C++ Visual C++ Support"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="Eclipse CDT"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.jdt.launching.prefs b/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.jdt.launching.prefs
new file mode 100644
index 0000000000..f8a131b56e
--- /dev/null
+++ b/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.jdt.launching.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning
diff --git a/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.pde.prefs b/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.pde.prefs
index d2dc703ba9..51a63ec998 100644
--- a/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.pde.prefs
+++ b/windows/org.eclipse.cdt.msw.build.tests/.settings/org.eclipse.pde.prefs
@@ -19,7 +19,7 @@ compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0
compilers.p.no.automatic.module=1
-compilers.p.not-externalized-att=1
+compilers.p.not-externalized-att=2
compilers.p.service.component.without.lazyactivation=1
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
diff --git a/windows/pom.xml b/windows/pom.xml
index 2e28221993..5cb99d5f1d 100644
--- a/windows/pom.xml
+++ b/windows/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.windows-parent</artifactId>
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/META-INF/MANIFEST.MF b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/META-INF/MANIFEST.MF
index 54786a1d02..fb5b4056d0 100644
--- a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/META-INF/MANIFEST.MF
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/META-INF/MANIFEST.MF
@@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: org.eclipse.cdt.core.lrparser.xlc.tests
+Bundle-Vendor: Eclipse CDT
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit,
diff --git a/xlc/org.eclipse.cdt.xlc.feature/feature.xml b/xlc/org.eclipse.cdt.xlc.feature/feature.xml
index 4df382bf99..ab6b71c07a 100644
--- a/xlc/org.eclipse.cdt.xlc.feature/feature.xml
+++ b/xlc/org.eclipse.cdt.xlc.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.xlc.feature"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.managedbuilder.xlc.core"
license-feature="org.eclipse.license"
diff --git a/xlc/org.eclipse.cdt.xlc.sdk-feature/feature.xml b/xlc/org.eclipse.cdt.xlc.sdk-feature/feature.xml
index f3fc5ecf95..44cc6a41c2 100644
--- a/xlc/org.eclipse.cdt.xlc.sdk-feature/feature.xml
+++ b/xlc/org.eclipse.cdt.xlc.sdk-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.xlc.sdk"
label="%featureName"
- version="9.10.0.qualifier"
+ version="9.11.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/xlc/pom.xml b/xlc/pom.xml
index 01e38d80fa..450b1cbc90 100644
--- a/xlc/pom.xml
+++ b/xlc/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>9.10.0-SNAPSHOT</version>
+ <version>9.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.cdt.xlc-parent</artifactId>

Back to the top