Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2014-05-26 13:29:28 -0400
committerDoug Schaefer2014-05-26 14:38:12 -0400
commit451cdd57875fb6d52197097e4c735348559163d9 (patch)
treeb282d9f25fee1aebb0c785baad9122d4da282b2f /core/org.eclipse.cdt.core.native
parent46b8b346616bd5460faf422a222003e506f20f11 (diff)
downloadorg.eclipse.cdt-451cdd57875fb6d52197097e4c735348559163d9.tar.gz
org.eclipse.cdt-451cdd57875fb6d52197097e4c735348559163d9.tar.xz
org.eclipse.cdt-451cdd57875fb6d52197097e4c735348559163d9.zip
Bug 303083 - Rename spawner bundle to 'native'
Native more accurately reflects what we've put there. They're native utilities that can be reused by other Eclipse bundles to access native services. Also fixed up the cdt 4.4 target which had fixed version numbers for some of the dependencies and used RSE out of the Luna repo instead of their latest milestones. Change-Id: I259aa9e92212409378679a8c61bf2fffd05c67a2 Reviewed-on: https://git.eclipse.org/r/27304 Tested-by: Hudson CI Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
Diffstat (limited to 'core/org.eclipse.cdt.core.native')
-rw-r--r--core/org.eclipse.cdt.core.native/.classpath7
-rw-r--r--core/org.eclipse.cdt.core.native/.cvsignore1
-rw-r--r--core/org.eclipse.cdt.core.native/.project34
-rw-r--r--core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.core.prefs342
-rw-r--r--core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.ui.prefs5
-rw-r--r--core/org.eclipse.cdt.core.native/.settings/org.eclipse.pde.api.tools.prefs175
-rw-r--r--core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF15
-rw-r--r--core/org.eclipse.cdt.core.native/about.html24
-rw-r--r--core/org.eclipse.cdt.core.native/build.properties24
-rwxr-xr-xcore/org.eclipse.cdt.core.native/plugin.properties28
-rw-r--r--core/org.eclipse.cdt.core.native/pom.xml17
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessInfo.java20
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessList.java19
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/CSpawnerPlugin.java91
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/Messages.java28
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/messages.properties16
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/WindowsRegistry.java116
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTY.java275
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java98
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java90
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java78
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java101
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/Spawner.java517
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java118
-rw-r--r--core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java91
25 files changed, 2330 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.native/.classpath b/core/org.eclipse.cdt.core.native/.classpath
new file mode 100644
index 00000000000..c743d53e564
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="utils"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/core/org.eclipse.cdt.core.native/.cvsignore b/core/org.eclipse.cdt.core.native/.cvsignore
new file mode 100644
index 00000000000..ba077a4031a
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/core/org.eclipse.cdt.core.native/.project b/core/org.eclipse.cdt.core.native/.project
new file mode 100644
index 00000000000..16748cc2a7f
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.core.native</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.core.prefs b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..4de53820811
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,342 @@
+#Mon Oct 17 17:36:13 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=110
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.ui.prefs b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..b6ac6d0fe0b
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,5 @@
+#Wed Jan 28 12:19:26 CET 2009
+eclipse.preferences.version=1
+formatter_profile=_CDT
+formatter_settings_version=11
+internal.default.compliance=user
diff --git a/core/org.eclipse.cdt.core.native/.settings/org.eclipse.pde.api.tools.prefs b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 00000000000..3c9c7aa0c1b
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,175 @@
+#Sun Feb 07 22:11:46 EST 2010
+ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
+CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
+CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
+ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
+ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Error
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..a244d4f5d6b
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true
+Bundle-Version: 5.7.0.qualifier
+Bundle-Activator: org.eclipse.cdt.internal.core.spawner.CSpawnerPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.cdt.core;org.eclipse.cdt.core.spawner=split;mandatory=org.eclipse.cdt.core.spawner,
+ org.eclipse.cdt.utils;org.eclipse.cdt.core.spawner=split;mandatory=org.eclipse.cdt.core.spawner,
+ org.eclipse.cdt.utils.pty,
+ org.eclipse.cdt.utils.spawner
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/core/org.eclipse.cdt.core.native/about.html b/core/org.eclipse.cdt.core.native/about.html
new file mode 100644
index 00000000000..d7c511887d6
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/about.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
+
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 22, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.native/build.properties b/core/org.eclipse.cdt.core.native/build.properties
new file mode 100644
index 00000000000..45d3b3aeced
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/build.properties
@@ -0,0 +1,24 @@
+###############################################################################
+# Copyright (c) 2003, 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+###############################################################################
+bin.includes = plugin.properties,\
+ about.html,\
+ .,\
+ META-INF/
+src.includes = about.html
+javadoc.packages = org.eclipse.cdt.utils.*,\
+ org.eclipse.cdt.utils.pty.*,\
+ org.eclipse.cdt.utils.spawner.*
+source.. = utils/
+
+jre.compilation.profile=JavaSE-1.7
+javacSource=1.7
+javacTarget=1.7
diff --git a/core/org.eclipse.cdt.core.native/plugin.properties b/core/org.eclipse.cdt.core.native/plugin.properties
new file mode 100755
index 00000000000..83aa6b38dc3
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/plugin.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2003, 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Anton Leherbauer (Wind River Systems)
+# Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+###############################################################################
+pluginName=C/C++ Development Tools Core Native Utilities
+providerName=Eclipse CDT
+
+fragmentName.aix = C/C++ Development Tools Core Native Utilities for AIX
+fragmentName.linux = C/C++ Development Tools Core Native Utilities for Linux
+fragmentName.linux.ia64 = C/C++ Development Tools Core Native Utilities for Linux (ia64)
+fragmentName.linux.ppc = C/C++ Development Tools Core Native Utilities for Linux (ppc)
+fragmentName.linux.ppc64 = C/C++ Development Tools Core Native Utilities for Linux (ppc64)
+fragmentName.linux.x86 = C/C++ Development Tools Core Native Utilities for Linux (x86)
+fragmentName.linux.x86_64 = C/C++ Development Tools Core Native Utilities for Linux (x86_64)
+fragmentName.qnx = C/C++ Development Tools Core Native Utilities for QNX
+fragmentName.solaris = C/C++ Development Tools Core Native Utilities for Solaris
+fragmentName.win32 = C/C++ Development Tools Core Native Utilities for Windows
+fragmentName.win32.x86 = C/C++ Development Tools Core Native Utilities for Windows (x86)
+fragmentName.win32.x86_64 = C/C++ Development Tools Core Native Utilities for Windows (x86_64)
+fragmentName.macosx = C/C++ Development Tools Core Native Utilities for MacOS X
diff --git a/core/org.eclipse.cdt.core.native/pom.xml b/core/org.eclipse.cdt.core.native/pom.xml
new file mode 100644
index 00000000000..162fa17b5e0
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.cdt</groupId>
+ <artifactId>cdt-parent</artifactId>
+ <version>8.4.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <version>5.7.0-SNAPSHOT</version>
+ <artifactId>org.eclipse.cdt.core.native</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessInfo.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessInfo.java
new file mode 100644
index 00000000000..f2592a4714a
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessInfo.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.core;
+
+/**
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IProcessInfo {
+ public int getPid();
+ public String getName();
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessList.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessList.java
new file mode 100644
index 00000000000..fcc2897345a
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/core/IProcessList.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.core;
+
+/**
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IProcessList {
+ public IProcessInfo[] getProcessList();
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/CSpawnerPlugin.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/CSpawnerPlugin.java
new file mode 100644
index 00000000000..98a7b2a223e
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/CSpawnerPlugin.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Martin Oberhuber (Wind River) - [303083] Split out from CCorePlugin
+ *******************************************************************************/
+package org.eclipse.cdt.internal.core.spawner;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * CSpawnerPlugin is the life-cycle owner of the plug-in.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class CSpawnerPlugin extends Plugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.cdt.core.spawner"; //$NON-NLS-1$
+
+ private static CSpawnerPlugin fgPlugin;
+
+ // NON-API
+
+ /**
+ * @noreference This constructor is not intended to be referenced by clients.
+ */
+ public CSpawnerPlugin() {
+ super();
+ fgPlugin = this;
+ }
+
+ public static CSpawnerPlugin getDefault() {
+ return fgPlugin;
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(String e) {
+ log(createStatus(e));
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(Throwable e) {
+ String msg= e.getMessage();
+ if (msg == null) {
+ log("Error", e); //$NON-NLS-1$
+ } else {
+ log("Error: " + msg, e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(String message, Throwable e) {
+ log(createStatus(message, e));
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static IStatus createStatus(String msg) {
+ return createStatus(msg, null);
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static IStatus createStatus(String msg, Throwable e) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, msg, e);
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/Messages.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/Messages.java
new file mode 100644
index 00000000000..14b71b7d73c
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/Messages.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Wind River Systems, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.internal.core.spawner;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.spawner.messages"; //$NON-NLS-1$
+ public static String Util_exception_cannotCreatePty;
+ public static String Util_exception_cannotSetTerminalSize;
+ public static String Util_error_cannotRun;
+ public static String Util_exception_closeError;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/messages.properties b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/messages.properties
new file mode 100644
index 00000000000..e1ab7f1ac42
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/internal/core/spawner/messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2000, 2014 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+# Martin Oberhuber (Wind River) - [303083] Split from CCorePluginResources.properties
+###############################################################################
+
+Util_exception_cannotCreatePty=Cannot create pty
+Util_exception_closeError=close error
+Util_exception_cannotSetTerminalSize=Setting terminal size is not supported
+Util_error_cannotRun=Cannot run program "{0}": {1}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/WindowsRegistry.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/WindowsRegistry.java
new file mode 100644
index 00000000000..cc216e2095b
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/WindowsRegistry.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 QNX Software Systems
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+/**
+ *
+ */
+package org.eclipse.cdt.utils;
+
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * @author DSchaefer
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class WindowsRegistry {
+
+ private static boolean failed = false;
+ private static WindowsRegistry registry;
+
+ private WindowsRegistry() {
+ }
+
+ public static WindowsRegistry getRegistry() {
+ if (registry == null && !failed) {
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ try {
+ System.loadLibrary("winreg"); //$NON-NLS-1$
+ registry = new WindowsRegistry();
+ } catch (UnsatisfiedLinkError e) {
+ failed = true;
+ return null;
+ }
+ } else
+ failed = true;
+ }
+
+ return registry;
+ }
+
+ /**
+ * Gets the registry value for the subkey of HKEY_LOCAL_MACHINE with the
+ * given name. If problems occur, like the name is not found, null is returned.
+ *
+ * @param subkey subkey of HKEY_LOCAL_MACHINE
+ * @param name name of the registry value
+ * @return registry value or null if not found
+ */
+ public native String getLocalMachineValue(String subkey, String name);
+
+ /**
+ * Given a subkey of HKEY_LOCAL_MACHINE, and an index (starting from 0)
+ * to the key's array of values, return the name of the indexed value.
+ * The return value is null on any error or when the index is invalid.
+ * The value name can be used in the above getLocalMachineValue() to retrieve
+ * the value data.
+ * @param subkey subkey of HKEY_LOCAL_MACHINE
+ * @param index index to the subkey's array of values, starting from 0.
+ * @return name of registry value or null if not found
+ */
+ public native String getLocalMachineValueName(String subkey, int index);
+
+ /**
+ * Given a subkey of HKEY_LOCAL_MACHINE, and an index (starting from 0)
+ * to the key's array of sub keys, return the name of the indexed key.
+ * The return value is null on any error or when the index is invalid.
+ * The key name can be used in the above getLocalMachineValueName()
+ * to retrieve value names.
+ * @param subkey subkey of HKEY_CURRENT_USER
+ * @param index index to the subkey's array of values, starting from 0.
+ * @return name of registry value or null if not found
+ */
+ public native String getLocalMachineKeyName(String subkey, int index);
+
+ /**
+ * Gets the registry value for the subkey of HKEY_CURRENT_USER with the
+ * given name. If problems occur, like the name is not found, null is returned.
+ *
+ * @param subkey subkey of HKEY_CURRENT_USER
+ * @param name name of the registry value
+ * @return registry value or null if not found
+ */
+ public native String getCurrentUserValue(String subkey, String name);
+
+ /**
+ * Given a subkey of HKEY_CURRENT_USER, and an index (starting from 0)
+ * to the key's array of values, return the name of the indexed value.
+ * The return value is null on any error or when the index is invalid.
+ * The value name can be used in the above getCurrentUserValue() to retrieve
+ * the value data.
+ * @param subkey subkey of HKEY_CURRENT_USER
+ * @param index index to the subkey's array of values, starting from 0.
+ * @return name of registry value or null if not found
+ */
+ public native String getCurrentUserValueName(String subkey, int index);
+
+ /**
+ * Given a subkey of HKEY_CURRENT_USER, and an index (starting from 0)
+ * to the key's array of sub keys, return the name of the indexed key.
+ * The return value is null on any error or when the index is invalid.
+ * The key name can be used in the above getCurrentUserValueName()
+ * to retrieve value names.
+ * @param subkey subkey of HKEY_CURRENT_USER
+ * @param index index to the subkey's array of values, starting from 0.
+ * @return name of registry value or null if not found
+ */
+ public native String getCurrentUserKeyName(String subkey, int index);
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTY.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTY.java
new file mode 100644
index 00000000000..f61fc8d29a2
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTY.java
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems, Inc. - bug 248071
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.utils.pty;
+
+import java.io.IOException;
+
+import org.eclipse.cdt.internal.core.spawner.CSpawnerPlugin;
+import org.eclipse.cdt.internal.core.spawner.Messages;
+import org.eclipse.cdt.utils.spawner.Spawner;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * PTY - pseudo terminal support.
+ */
+public class PTY {
+
+ /**
+ * The pty modes.
+ * @since 5.6
+ */
+ public enum Mode {
+ /** This mode is for use with an Eclipse console. */
+ CONSOLE,
+ /** This mode is for use with a terminal emulator. */
+ TERMINAL
+ }
+
+ final boolean console;
+ final String slave;
+ final PTYInputStream in;
+ final PTYOutputStream out;
+
+ /**
+ * NOTE: Field is accessed by the native layer. Do not refactor!
+ */
+ int master;
+
+ private static boolean hasPTY;
+ private static boolean isWinPTY;
+ private static boolean isConsoleModeSupported;
+ private static boolean setTerminalSizeErrorAlreadyLogged;
+
+ /**
+ * The master fd is used on two streams. We need to wrap the fd
+ * so that when stream.close() is called the other stream is disabled.
+ */
+ public class MasterFD {
+
+ public int getFD() {
+ return master;
+ }
+
+ void setFD(int fd) {
+ master = fd;
+ }
+ }
+
+ /**
+ * @return whether PTY support for console mode is available on this platform
+ */
+ public static boolean isSupported() {
+ return isSupported(Mode.CONSOLE);
+ }
+
+ /**
+ * @return whether PTY support for given mode is available on this platform
+ * @since 5.6
+ */
+ public static boolean isSupported(Mode mode ) {
+ return hasPTY && (isConsoleModeSupported || mode == Mode.TERMINAL);
+ }
+
+
+ /**
+ * Create PTY for use with Eclipse console.
+ * Identical to {@link PTY#PTY(boolean) PTY(Mode.CONSOLE)}.
+ */
+ public PTY() throws IOException {
+ this(Mode.CONSOLE);
+ }
+
+ /**
+ * Create PTY for given mode.
+ *
+ * <p>
+ * The provided mode indicates whether the pseudo terminal is used with the interactive
+ * Eclipse console or a terminal emulation:
+ * <ul>
+ * <li><code>CONSOLE</code> - the terminal is configured with no echo and stderr is
+ * redirected to a pipe instead of the PTY. This mode is not supported on windows</li>
+ * <li><code>TERMINAL</code> - the terminal is configured with echo and stderr is
+ * connected to the PTY. This mode is best suited for use with a proper terminal emulation.
+ * Note that this mode might not be supported on all platforms.
+ * Known platforms which support this mode are:
+ * <code>linux-x86</code>, <code>linux-x86_64</code>, <code>solaris-sparc</code>, <code>macosx</code>.
+ * </li>
+ * </ul>
+ * </p>
+ * @param mode the desired mode of operation
+ * @throws IOException if the PTY could not be created
+ * @since 5.6
+ */
+ public PTY(Mode mode) throws IOException {
+ this(mode == Mode.CONSOLE);
+ }
+
+ /**
+ * Create pseudo terminal.
+ *
+ * <p>
+ * The provided flag indicates whether the pseudo terminal is used with the interactive
+ * Eclipse console:
+ * <ul>
+ * <li>If <code>true</code> the terminal is configured with no echo and stderr is
+ * redirected to a pipe instead of the PTY. This mode is not supported on windows</li>
+ * <li>If <code>false</code> the terminal is configured with echo and stderr is
+ * connected to the PTY. This mode is best suited for use with a proper terminal emulation.
+ * Note that this mode might not be supported on all platforms.
+ * Known platforms which support this mode are:
+ * <code>linux-x86</code>, <code>linux-x86_64</code>, <code>solaris-sparc</code>, <code>macosx</code>.
+ * </li>
+ * </ul>
+ * </p>
+ *
+ * @param console whether terminal is used with Eclipse console
+ * @throws IOException if the PTY could not be created
+ * @deprecated Use {@link #PTY(Mode)} instead
+ * @since 5.2
+ */
+ @Deprecated
+ public PTY(boolean console) throws IOException {
+ this.console = console;
+ if (console && !isConsoleModeSupported) {
+ throw new IOException(Messages.Util_exception_cannotCreatePty);
+ }
+ slave= hasPTY ? openMaster(console) : null;
+
+ if (slave == null) {
+ throw new IOException(Messages.Util_exception_cannotCreatePty);
+ }
+
+ in = new PTYInputStream(new MasterFD());
+ out = new PTYOutputStream(new MasterFD());
+ }
+
+ /**
+ * Test whether the slave name can be used as a tty device by external processes (e.g. gdb).
+ * If the slave name is not valid an IOException is thrown.
+ * @throws IOException if the slave name is not valid
+ * @since 5.6
+ */
+ public void validateSlaveName() throws IOException {
+ // on windows the slave name is just an internal identifier
+ // and does not represent a real device
+ if (isWinPTY)
+ throw new IOException("Slave name is not valid"); //$NON-NLS-1$
+ }
+
+ public String getSlaveName() {
+ return slave;
+ }
+
+ public MasterFD getMasterFD() {
+ return new MasterFD();
+ }
+
+ /**
+ * @return whether this pseudo terminal is for use with the Eclipse console.
+ *
+ * @since 5.2
+ */
+ public final boolean isConsole() {
+ return console;
+ }
+
+ public PTYOutputStream getOutputStream() {
+ return out;
+ }
+
+ public PTYInputStream getInputStream() {
+ return in;
+ }
+
+ /**
+ * Change terminal window size to given width and height.
+ * <p>
+ * This should only be used when the pseudo terminal is configured
+ * for use with a terminal emulation, i.e. when {@link #isConsole()}
+ * returns <code>false</code>.
+ * </p>
+ * <p>
+ * <strong>Note:</strong> This method may not be supported on all platforms.
+ * Known platforms which support this method are:
+ * <code>linux-x86</code>, <code>linux-x86_64</code>, <code>solaris-sparc</code>, <code>macosx</code>.
+ * </p>
+ *
+ * @since 5.2
+ */
+ public final void setTerminalSize(int width, int height) {
+ try {
+ change_window_size(master, width, height);
+ } catch (UnsatisfiedLinkError ule) {
+ if (!setTerminalSizeErrorAlreadyLogged) {
+ setTerminalSizeErrorAlreadyLogged = true;
+ CSpawnerPlugin.log(Messages.Util_exception_cannotSetTerminalSize, ule);
+ }
+ }
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ * @since 5.6
+ */
+ public int exec_pty(Spawner spawner, String[] cmdarray, String[] envp, String dir, int[] chan) throws IOException {
+ if (isWinPTY) {
+ return exec2(cmdarray, envp, dir, chan, slave, master, console);
+ } else {
+ return spawner.exec2(cmdarray, envp, dir, chan, slave, master, console);
+ }
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ * @since 5.6
+ */
+ public int waitFor(Spawner spawner, int pid) {
+ if (isWinPTY) {
+ return waitFor(master, pid);
+ } else {
+ return spawner.waitFor(pid);
+ }
+ }
+
+ native String openMaster(boolean console);
+
+ native int change_window_size(int fdm, int width, int height);
+
+ /**
+ * Native method when executing with a terminal emulation (winpty only).
+ */
+ native int exec2(String[] cmdarray, String[] envp, String dir, int[] chan, String slaveName, int masterFD, boolean console) throws IOException;
+
+ /**
+ * Native method to wait for process to terminate (winpty only).
+ */
+ native int waitFor(int masterFD, int processID);
+
+ static {
+ try {
+ System.loadLibrary("pty"); //$NON-NLS-1$
+ hasPTY = true;
+ isWinPTY = Platform.OS_WIN32.equals(Platform.getOS());
+ // on windows console mode is not supported except for experimental use
+ // to enable it, set system property org.eclipse.cdt.core.winpty_console_mode=true
+ isConsoleModeSupported = !isWinPTY || Boolean.getBoolean("org.eclipse.cdt.core.winpty_console_mode"); //$NON-NLS-1$
+ } catch (SecurityException e) {
+ // Comment out it worries the users too much
+ //CCorePlugin.log(e);
+ } catch (UnsatisfiedLinkError e) {
+ // Comment out it worries the users too much
+ //CCorePlugin.log(e);
+ }
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java
new file mode 100644
index 00000000000..c2506a006d2
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems - bug 286162
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.utils.pty;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.cdt.internal.core.spawner.Messages;
+import org.eclipse.cdt.utils.pty.PTY.MasterFD;
+
+class PTYInputStream extends InputStream {
+
+ MasterFD master;
+
+ /**
+ * From a Unix valid file descriptor set a Reader.
+ * @param fd file descriptor.
+ */
+ public PTYInputStream(MasterFD fd) {
+ master = fd;
+ }
+
+ /**
+ * Implementation of read for the InputStream.
+ *
+ * @exception IOException on error.
+ */
+ @Override
+ public int read() throws IOException {
+ byte b[] = new byte[1];
+ if (1 != read(b, 0, 1))
+ return -1;
+ return b[0];
+ }
+
+ /**
+ * @see InputStream#read(byte[], int, int)
+ */
+ @Override
+ public int read(byte[] buf, int off, int len) throws IOException {
+ if (buf == null) {
+ throw new NullPointerException();
+ } else if ((off < 0) || (off > buf.length)
+ || (len < 0) || ((off + len) > buf.length)
+ || ((off + len) < 0)) {
+ throw new IndexOutOfBoundsException();
+ } else if (len == 0) {
+ return 0;
+ }
+ byte[] tmpBuf = new byte[len];
+
+ len = read0(master.getFD(), tmpBuf, len);
+ if (len <= 0)
+ return -1;
+
+ System.arraycopy(tmpBuf, 0, buf, off, len);
+ return len;
+ }
+
+ /**
+ * Close the Reader
+ * @exception IOException on error.
+ */
+ @Override
+ public void close() throws IOException {
+ if (master.getFD() == -1)
+ return;
+ close0(master.getFD());
+ // ignore error on close - see bug 286162
+// if (status == -1)
+// throw new IOException(Messages.Util_exception_closeError);
+ master.setFD(-1);
+ }
+
+ @Override
+ protected void finalize() throws IOException {
+ close();
+ }
+
+ private native int read0(int fd, byte[] buf, int len) throws IOException;
+ private native int close0(int fd) throws IOException;
+
+ static {
+ System.loadLibrary("pty"); //$NON-NLS-1$
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java
new file mode 100644
index 00000000000..f6096e5a443
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.utils.pty;
+
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.eclipse.cdt.utils.pty.PTY.MasterFD;
+
+public class PTYOutputStream extends OutputStream {
+
+ MasterFD master;
+
+ /**
+ * From a Unix valid file descriptor set a Reader.
+ * @param fd file descriptor.
+ */
+ public PTYOutputStream(MasterFD fd) {
+ master = fd;
+ }
+
+ /**
+ * @see OutputStream#write(byte[], int, int)
+ */
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ if (b == null) {
+ throw new NullPointerException();
+ } else if (
+ (off < 0)
+ || (off > b.length)
+ || (len < 0)
+ || ((off + len) > b.length)
+ || ((off + len) < 0)) {
+ throw new IndexOutOfBoundsException();
+ } else if (len == 0) {
+ return;
+ }
+ byte[] tmpBuf = new byte[len];
+ System.arraycopy(b, off, tmpBuf, off, len);
+ write0(master.getFD(), tmpBuf, len);
+ }
+ /**
+ * Implementation of read for the InputStream.
+ *
+ * @exception IOException on error.
+ */
+ @Override
+ public void write(int b) throws IOException {
+ byte[] buf = new byte[1];
+ buf[0] = (byte) b;
+ write(buf, 0, 1);
+ }
+
+ /**
+ * Close the Reader
+ * @exception IOException on error.
+ */
+ @Override
+ public void close() throws IOException {
+ if (master.getFD() == -1)
+ return;
+ int status = close0(master.getFD());
+ if (status == -1)
+ throw new IOException("close error"); //$NON-NLS-1$
+ master.setFD(-1);
+ }
+
+ @Override
+ protected void finalize() throws IOException {
+ close();
+ }
+
+ private native int write0(int fd, byte[] b, int len) throws IOException;
+ private native int close0(int fd) throws IOException;
+
+ static {
+ System.loadLibrary("pty"); //$NON-NLS-1$
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
new file mode 100644
index 00000000000..39c94d806e9
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.utils.spawner;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * This class provides environment variables supplied as {@link Properties} class.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class EnvironmentReader {
+ private static Properties envVars = null;
+ private static Properties envVarsNormalized = null;
+ private static ArrayList<String> rawVars = null;
+
+ private static synchronized void init() {
+ if (envVars==null) {
+ envVars = new Properties();
+ // on Windows environment variable names are case-insensitive
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ envVarsNormalized = new Properties();
+ } else {
+ envVarsNormalized = envVars;
+ }
+ rawVars = new ArrayList<String>();
+ Map<String, String> envMap = System.getenv();
+ for (String var : envMap.keySet()) {
+ String value = envMap.get(var);
+ envVars.setProperty(var, value);
+ if (envVarsNormalized!=envVars) {
+ envVarsNormalized.setProperty(var.toUpperCase(), value);
+ }
+ rawVars.add(var + "=" + value); //$NON-NLS-1$
+ }
+ rawVars.trimToSize();
+ }
+ }
+
+ /**
+ * @return list of environment variables.
+ */
+ public static Properties getEnvVars() {
+ init();
+ return (Properties) envVars.clone();
+ }
+
+ /**
+ * @param key - name of environment variable (without $ sign).
+ * @return value of environment variable.
+ */
+ public static String getEnvVar(String key) {
+ init();
+ return envVarsNormalized.getProperty(key);
+ }
+
+ /**
+ * @deprecated since CDT 6.1. {@link #getEnvVars()} provides all the data.
+ */
+ @Deprecated
+ public static String[] getRawEnvVars() {
+ init();
+ return rawVars.toArray(new String[rawVars.size()]);
+ }
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java
new file mode 100644
index 00000000000..66c0a176cc8
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.utils.spawner;
+
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.cdt.internal.core.spawner.CSpawnerPlugin;
+import org.eclipse.cdt.internal.core.spawner.Messages;
+import org.eclipse.cdt.utils.pty.PTY;
+
+/**
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class ProcessFactory {
+
+ static private ProcessFactory instance;
+ private boolean hasSpawner;
+ private Runtime runtime;
+
+ private ProcessFactory() {
+ hasSpawner = false;
+ String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
+ runtime = Runtime.getRuntime();
+ try {
+ // Spawner does not work for Windows 98 fallback
+ if (OS != null && OS.equals("windows 98")) { //$NON-NLS-1$
+ hasSpawner = false;
+ } else {
+ System.loadLibrary("spawner"); //$NON-NLS-1$
+ hasSpawner = true;
+ }
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (UnsatisfiedLinkError e) {
+ CSpawnerPlugin.log(e.getMessage());
+ }
+ }
+
+ public static ProcessFactory getFactory() {
+ if (instance == null)
+ instance = new ProcessFactory();
+ return instance;
+ }
+
+ public Process exec(String cmd) throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmd);
+ return runtime.exec(cmd);
+ }
+
+ public Process exec(String[] cmdarray) throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmdarray);
+ return runtime.exec(cmdarray);
+ }
+
+ public Process exec(String[] cmdarray, String[] envp) throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmdarray, envp);
+ return runtime.exec(cmdarray, envp);
+ }
+
+ public Process exec(String cmd, String[] envp) throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmd, envp);
+ return runtime.exec(cmd, envp);
+ }
+
+ public Process exec(String cmd, String[] envp, File dir)
+ throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmd, envp, dir);
+ return runtime.exec(cmd, envp, dir);
+ }
+
+ public Process exec(String cmdarray[], String[] envp, File dir)
+ throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmdarray, envp, dir);
+ return runtime.exec(cmdarray, envp, dir);
+ }
+
+ public Process exec(String cmdarray[], String[] envp, File dir, PTY pty)
+ throws IOException {
+ if (hasSpawner)
+ return new Spawner(cmdarray, envp, dir, pty);
+ throw new UnsupportedOperationException(Messages.Util_exception_cannotCreatePty);
+ }
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/Spawner.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/Spawner.java
new file mode 100644
index 00000000000..e4e69a8ebff
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/Spawner.java
@@ -0,0 +1,517 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems - bug 248071, bug 286162
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.utils.spawner;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.StringTokenizer;
+
+import org.eclipse.cdt.internal.core.spawner.CSpawnerPlugin;
+import org.eclipse.cdt.internal.core.spawner.Messages;
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.NLS;
+
+public class Spawner extends Process {
+
+ public int NOOP = 0;
+ public int HUP = 1;
+ public int KILL = 9;
+ public int TERM = 15;
+
+ /**
+ * On Windows, what this does is far from easy to explain.
+ * Some of the logic is in the JNI code, some in the spawner.exe code.
+ *
+ * <ul>
+ * <li>If the process this is being raised against was launched by us (the Spawner)
+ * <ul>
+ * <li>If the process is a cygwin program (has the cygwin1.dll loaded), then issue a 'kill -SIGINT'. If
+ * the 'kill' utility isn't available, send the process a CTRL-C
+ * <li>If the process is <i>not</i> a cygwin program, send the process a CTRL-C
+ * </ul>
+ * <li>If the process this is being raised against was <i>not</i> launched by us, use
+ * DebugBreakProcess to interrupt it (sending a CTRL-C is easy only if we share a console
+ * with the target process)
+ * </ul>
+ *
+ * On non-Windows, raising this just raises a POSIX SIGINT
+ *
+ */
+ public int INT = 2;
+
+ /**
+ * A fabricated signal number for use on Windows only. Tells the starter program to send a CTRL-C
+ * regardless of whether the process is a Cygwin one or not.
+ *
+ * @since 5.2
+ */
+ public int CTRLC = 1000; // arbitrary high number to avoid collision
+
+ int pid = 0;
+ int status;
+ final int[] fChannels = { -1, -1, -1 };
+ boolean isDone;
+ OutputStream out;
+ InputStream in;
+ InputStream err;
+ private PTY fPty;
+
+ public Spawner(String command, boolean bNoRedirect) throws IOException {
+ StringTokenizer tokenizer = new StringTokenizer(command);
+ String[] cmdarray = new String[tokenizer.countTokens()];
+ for (int n = 0; tokenizer.hasMoreTokens(); n++)
+ cmdarray[n] = tokenizer.nextToken();
+ if (bNoRedirect)
+ exec_detached(cmdarray, new String[0], "."); //$NON-NLS-1$
+ else
+ exec(cmdarray, new String[0], "."); //$NON-NLS-1$
+ }
+ /**
+ * Executes the specified command and arguments in a separate process with the
+ * specified environment and working directory.
+ **/
+ protected Spawner(String[] cmdarray, String[] envp, File dir) throws IOException {
+ String dirpath = "."; //$NON-NLS-1$
+ if (dir != null)
+ dirpath = dir.getAbsolutePath();
+ exec(cmdarray, envp, dirpath);
+ }
+
+ protected Spawner(String[] cmdarray, String[] envp, File dir, PTY pty) throws IOException {
+ String dirpath = "."; //$NON-NLS-1$
+ if (dir != null)
+ dirpath = dir.getAbsolutePath();
+ fPty = pty;
+ exec_pty(cmdarray, envp, dirpath, pty);
+ }
+ /**
+ * Executes the specified string command in a separate process.
+ **/
+ protected Spawner(String command) throws IOException {
+ this(command, null);
+ }
+
+ /**
+ * Executes the specified command and arguments in a separate process.
+ **/
+ protected Spawner(String[] cmdarray) throws IOException {
+ this(cmdarray, null);
+ }
+
+ /**
+ * Executes the specified command and arguments in a separate process with the
+ * specified environment.
+ **/
+ protected Spawner(String[] cmdarray, String[] envp) throws IOException {
+ this(cmdarray, envp, null);
+ }
+
+ /**
+ * Executes the specified string command in a separate process with the specified
+ * environment.
+ **/
+ protected Spawner(String cmd, String[] envp) throws IOException {
+ this(cmd, envp, null);
+ }
+
+ /**
+ * Executes the specified string command in a separate process with the specified
+ * environment and working directory.
+ **/
+ protected Spawner(String command, String[] envp, File dir) throws IOException {
+ StringTokenizer tokenizer = new StringTokenizer(command);
+ String[] cmdarray = new String[tokenizer.countTokens()];
+ for (int n = 0; tokenizer.hasMoreTokens(); n++)
+ cmdarray[n] = tokenizer.nextToken();
+ String dirpath = "."; //$NON-NLS-1$
+ if (dir != null)
+ dirpath = dir.getAbsolutePath();
+ exec(cmdarray, envp, dirpath);
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ closeUnusedStreams();
+ }
+
+ /**
+ * See java.lang.Process#getInputStream ();
+ * The client is responsible for closing the stream explicitly.
+ **/
+ @Override
+ public synchronized InputStream getInputStream() {
+ if(null == in) {
+ if (fPty != null) {
+ in = fPty.getInputStream();
+ } else {
+ in = new SpawnerInputStream(fChannels[1]);
+ }
+ }
+ return in;
+ }
+
+ /**
+ * See java.lang.Process#getOutputStream ();
+ * The client is responsible for closing the stream explicitly.
+ **/
+ @Override
+ public synchronized OutputStream getOutputStream() {
+ if(null == out) {
+ if (fPty != null) {
+ out = fPty.getOutputStream();
+ } else {
+ out = new SpawnerOutputStream(fChannels[0]);
+ }
+ }
+ return out;
+ }
+
+ /**
+ * See java.lang.Process#getErrorStream ();
+ * The client is responsible for closing the stream explicitly.
+ **/
+ @Override
+ public synchronized InputStream getErrorStream() {
+ if(null == err) {
+ if (fPty != null && !fPty.isConsole()) {
+ // If PTY is used and it's not in "Console" mode, then stderr is
+ // redirected to the PTY's output stream. Therefore, return a
+ // dummy stream for error stream.
+ err = new InputStream() {
+ @Override
+ public int read() throws IOException {
+ return -1;
+ }
+ };
+ } else {
+ err = new SpawnerInputStream(fChannels[2]);
+ }
+ }
+ return err;
+ }
+
+ /**
+ * See java.lang.Process#waitFor ();
+ **/
+ @Override
+ public synchronized int waitFor() throws InterruptedException {
+ while (!isDone) {
+ wait();
+ }
+
+ // For situations where the user does not call destroy(),
+ // we try to kill the streams that were not used here.
+ // We check for streams that were not created, we create
+ // them to attach to the pipes, and then we close them
+ // to release the pipes.
+ // Streams that were created by the client need to be
+ // closed by the client itself.
+ //
+ // But 345164
+ closeUnusedStreams();
+ return status;
+ }
+
+ /**
+ * See java.lang.Process#exitValue ();
+ **/
+ @Override
+ public synchronized int exitValue() {
+ if (!isDone) {
+ throw new IllegalThreadStateException("Process not Terminated"); //$NON-NLS-1$
+ }
+ return status;
+ }
+
+ /**
+ * See java.lang.Process#destroy ();
+ *
+ * Clients are responsible for explicitly closing any streams
+ * that they have requested through
+ * getErrorStream(), getInputStream() or getOutputStream()
+ **/
+ @Override
+ public synchronized void destroy() {
+ // Sends the TERM
+ terminate();
+
+ // Close the streams on this side.
+ //
+ // We only close the streams that were
+ // never used by any client.
+ // So, if the stream was not created yet,
+ // we create it ourselves and close it
+ // right away, so as to release the pipe.
+ // Note that even if the stream was never
+ // created, the pipe has been allocated in
+ // native code, so we need to create the
+ // stream and explicitly close it.
+ //
+ // We don't close streams the clients have
+ // created because we don't know when the
+ // client will be finished using them.
+ // It is up to the client to close those
+ // streams.
+ //
+ // But 345164
+ closeUnusedStreams();
+
+ // Grace before using the heavy gone.
+ if (!isDone) {
+ try {
+ wait(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+ if (!isDone) {
+ kill();
+ }
+ }
+
+ /**
+ * On Windows, interrupt the spawned program by using Cygwin's utility 'kill -SIGINT' if it's a Cgywin
+ * program, otherwise send it a CTRL-C. If Cygwin's 'kill' command is not available, send a CTRL-C. On
+ * linux, interrupt it by raising a SIGINT.
+ */
+ public int interrupt() {
+ return raise(pid, INT);
+ }
+
+ /**
+ * On Windows, interrupt the spawned program by send it a CTRL-C (even if it's a Cygwin program). On
+ * linux, interrupt it by raising a SIGINT.
+ *
+ * @since 5.2
+ */
+ public int interruptCTRLC() {
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ return raise(pid, CTRLC);
+ }
+ else {
+ return interrupt();
+ }
+ }
+
+ public int hangup() {
+ return raise(pid, HUP);
+ }
+
+ public int kill() {
+ return raise(pid, KILL);
+ }
+
+ public int terminate() {
+ return raise(pid, TERM);
+ }
+
+ public boolean isRunning() {
+ return (raise(pid, NOOP) == 0);
+ }
+
+ private void exec(String[] cmdarray, String[] envp, String dirpath) throws IOException {
+ String command = cmdarray[0];
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkExec(command);
+ if (envp == null)
+ envp = new String[0];
+
+ Reaper reaper = new Reaper(cmdarray, envp, dirpath);
+ reaper.setDaemon(true);
+ reaper.start();
+
+ // Wait until the subprocess is started or error.
+ synchronized (this) {
+ while (pid == 0) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ // Check for errors.
+ if (pid == -1) {
+ throw new IOException(reaper.getErrorMessage());
+ }
+ }
+
+ private void exec_pty(String[] cmdarray, String[] envp, String dirpath, final PTY pty) throws IOException {
+ String command = cmdarray[0];
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkExec(command);
+ if (envp == null)
+ envp = new String[0];
+
+ Reaper reaper = new Reaper(cmdarray, envp, dirpath) {
+ @Override
+ int execute(String[] cmd, String[] env, String dir, int[] channels) throws IOException {
+ return pty.exec_pty(Spawner.this, cmd, env, dir, channels);
+ }
+
+ @Override
+ protected int waitFor(int pid) {
+ return pty.waitFor(Spawner.this, pid);
+ }
+ };
+ reaper.setDaemon(true);
+ reaper.start();
+
+ // Wait until the subprocess is started or error.
+ synchronized (this) {
+ while (pid == 0) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ // Check for errors.
+ if (pid == -1) {
+ throw new IOException("Exec_tty error:" + reaper.getErrorMessage()); //$NON-NLS-1$
+ }
+ }
+
+ public void exec_detached(String[] cmdarray, String[] envp, String dirpath) throws IOException {
+ String command = cmdarray[0];
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkExec(command);
+
+ if (envp == null)
+ envp = new String[0];
+ pid = exec1(cmdarray, envp, dirpath);
+ if (pid == -1) {
+ throw new IOException("Exec error"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Close any streams not used by clients.
+ */
+ private synchronized void closeUnusedStreams() {
+ try {
+ if(null == err)
+ getErrorStream().close();
+ } catch (IOException e) {}
+ try {
+ if(null == in)
+ getInputStream().close();
+ } catch (IOException e) {}
+ try {
+ if(null == out)
+ getOutputStream().close();
+ } catch (IOException e) {}
+ }
+
+ /**
+ * Native method use in normal exec() calls.
+ */
+ native int exec0( String[] cmdarray, String[] envp, String dir, int[] chan) throws IOException;
+
+ /**
+ * Native method use in no redirect meaning to streams will created.
+ */
+ native int exec1( String[] cmdarray, String[] envp, String dir) throws IOException;
+
+ /**
+ * Native method when executing with a terminal emulation.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public native int exec2( String[] cmdarray, String[] envp, String dir, int[] chan, String slaveName, int masterFD, boolean console) throws IOException;
+
+ /**
+ * Native method to drop a signal on the process with pid.
+ */
+ public native int raise(int processID, int sig);
+
+ /**
+ * Native method to wait(3) for process to terminate.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public native int waitFor(int processID);
+
+ static {
+ try {
+ System.loadLibrary("spawner"); //$NON-NLS-1$
+ } catch (SecurityException e) {
+ CSpawnerPlugin.log(e);
+ } catch (UnsatisfiedLinkError e) {
+ CSpawnerPlugin.log(e);
+ }
+ }
+
+ // Spawn a thread to handle the forking and waiting
+ // We do it this way because on linux the SIGCHLD is
+ // send to the one thread. So do the forking and
+ // the wait in the same thread.
+ class Reaper extends Thread {
+ String[] fCmdarray;
+ String[] fEnvp;
+ String fDirpath;
+ volatile Throwable fException;
+
+ public Reaper(String[] array, String[] env, String dir) {
+ super("Spawner Reaper"); //$NON-NLS-1$
+ fCmdarray = array;
+ fEnvp = env;
+ fDirpath = dir;
+ fException = null;
+ }
+
+ int execute(String[] cmdarray, String[] envp, String dir, int[] channels) throws IOException {
+ return exec0(cmdarray, envp, dir, channels);
+ }
+
+ int waitFor(int pid) {
+ return Spawner.this.waitFor(pid);
+ }
+
+ @Override
+ public void run() {
+ int _pid;
+ try {
+ _pid = execute(fCmdarray, fEnvp, fDirpath, fChannels);
+ } catch (Exception e) {
+ _pid = -1;
+ fException= e;
+ }
+
+ // Tell spawner that the process started.
+ synchronized (Spawner.this) {
+ pid = _pid;
+ Spawner.this.notifyAll();
+ }
+
+ if (_pid != -1) {
+ // Sync with spawner and notify when done.
+ status = waitFor(pid);
+ synchronized (Spawner.this) {
+ isDone = true;
+ Spawner.this.notifyAll();
+ }
+ }
+ }
+
+ public String getErrorMessage() {
+ final String reason= fException != null ? fException.getMessage() : "Unknown reason"; //$NON-NLS-1$
+ return NLS.bind(Messages.Util_error_cannotRun, fCmdarray[0], reason);
+ }
+ }
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java
new file mode 100644
index 00000000000..dfdbe060e8e
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.utils.spawner;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.cdt.internal.core.spawner.Messages;
+
+class SpawnerInputStream extends InputStream {
+ private int fd;
+
+ /**
+ * From a Unix valid file descriptor set a Reader.
+ * @param fd file descriptor.
+ */
+ public SpawnerInputStream(int fd) {
+ this.fd = fd;
+ }
+
+ /**
+ * Implementation of read for the InputStream.
+ *
+ * @exception IOException on error.
+ */
+ @Override
+ public int read() throws IOException {
+ byte b[] = new byte[1];
+ if (1 != read(b, 0, 1))
+ return -1;
+ return b[0];
+ }
+
+ /**
+ * @see InputStream#read(byte[], int, int)
+ */
+ @Override
+ public int read(byte[] buf, int off, int len) throws IOException {
+ if (fd == -1) {
+ return -1;
+ }
+ if (buf == null) {
+ throw new NullPointerException();
+ } else if (
+ (off < 0)
+ || (off > buf.length)
+ || (len < 0)
+ || ((off + len) > buf.length)
+ || ((off + len) < 0)) {
+ throw new IndexOutOfBoundsException();
+ } else if (len == 0) {
+ return 0;
+ }
+ byte[] tmpBuf = off > 0 ? new byte[len] : buf;
+
+ len = read0(fd, tmpBuf, len);
+ if (len <= 0)
+ return -1;
+
+ if (tmpBuf != buf) {
+ System.arraycopy(tmpBuf, 0, buf, off, len);
+ }
+ return len;
+ }
+
+ /**
+ * Close the Reader
+ * @exception IOException on error.
+ */
+ @Override
+ public void close() throws IOException {
+ if (fd == -1)
+ return;
+ int status = close0(fd);
+ if (status == -1)
+ throw new IOException(Messages.Util_exception_closeError);
+ fd = -1;
+ }
+
+ @Override
+ public int available() throws IOException {
+ if (fd == -1) {
+ return 0;
+ }
+ try {
+ return available0(fd);
+ }
+ catch (UnsatisfiedLinkError e) {
+ // for those platforms that do not implement available0
+ return super.available();
+ }
+ }
+
+ @Override
+ protected void finalize() throws IOException {
+ close();
+ }
+
+ private native int read0(int fileDesc, byte[] buf, int len) throws IOException;
+ private native int close0(int fileDesc) throws IOException;
+ private native int available0(int fileDesc) throws IOException;
+
+ static {
+ System.loadLibrary("spawner"); //$NON-NLS-1$
+ }
+
+
+}
diff --git a/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java
new file mode 100644
index 00000000000..e3c8014f6c8
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.utils.spawner;
+
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class SpawnerOutputStream extends OutputStream {
+ private int fd;
+
+ /**
+ * From a Unix valid file descriptor set a Reader.
+ * @param fd file descriptor.
+ */
+ public SpawnerOutputStream(int fd) {
+ this.fd = fd;
+ }
+
+ /**
+ * @see OutputStream#write(byte[], int, int)
+ */
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ if (b == null) {
+ throw new NullPointerException();
+ } else if (
+ (off < 0)
+ || (off > b.length)
+ || (len < 0)
+ || ((off + len) > b.length)
+ || ((off + len) < 0)) {
+ throw new IndexOutOfBoundsException();
+ } else if (len == 0) {
+ return;
+ }
+ byte[] tmpBuf = new byte[len];
+ System.arraycopy(b, off, tmpBuf, off, len);
+ write0(fd, tmpBuf, len);
+ }
+ /**
+ * Implementation of read for the InputStream.
+ *
+ * @exception IOException on error.
+ */
+ @Override
+ public void write(int b) throws IOException {
+ byte[] buf = new byte[1];
+ buf[0] = (byte) b;
+ write(buf, 0, 1);
+ }
+
+ /**
+ * Close the Reader
+ * @exception IOException on error.
+ */
+ @Override
+ public void close() throws IOException {
+ if (fd == -1)
+ return;
+ int status = close0(fd);
+ if (status == -1)
+ throw new IOException("close error"); //$NON-NLS-1$
+ fd = -1;
+ }
+
+ @Override
+ protected void finalize() throws IOException {
+ close();
+ }
+
+ private native int write0(int fd, byte[] b, int len) throws IOException;
+ private native int close0(int fd);
+
+ static {
+ System.loadLibrary("spawner"); //$NON-NLS-1$
+ }
+
+}

Back to the top