diff options
author | eutarass | 2010-06-11 18:48:17 +0000 |
---|---|---|
committer | eutarass | 2010-06-11 18:48:17 +0000 |
commit | 01bb7e8cf6cb49d2ab587696514b410bb049c1fb (patch) | |
tree | 70b6c9435ac091a24ecf264e0e21f0fd6724f866 /plugins | |
parent | 869c7c4ead7a29b37c1182ae726789e18e4f4596 (diff) | |
download | org.eclipse.tcf-01bb7e8cf6cb49d2ab587696514b410bb049c1fb.tar.gz org.eclipse.tcf-01bb7e8cf6cb49d2ab587696514b410bb049c1fb.tar.xz org.eclipse.tcf-01bb7e8cf6cb49d2ab587696514b410bb049c1fb.zip |
Deleted obsolete TCF/DSF integration plugins. Latest TCF/DSF integration code is part of EDC project.
Diffstat (limited to 'plugins')
42 files changed, 0 insertions, 6119 deletions
diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/.classpath b/plugins/org.eclipse.tm.tcf.dsf.ui/.classpath deleted file mode 100644 index 12d928036..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="**/.svn/*" kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/.project b/plugins/org.eclipse.tm.tcf.dsf.ui/.project deleted file mode 100644 index 1f77460dc..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.tm.tcf.dsf.ui</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0bf81e2f5..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,272 +0,0 @@ -#Tue Feb 05 15:38:16 CET 2008 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,.svn/ -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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=80 -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=1 -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=80 -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=8 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=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=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=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.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=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -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=space -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 -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 55a9abb5d..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Wed Jan 09 12:21:39 PST 2008
-eclipse.preferences.version=1
-formatter_profile=_Java STD
-formatter_settings_version=11
diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.tcf.dsf.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 120a936ed..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.tcf.dsf.ui;singleton:=true -Bundle-Version: 0.2.0.qualifier -Bundle-Activator: org.eclipse.tm.internal.tcf.dsf.ui.Activator -Bundle-Vendor: %providerName -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.dd.dsf.debug, - org.eclipse.dd.dsf.debug.ui, - org.eclipse.dd.dsf, - org.eclipse.dd.dsf.ui, - org.eclipse.debug.ui, - org.eclipse.tm.tcf.debug, - org.eclipse.tm.tcf.debug.ui, - org.eclipse.tm.tcf.dsf -Import-Package: org.eclipse.tm.tcf.core;version="0.2.0", - org.eclipse.tm.tcf.protocol;version="0.2.0", - org.eclipse.tm.tcf.services;version="0.2.0", - org.eclipse.tm.tcf.util;version="0.2.0", - org.eclipse.cdt.debug.core.model -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/about.html b/plugins/org.eclipse.tm.tcf.dsf.ui/about.html deleted file mode 100644 index 6c5b3615b..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!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>January 10, 2008</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/plugins/org.eclipse.tm.tcf.dsf.ui/build.properties b/plugins/org.eclipse.tm.tcf.dsf.ui/build.properties deleted file mode 100644 index 4785ce898..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2010 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: -# Wind River Systems - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html,\ - icons/,\ - plugin.properties -src.includes = about.html diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/icons/tcf.gif b/plugins/org.eclipse.tm.tcf.dsf.ui/icons/tcf.gif Binary files differdeleted file mode 100644 index 3198679ae..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/icons/tcf.gif +++ /dev/null diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.properties b/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.properties deleted file mode 100644 index bec289046..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2010 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: -# Wind River Systems - initial implementation -############################################################################### -pluginName = TCF/DSF Integration UI (Incubation) -providerName = Eclipse.org - DSDP - diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.xml b/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.xml deleted file mode 100644 index a34754f3f..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/plugin.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?><!--
- Copyright (c) 2010 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:
- Wind River Systems - initial API and implementation
- -->
- -<plugin> - - <extension point="org.eclipse.tm.tcf.startup"/> - - <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"> - <launchConfigurationTabGroup - type="org.eclipse.tm.tcf.dsf.LaunchConfigurationType" - class="org.eclipse.tm.internal.tcf.dsf.ui.launch.LaunchDialogTabGroup" - id="org.eclipse.dd.dsf.mi.launch.localRunLaunchTabGroup"> - </launchConfigurationTabGroup> - </extension> - - <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"> - <launchConfigurationTypeImage - icon="icons/tcf.gif" - configTypeID="org.eclipse.tm.tcf.dsf.LaunchConfigurationType" - id="org.eclipse.tm.tcf.dsf.LaunchImage"> - </launchConfigurationTypeImage> - </extension> - - <extension point="org.eclipse.core.runtime.adapters"> - <factory - class="org.eclipse.tm.internal.tcf.dsf.ui.AdapterFactory" - adaptableType="org.eclipse.tm.internal.tcf.dsf.launch.TCFDSFLaunch"> - <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider"/> - <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory"/> - <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory"/> - <adapter type="org.eclipse.debug.core.commands.ITerminateHandler"/> - </factory> - </extension> - - <extension point="org.eclipse.debug.ui.memoryRenderings">
- <renderingBindings
- defaultIds="org.eclipse.debug.ui.rendering.raw_memory"
- primaryId="org.eclipse.debug.ui.rendering.raw_memory"
- renderingIds="org.eclipse.debug.ui.rendering.raw_memory,org.eclipse.debug.ui.rendering.ascii,org.eclipse.debug.ui.rendering.signedint,org.eclipse.debug.ui.rendering.unsignedint">
- <enablement>
- <instanceof value="org.eclipse.dd.dsf.debug.model.DsfMemoryBlock"/>
- </enablement>
- </renderingBindings>
- </extension>
-
-</plugin> diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/Activator.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/Activator.java deleted file mode 100644 index f98a66f6a..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.tm.tcf.dsf.ui"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/AdapterFactory.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/AdapterFactory.java deleted file mode 100644 index 87c61fe22..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/AdapterFactory.java +++ /dev/null @@ -1,238 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.debug.core.model.ISteppingModeTarget; -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.dd.dsf.concurrent.Immutable; -import org.eclipse.dd.dsf.debug.ui.actions.DsfResumeCommand; -import org.eclipse.dd.dsf.debug.ui.actions.DsfStepIntoCommand; -import org.eclipse.dd.dsf.debug.ui.actions.DsfStepOverCommand; -import org.eclipse.dd.dsf.debug.ui.actions.DsfStepReturnCommand; -import org.eclipse.dd.dsf.debug.ui.actions.DsfSteppingModeTarget; -import org.eclipse.dd.dsf.debug.ui.actions.DsfSuspendCommand; -import org.eclipse.dd.dsf.debug.ui.sourcelookup.DsfSourceDisplayAdapter; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.ui.concurrent.DisplayDsfExecutor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchesListener2; -import org.eclipse.debug.core.commands.IResumeHandler; -import org.eclipse.debug.core.commands.IStepIntoHandler; -import org.eclipse.debug.core.commands.IStepOverHandler; -import org.eclipse.debug.core.commands.IStepReturnHandler; -import org.eclipse.debug.core.commands.ISuspendHandler; -import org.eclipse.debug.core.commands.ITerminateHandler; -import org.eclipse.debug.core.model.IDebugModelProvider; -import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory; -import org.eclipse.debug.ui.sourcelookup.ISourceDisplay; -import org.eclipse.swt.widgets.Display; -import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants; -import org.eclipse.tm.internal.tcf.dsf.launch.TCFDSFLaunch; -import org.eclipse.tm.internal.tcf.dsf.ui.actions.TcfTerminateCommand; -import org.eclipse.tm.internal.tcf.dsf.ui.viewmodel.ViewModelAdapter; -import org.eclipse.tm.tcf.protocol.Protocol; -import org.eclipse.ui.PlatformUI; - - -@SuppressWarnings("restriction") -public class AdapterFactory implements IAdapterFactory, DsfSession.SessionEndedListener, ILaunchesListener2 { - - @Immutable - private final class SessionAdapterSet { - - private final DsfSession session; - final ViewModelAdapter view_model_adapter; - final DsfSourceDisplayAdapter source_display_adapter; - final DsfStepIntoCommand step_into_command; - final DsfStepOverCommand step_over_command; - final DsfStepReturnCommand step_return_command; - final DsfSuspendCommand suspend_command; - final DsfResumeCommand resume_command; - final DsfSteppingModeTarget steppin_mode_target; - final TcfTerminateCommand terminate_command; - final IDebugModelProvider debug_model_provider; - final TCFDSFLaunch lunch; - //final BreakpointCommand breakpoint_command; - //final DsfMemoryBlockRetrieval memory_retrieval; - - SessionAdapterSet(DsfSession session, TCFDSFLaunch launch) { - this.session = session; - - view_model_adapter = new ViewModelAdapter(session, launch); - - if (launch.getSourceLocator() instanceof ISourceLookupDirector) { - source_display_adapter = new DsfSourceDisplayAdapter(session, - (ISourceLookupDirector)launch.getSourceLocator()); - } - else { - source_display_adapter = null; - } - session.registerModelAdapter(ISourceDisplay.class, source_display_adapter); - - steppin_mode_target = new DsfSteppingModeTarget(); - step_into_command = new DsfStepIntoCommand(session, steppin_mode_target); - step_over_command = new DsfStepOverCommand(session, steppin_mode_target); - step_return_command = new DsfStepReturnCommand(session); - suspend_command = new DsfSuspendCommand(session); - resume_command = new DsfResumeCommand(session); - terminate_command = new TcfTerminateCommand(session); - - //breakpoint_command = new BreakpointCommand(); - //memory_retrieval = new DsfMemoryBlockRetrieval(ITCFConstants.ID_TCF_DEBUG_MODEL, ); - session.registerModelAdapter(ISteppingModeTarget.class, steppin_mode_target); - session.registerModelAdapter(IStepIntoHandler.class, step_into_command); - session.registerModelAdapter(IStepOverHandler.class, step_over_command); - session.registerModelAdapter(IStepReturnHandler.class, step_return_command); - session.registerModelAdapter(ISuspendHandler.class, suspend_command); - session.registerModelAdapter(IResumeHandler.class, resume_command); - session.registerModelAdapter(ITerminateHandler.class, terminate_command); - //session.registerModelAdapter(IToggleBreakpointsTarget.class, breakpoint_command); - - debug_model_provider = new IDebugModelProvider() { - // @see org.eclipse.debug.core.model.IDebugModelProvider#getModelIdentifiers() - public String[] getModelIdentifiers() { - return new String[] { ITCFConstants.ID_TCF_DEBUG_MODEL }; - } - }; - session.registerModelAdapter(IDebugModelProvider.class, debug_model_provider); - - lunch = launch; - - /* - * Registering the launch as an adapter, ensures that this launch, - * and debug model ID will be associated with all DMContexts from this - * session. - */ - session.registerModelAdapter(ILaunch.class, lunch); - } - - void dispose() { - view_model_adapter.dispose(); - - session.unregisterModelAdapter(ISourceDisplay.class); - if (source_display_adapter != null) source_display_adapter.dispose(); - - session.unregisterModelAdapter(IStepIntoHandler.class); - session.unregisterModelAdapter(IStepOverHandler.class); - session.unregisterModelAdapter(IStepReturnHandler.class); - session.unregisterModelAdapter(ISuspendHandler.class); - session.unregisterModelAdapter(IResumeHandler.class); - session.unregisterModelAdapter(ITerminateHandler.class); - step_into_command.dispose(); - step_over_command.dispose(); - step_return_command.dispose(); - suspend_command.dispose(); - resume_command.dispose(); - terminate_command.dispose(); - } - } - - private static final Class<?>[] adapter_list = { - IElementContentProvider.class, - IColumnPresentationFactory.class, - IModelProxyFactory.class, - ITerminateHandler.class - }; - - private static final Map<String,SessionAdapterSet> session_adapter_set_map = - Collections.synchronizedMap(new HashMap<String,SessionAdapterSet>()); - - public AdapterFactory() { - assert session_adapter_set_map.isEmpty(); - DsfSession.addSessionEndedListener(this); - DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); - final Display display = PlatformUI.getWorkbench().getDisplay(); - display.asyncExec(new Runnable() { - public void run() { - final DisplayDsfExecutor executer = DisplayDsfExecutor.getDisplayDsfExecutor(display); - Protocol.invokeLater(new Runnable() { - public void run() { - Protocol.addCongestionMonitor(new Protocol.CongestionMonitor() { - public int getCongestionLevel() { - int level = executer.getQueue().size() / 4 - 100; - if (level > 100) level = 100; - return level; - } - }); - } - }); - } - }); - } - - @SuppressWarnings("unchecked") - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (!(adaptableObject instanceof TCFDSFLaunch)) return null; - - TCFDSFLaunch launch = (TCFDSFLaunch)adaptableObject; - - // Find the correct set of adapters based on the launch session-ID. If not found - // it means that we have a new launch and new session, and we have to create a - // new set of adapters. - DsfSession session = launch.getSession(); - if (session == null) return null; - - SessionAdapterSet adapter_set; - synchronized(session_adapter_set_map) { - adapter_set = session_adapter_set_map.get(session.getId()); - if (adapter_set == null) { - adapter_set = new SessionAdapterSet(session, launch); - session_adapter_set_map.put(session.getId(), adapter_set); - } - } - - // Returns the adapter type for the launch object. - if (adapterType.equals(IElementContentProvider.class)) return adapter_set.view_model_adapter; - if (adapterType.equals(IModelProxyFactory.class)) return adapter_set.view_model_adapter; - if (adapterType.equals(IColumnPresentationFactory.class)) return adapter_set.view_model_adapter; - if (adapterType.equals(ITerminateHandler.class)) return adapter_set.terminate_command; - return null; - } - - @SuppressWarnings("unchecked") - public Class[] getAdapterList() { - return adapter_list; - } - - public void sessionEnded(DsfSession session) { - } - - public void launchesTerminated(ILaunch[] launches) { - } - - public void launchesAdded(ILaunch[] launches) { - } - - public void launchesChanged(ILaunch[] launches) { - } - - public void launchesRemoved(ILaunch[] launches) { - // Dispose the set of adapters for a launch only after the launch is removed. - for (ILaunch launch : launches) { - if (launch instanceof TCFDSFLaunch) { - String id = ((TCFDSFLaunch)launch).getSession().getId(); - synchronized (session_adapter_set_map) { - if (session_adapter_set_map.containsKey(id)) { - session_adapter_set_map.remove(id).dispose(); - } - } - } - } - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/actions/TcfTerminateCommand.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/actions/TcfTerminateCommand.java deleted file mode 100644 index 6805299e4..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/actions/TcfTerminateCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui.actions; - -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IEnabledStateRequest; -import org.eclipse.debug.core.commands.ITerminateHandler; - -public class TcfTerminateCommand implements ITerminateHandler { - - public TcfTerminateCommand(DsfSession session) { - - } - - public void dispose() { - - } - - public void canExecute(IEnabledStateRequest request) { - // TODO Auto-generated method stub - - } - - public boolean execute(IDebugCommandRequest request) { - // TODO Auto-generated method stub - return false; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/launch/LaunchDialogTabGroup.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/launch/LaunchDialogTabGroup.java deleted file mode 100644 index 6ea052893..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/launch/LaunchDialogTabGroup.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui.launch; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.EnvironmentTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; -import org.eclipse.tm.internal.tcf.debug.ui.launch.TCFArgumentsTab; -import org.eclipse.tm.internal.tcf.debug.ui.launch.TCFTargetTab; - - -/** - * Launch configuration dialog tab group for TCF over DSF - */ -public class LaunchDialogTabGroup extends AbstractLaunchConfigurationTabGroup { - - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - setTabs(new ILaunchConfigurationTab[] { - new TCFTargetTab(), - new TCFArgumentsTab(), - new EnvironmentTab(), - new SourceLookupTab(), - new CommonTab() - }); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ExecutableContextLayoutNode.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ExecutableContextLayoutNode.java deleted file mode 100644 index d8b4c03e5..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ExecutableContextLayoutNode.java +++ /dev/null @@ -1,240 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Ericsson 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: - * Ericsson - Initial API and implementation - * Wind River Systems - reused for TCF connection type - *******************************************************************************/ - -package org.eclipse.tm.internal.tcf.dsf.ui.viewmodel; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.RejectedExecutionException; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.DsfRunnable; -import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.datamodel.IDMEvent; -import org.eclipse.dd.dsf.debug.service.IRunControl; -import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IExitedDMEvent; -import org.eclipse.dd.dsf.debug.service.IRunControl.IStartedDMEvent; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.ui.viewmodel.VMDelta; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.tm.internal.tcf.debug.model.TCFContextState; -import org.eclipse.tm.internal.tcf.dsf.ui.Activator; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFExecutionDMC; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFRunControl; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFStack; -import org.eclipse.tm.tcf.protocol.Protocol; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.eclipse.ui.PlatformUI; - - -@SuppressWarnings("restriction") -public class ExecutableContextLayoutNode extends AbstractDMVMNode implements IElementLabelProvider { - - public ExecutableContextLayoutNode(AbstractDMVMProvider provider, DsfSession session) { - super(provider, session, IRunControl.IExecutionDMContext.class); - } - - private void doneViewerUpdate(final IViewerUpdate req) { - PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { - public void run() { - req.done(); - } - }); - } - - @Override - protected void updateElementsInSessionThread(final IChildrenUpdate update) { - TCFDSFRunControl service = getServicesTracker().getService(TCFDSFRunControl.class); - if (service == null) { - update.setStatus(new Status(IStatus.ERROR, - Activator.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, - "Run Control service not available.", null)); //$NON-NLS-1$ - handleFailedUpdate(update); - return; - } - - final TCFDSFExecutionDMC dmc = findDmcInPath(update.getViewerInput(), - update.getElementPath(), TCFDSFExecutionDMC.class); - - service.getAllContexts(dmc, - new DataRequestMonitor<IExecutionDMContext[]>(getSession().getExecutor(), null) { - @Override - public void handleCompleted() { - if (!getStatus().isOK()) { - handleFailedUpdate(update); - } - else { - fillUpdateWithVMCs(update, getData()); - doneViewerUpdate(update); - } - } - } - ); - } - - public void update(final ILabelUpdate[] updates) { - try { - getSession().getExecutor().execute(new DsfRunnable() { - public void run() { - updateLabelInSessionThread(updates); - } - }); - } - catch (RejectedExecutionException e) { - for (ILabelUpdate update : updates) { - update.setStatus(new Status(IStatus.ERROR, - Activator.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, - "Cannot execute update request.", e)); //$NON-NLS-1$ - handleFailedUpdate(update); - } - } - } - - private void updateLabelInSessionThread(final ILabelUpdate[] updates) { - TCFDSFRunControl service = getServicesTracker().getService(TCFDSFRunControl.class); - if (service == null) { - for (final ILabelUpdate update : updates) { - update.setStatus(new Status(IStatus.ERROR, - Activator.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, - "Run Control service not available.", null)); //$NON-NLS-1$ - handleFailedUpdate(update); - } - return; - } - TCFDataCache<?> pending = null; - for (final ILabelUpdate update : updates) { - TCFDSFExecutionDMC dmc = (TCFDSFExecutionDMC)findDmcInPath(update.getViewerInput(), - update.getElementPath(), IContainerDMContext.class); - if (!dmc.run_control_context_cache.validate()) pending = dmc.run_control_context_cache; - else if (!dmc.run_control_state_cache.validate()) pending = dmc.run_control_state_cache; - } - if (pending != null) { - pending.wait(new Runnable() { - public void run() { - updateLabelInSessionThread(updates); - } - }); - return; - } - - for (final ILabelUpdate update : updates) { - TCFDSFExecutionDMC dmc = (TCFDSFExecutionDMC)findDmcInPath(update.getViewerInput(), - update.getElementPath(), IContainerDMContext.class); - - org.eclipse.tm.tcf.services.IRunControl.RunControlContext rc = dmc.run_control_context_cache.getData(); - String image = null; - if (rc == null) { - image = IDebugUIConstants.IMG_ACT_DEBUG; - } - else if (!rc.hasState()) { - image = IDebugUIConstants.IMG_OBJS_DEBUG_TARGET; - } - else { - TCFContextState state = dmc.run_control_state_cache.getData(); - if (state != null && state.is_suspended) { - image = IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED; - } - else { - image = IDebugUIConstants.IMG_OBJS_THREAD_RUNNING; - } - } - update.setImageDescriptor(DebugUITools.getImageDescriptor(image), 0); - - update.setLabel(dmc.getTcfContextId(), 0); - doneViewerUpdate(update); - } - } - - public int getDeltaFlags(Object e) { - if (e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) { - return IModelDelta.CONTENT; - } - if (e instanceof IRunControl.IResumedDMEvent || e instanceof IRunControl.ISuspendedDMEvent) { - return IModelDelta.STATE; - } - return IModelDelta.NO_CHANGE; - } - - private List<TCFDSFExecutionDMC> getPath(TCFDSFExecutionDMC dmc) { - List<TCFDSFExecutionDMC> list = new ArrayList<TCFDSFExecutionDMC>(); - while (dmc != null) { - list.add(dmc); - IDMContext[] up = dmc.getParents(); - dmc = null; - for (IDMContext c: up) { - if (c instanceof TCFDSFExecutionDMC) { - dmc = (TCFDSFExecutionDMC)c; - if (dmc.getTcfContextId() == null) dmc = null; - break; - } - } - } - return list; - } - - public void buildDelta(final Object e, final VMDelta parentDelta, int nodeOffset, final RequestMonitor rm) { - if (e instanceof IRunControl.IResumedDMEvent || e instanceof IRunControl.ISuspendedDMEvent) { - Protocol.invokeLater(new Runnable() { - public void run() { - TCFDSFStack.TCFFrameDMC frame = null; - TCFDSFExecutionDMC dmc = (TCFDSFExecutionDMC)((IDMEvent<?>)e).getDMContext(); - /* - if (e instanceof IRunControl.ISuspendedDMEvent) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service != null) { - TCFDataCache<?> cache = service.getFramesCache(dmc, null); - if (!cache.validate()) { - cache.wait(this); - return; - } - if (cache.getError() == null) { - frame = service.getTopFrame(dmc); - } - } - } - */ - ModelDelta delta = parentDelta; - List<TCFDSFExecutionDMC> list = getPath(dmc); - for (int i = list.size() - 1; i >= 0; i--) { - delta = delta.addNode(createVMContext(list.get(i)), - i == 0 ? IModelDelta.CONTENT | IModelDelta.STATE : 0); - } - if (frame != null) { - delta = delta.addNode(createVMContext(frame), - IModelDelta.EXPAND | IModelDelta.SELECT); - } - rm.done(); - } - }); - return; - } - else if (e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) { - parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT); - } - rm.done(); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/LaunchVMProvider.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/LaunchVMProvider.java deleted file mode 100644 index f39b764c6..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/LaunchVMProvider.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui.viewmodel; - -import java.util.concurrent.RejectedExecutionException; - -import org.eclipse.dd.dsf.concurrent.ThreadSafe; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StackFramesVMNode; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode.LaunchesEvent; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter; -import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.IVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchesListener2; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; - - -@SuppressWarnings("restriction") -public class LaunchVMProvider extends AbstractDMVMProvider -implements IDebugEventSetListener, ILaunchesListener2 { - - @ThreadSafe - public LaunchVMProvider(AbstractVMAdapter adapter, - IPresentationContext presentationContext, - DsfSession session, ILaunch launch) { - super(adapter, presentationContext, session); - - IRootVMNode launch_node = new LaunchRootVMNode(this); - setRootNode(launch_node); - - IVMNode threads_node = new ExecutableContextLayoutNode(this, getSession()); - addChildNodes(launch_node, new IVMNode[] { threads_node }); - - IVMNode stack_frames_node = new StackFramesVMNode(this, getSession()); - addChildNodes(threads_node, new IVMNode[] { stack_frames_node, threads_node }); - - DebugPlugin.getDefault().addDebugEventListener(this); - DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); - } - - - public void handleDebugEvents(final DebugEvent[] events) { - if (isDisposed()) return; - - // We're in session's executor thread. Re-dispatch to VM Adapter - // executor thread and then call root layout node. - try { - getExecutor().execute(new Runnable() { - public void run() { - if (isDisposed()) return; - - for (final DebugEvent event : events) { - handleEvent(event); - } - } - }); - } - catch (RejectedExecutionException e) { - // Ignore. This exception could be thrown if the provider is being - // shut down. - } - } - - @Override - public void dispose() { - DebugPlugin.getDefault().removeDebugEventListener(this); - DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); - super.dispose(); - } - - public void launchesAdded(ILaunch[] launches) { - handleLaunchesEvent(new LaunchesEvent(launches, LaunchesEvent.Type.ADDED)); - } - - public void launchesRemoved(ILaunch[] launches) { - handleLaunchesEvent(new LaunchesEvent(launches, LaunchesEvent.Type.REMOVED)); - } - - public void launchesChanged(ILaunch[] launches) { - handleLaunchesEvent(new LaunchesEvent(launches, LaunchesEvent.Type.CHANGED)); - } - - public void launchesTerminated(ILaunch[] launches) { - handleLaunchesEvent(new LaunchesEvent(launches, LaunchesEvent.Type.TERMINATED)); - } - - private void handleLaunchesEvent(final LaunchesEvent event) { - if (isDisposed()) return; - - // We're in session's executor thread. Re-dispach to VM Adapter - // executor thread and then call root layout node. - try { - getExecutor().execute(new Runnable() { - public void run() { - if (isDisposed()) return; - - IRootVMNode rootLayoutNode = getRootVMNode(); - if (rootLayoutNode != null && rootLayoutNode.getDeltaFlags(event) != 0) { - handleEvent(event); - } - }}); - } - catch (RejectedExecutionException e) { - // Ignore. This exception could be thrown if the provider is being - // shut down. - } - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/RegisterVMProvider.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/RegisterVMProvider.java deleted file mode 100644 index b3cb5b5c6..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/RegisterVMProvider.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Wind River 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui.viewmodel; - -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.FormattedValuePreferenceStore; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldVMNode; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterColumnPresentation; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterGroupVMNode; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.SyncRegisterDataAccess; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter; -import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.IVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.RootDMVMNode; -import org.eclipse.dd.dsf.ui.viewmodel.update.AutomaticUpdatePolicy; -import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy; -import org.eclipse.dd.dsf.ui.viewmodel.update.ManualUpdatePolicy; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - -/** - * Provides the VIEW MODEL for the DEBUG MODEL REGISTER view. - */ -@SuppressWarnings("restriction") -public class RegisterVMProvider extends AbstractDMVMProvider implements IPropertyChangeListener { - - /* - * Current default for register formatting. - */ - public RegisterVMProvider(AbstractVMAdapter adapter, IPresentationContext context, DsfSession session) { - super(adapter, context, session); - - context.addPropertyChangeListener(this); - - /* - * Create the register data access routines. - */ - SyncRegisterDataAccess regAccess = new SyncRegisterDataAccess(session) ; - - /* - * Create the top level node to deal with the root selection. - */ - IRootVMNode rootNode = new RootDMVMNode(this); - - IVMNode registerGroupNode = new RegisterGroupVMNode(this, getSession(), regAccess); - IVMNode registerNode = new RegisterVMNode(FormattedValuePreferenceStore.getDefault(), this, getSession(), regAccess); - IVMNode bitFieldNode = new RegisterBitFieldVMNode(FormattedValuePreferenceStore.getDefault(), this, getSession(), regAccess); - - /* - * Create the Group nodes next. They represent the first level shown in the view. - */ - - addChildNodes(rootNode, new IVMNode[] { registerGroupNode, registerNode }); - - /* - * Create the next level which is the registers themselves. - */ - addChildNodes(registerGroupNode, new IVMNode[] { registerNode, bitFieldNode }); - - /* - * Create the next level which is the bitfield level. - */ - addChildNodes(registerNode, new IVMNode[] { bitFieldNode }); - - /* - * Now set this schema set as the layout set. - */ - setRootNode(rootNode); - } - - @Override - protected IVMUpdatePolicy[] createUpdateModes() { - return new IVMUpdatePolicy[] { new AutomaticUpdatePolicy(), new ManualUpdatePolicy(), new BreakpointHitUpdatePolicy() }; - } - - @Override - public void dispose() { - getPresentationContext().removePropertyChangeListener(this); - super.dispose(); - } - - @Override - public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) { - return new RegisterColumnPresentation(); - } - - @Override - public String getColumnPresentationId(IPresentationContext context, Object element) { - return RegisterColumnPresentation.ID; - } - - public void propertyChange(PropertyChangeEvent event) { - handleEvent(event); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ViewModelAdapter.java b/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ViewModelAdapter.java deleted file mode 100644 index 286ac622a..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf.ui/src/org/eclipse/tm/internal/tcf/dsf/ui/viewmodel/ViewModelAdapter.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.ui.viewmodel; - -import org.eclipse.dd.dsf.concurrent.ThreadSafe; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProvider; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMProvider; -import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableVMProvider; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider; -import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMAdapter; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.tm.internal.tcf.dsf.launch.TCFDSFLaunch; - - -@ThreadSafe -@SuppressWarnings("restriction") -public class ViewModelAdapter extends AbstractDMVMAdapter { - - private final TCFDSFLaunch launch; - - public ViewModelAdapter(DsfSession session, TCFDSFLaunch launch) { - super(session); - this.launch = launch; - getSession().registerModelAdapter(IColumnPresentationFactory.class, this); - } - - @Override - public void dispose() { - getSession().unregisterModelAdapter(IColumnPresentationFactory.class); - super.dispose(); - } - - @Override - protected IVMProvider createViewModelProvider(IPresentationContext context) { - if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId()) ) { - return new LaunchVMProvider(this, context, getSession(), launch); - } - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) ) { - return new VariableVMProvider(this, context, getSession()); - } - if (IDebugUIConstants.ID_REGISTER_VIEW.equals(context.getId()) ) { - return new RegisterVMProvider(this, context, getSession()); - } - if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(context.getId()) ) { - return new ExpressionVMProvider(this, context, getSession()); - } - if (IDebugUIConstants.ID_MODULE_VIEW.equals(context.getId()) ) { - return new ModulesVMProvider(this, context, getSession()); - } - return null; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/.classpath b/plugins/org.eclipse.tm.tcf.dsf/.classpath deleted file mode 100644 index 12d928036..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="**/.svn/*" kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.tm.tcf.dsf/.project b/plugins/org.eclipse.tm.tcf.dsf/.project deleted file mode 100644 index 68c416def..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.tm.tcf.dsf</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0bf81e2f5..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,272 +0,0 @@ -#Tue Feb 05 15:38:16 CET 2008 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,.svn/ -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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=80 -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=1 -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=80 -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=8 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=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=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=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.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=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -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=space -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 -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index abbc7248f..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Wed Jan 09 12:21:30 PST 2008
-eclipse.preferences.version=1
-formatter_profile=_Java STD
-formatter_settings_version=11
diff --git a/plugins/org.eclipse.tm.tcf.dsf/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.tcf.dsf/META-INF/MANIFEST.MF deleted file mode 100644 index a2a72fbbb..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.tcf.dsf;singleton:=true -Bundle-Version: 0.2.0.qualifier -Bundle-Activator: org.eclipse.tm.internal.tcf.dsf.Activator -Bundle-Vendor: %providerName -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.debug.core, - org.eclipse.core.resources, - org.eclipse.dd.dsf, - org.eclipse.dd.dsf.debug, - org.eclipse.cdt.core, - org.eclipse.tm.tcf.debug -Import-Package: org.eclipse.tm.tcf.core;version="0.2.0", - org.eclipse.tm.tcf.protocol;version="0.2.0", - org.eclipse.tm.tcf.services;version="0.2.0", - org.eclipse.tm.tcf.util;version="0.2.0" -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Export-Package: org.eclipse.tm.internal.tcf.dsf.launch, - org.eclipse.tm.internal.tcf.dsf.services diff --git a/plugins/org.eclipse.tm.tcf.dsf/about.html b/plugins/org.eclipse.tm.tcf.dsf/about.html deleted file mode 100644 index 6c5b3615b..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!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>January 10, 2008</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/plugins/org.eclipse.tm.tcf.dsf/build.properties b/plugins/org.eclipse.tm.tcf.dsf/build.properties deleted file mode 100644 index a9d75d528..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 2010 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: -# Wind River Systems - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/plugins/org.eclipse.tm.tcf.dsf/plugin.properties b/plugins/org.eclipse.tm.tcf.dsf/plugin.properties deleted file mode 100644 index a55ebff6c..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2010 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: -# Wind River Systems - initial implementation -############################################################################### -pluginName = TCF/DSF Integration Core (Incubation) -providerName = Eclipse.org - DSDP - diff --git a/plugins/org.eclipse.tm.tcf.dsf/plugin.xml b/plugins/org.eclipse.tm.tcf.dsf/plugin.xml deleted file mode 100644 index 9ffe1378b..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/plugin.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?><!--
- Copyright (c) 2010 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:
- Wind River Systems - initial API and implementation
- -->
- -<plugin> - <extension - point="org.eclipse.debug.core.launchConfigurationTypes"> - <launchConfigurationType - sourceLocatorId="org.eclipse.tm.tcf.dsf.SourceLocator" - name="DSF over TCF" - sourcePathComputerId="org.eclipse.tm.tcf.debug.SourcePathComputer" - delegate="org.eclipse.tm.internal.tcf.dsf.launch.TCFDSFLaunchDelegate" - modes="debug" - id="org.eclipse.tm.tcf.dsf.LaunchConfigurationType"> - </launchConfigurationType> - </extension> - <extension - point="org.eclipse.debug.core.sourceLocators"> - <sourceLocator - name="TCF/DSF Source Lookup Director" - class="org.eclipse.tm.internal.tcf.dsf.launch.TCFDSFSourceLookupDirector" - id="org.eclipse.tm.tcf.dsf.SourceLocator"> - </sourceLocator> - </extension> -</plugin> diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/Activator.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/Activator.java deleted file mode 100644 index 33c2cf2f0..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.tm.tcf.dsf.core"; - - // The shared instance - private static Activator plugin; - private static BundleContext bundle_context; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - bundle_context = context; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - public static BundleContext getBundleContext() { - return bundle_context; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFExecuter.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFExecuter.java deleted file mode 100644 index 01b6a724f..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFExecuter.java +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import java.util.ArrayList; -import java.util.List; -import java.util.TreeSet; -import java.util.concurrent.AbstractExecutorService; -import java.util.concurrent.Callable; -import java.util.concurrent.Delayed; -import java.util.concurrent.FutureTask; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -import org.eclipse.dd.dsf.concurrent.DsfExecutor; -import org.eclipse.tm.tcf.protocol.Protocol; - - -public class TCFDSFExecuter extends AbstractExecutorService implements DsfExecutor { - - private class ScheduledFutureTask<V> extends FutureTask<V> implements ScheduledFuture<V> { - - private long time; // Milliseconds - private final int id; - private final long period; // Milliseconds - - public ScheduledFutureTask(long delay, long period, Runnable runnable, V result) { - super(runnable, result); - time = System.currentTimeMillis() + delay; - id = sf_count++; - this.period = period; - } - - public ScheduledFutureTask(long delay, Callable<V> callable) { - super(callable); - time = System.currentTimeMillis() + delay; - id = sf_count++; - period = 0; - } - - public long getDelay(TimeUnit unit) { - return unit.convert(time - System.currentTimeMillis(), TimeUnit.MILLISECONDS); - } - - public int compareTo(Delayed o) { - if (o == this) return 0; - ScheduledFutureTask<?> x = (ScheduledFutureTask<?>)o; - if (time < x.time) return -1; - if (time > x.time) return +1; - if (id < x.id) return -1; - if (id > x.id) return +1; - assert false; - return 0; - } - - public void run() { - if (period == 0) { - super.run(); - } - else { - boolean ok = super.runAndReset(); - synchronized (TCFDSFExecuter.this) { - // Reschedule if not canceled and not shutdown - if (ok && !is_shutdown) { - time = period > 0 ? time + period : System.currentTimeMillis() - period; - queue.add(this); - notify(); - } - } - } - } - } - - private static int sf_count = 0; - private final TreeSet<ScheduledFutureTask<?>> queue = new TreeSet<ScheduledFutureTask<?>>(); - private final Thread thread; - private boolean is_shutdown; - private boolean is_terminated; - - public TCFDSFExecuter() { - thread = new Thread(new Runnable() { - public void run() { - synchronized (TCFDSFExecuter.this) { - try { - while (true) { - if (queue.isEmpty()) { - if (is_shutdown) break; - TCFDSFExecuter.this.wait(); - } - else { - long time = System.currentTimeMillis(); - ScheduledFutureTask<?> s = queue.first(); - if (s.time <= time) { - queue.remove(s); - Protocol.invokeLater(s); - } - else { - TCFDSFExecuter.this.wait(s.time - time); - } - } - } - } - catch (Throwable x) { - x.printStackTrace(); - } - is_terminated = true; - } - } - }); - thread.setName("TCF Future Task Scheduler"); - thread.start(); - } - - public boolean isInExecutorThread() { - return Protocol.isDispatchThread(); - } - - public synchronized ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { - if (command == null || unit == null) throw new NullPointerException(); - if (is_shutdown) throw new RejectedExecutionException(); - delay = unit.toMillis(delay); - ScheduledFutureTask<Boolean> s = new ScheduledFutureTask<Boolean>(delay, 0, command, Boolean.TRUE); - queue.add(s); - notify(); - return s; - } - - public synchronized <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { - if (callable == null || unit == null) throw new NullPointerException(); - if (is_shutdown) throw new RejectedExecutionException(); - delay = unit.toMillis(delay); - ScheduledFutureTask<V> s = new ScheduledFutureTask<V>(delay, callable); - queue.add(s); - notify(); - return s; - } - - public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, - long initialDelay, long period, TimeUnit unit) { - if (command == null || unit == null) throw new NullPointerException(); - if (is_shutdown) throw new RejectedExecutionException(); - if (period <= 0) throw new RejectedExecutionException(); - ScheduledFutureTask<Boolean> s = new ScheduledFutureTask<Boolean>( - unit.toMillis(initialDelay), unit.toMillis(period), command, Boolean.TRUE); - queue.add(s); - notify(); - return s; - } - - public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, - long initialDelay, long delay, TimeUnit unit) { - if (command == null || unit == null) throw new NullPointerException(); - if (is_shutdown) throw new RejectedExecutionException(); - if (delay <= 0) throw new RejectedExecutionException(); - ScheduledFutureTask<Boolean> s = new ScheduledFutureTask<Boolean>( - unit.toMillis(initialDelay), -unit.toMillis(delay), command, Boolean.TRUE); - queue.add(s); - notify(); - return s; - } - - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - thread.join(unit.toMillis(timeout)); - return is_terminated; - } - - public synchronized boolean isShutdown() { - return is_shutdown; - } - - public synchronized boolean isTerminated() { - return is_terminated; - } - - public synchronized void shutdown() { - is_shutdown = true; - notify(); - } - - public synchronized List<Runnable> shutdownNow() { - List<Runnable> res = new ArrayList<Runnable>(queue); - queue.clear(); - is_shutdown = true; - notify(); - return res; - } - - public synchronized void execute(Runnable command) { - if (is_shutdown) throw new RejectedExecutionException(); - Protocol.invokeLater(command); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunch.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunch.java deleted file mode 100644 index 1d7a55892..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunch.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.dd.dsf.concurrent.DsfExecutor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants; -import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch; -import org.eclipse.tm.tcf.protocol.IChannel; - - -public class TCFDSFLaunch extends TCFLaunch { - - private final TCFDSFExecuter executor; - private final DsfSession session; - - public TCFDSFLaunch(ILaunchConfiguration launchConfiguration, String mode) { - super(launchConfiguration, mode); - executor = new TCFDSFExecuter(); - session = DsfSession.startSession(executor, ITCFConstants.ID_TCF_DEBUG_MODEL); - } - - @Override - protected void runLaunchSequence(final Runnable done) { - super.runLaunchSequence(new Runnable() { - public void run() { - IChannel channel = getChannel(); - if (channel != null) { - RequestMonitor monitor = new RequestMonitor(executor, null) { - @Override - protected void handleSuccess() { - done.run(); - } - }; - executor.execute(new TCFDSFLaunchSequence(session, TCFDSFLaunch.this, monitor)); - } - else { - done.run(); - } - } - }); - } - - @Override - protected void runShutdownSequence(final Runnable done) { - RequestMonitor monitor = new RequestMonitor(executor, null) { - @Override - protected void handleSuccess() { - TCFDSFLaunch.super.runShutdownSequence(done); - } - }; - executor.execute(new TCFDSFShutdownSequence(session, TCFDSFLaunch.this, monitor)); - } - - public DsfExecutor getDsfExecutor() { - return executor; - } - - public DsfSession getSession() { - return session; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchDelegate.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchDelegate.java deleted file mode 100644 index bd85ec755..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchDelegate.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.tm.internal.tcf.debug.launch.TCFLaunchDelegate; - - -public class TCFDSFLaunchDelegate extends TCFLaunchDelegate { - - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { - return new TCFDSFLaunch(configuration, mode); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchSequence.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchSequence.java deleted file mode 100644 index 35ba7e6b2..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFLaunchSequence.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.concurrent.Sequence; -import org.eclipse.dd.dsf.debug.service.StepQueueManager; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFBreakpoints; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFMemory; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFRegisters; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFRunControl; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFStack; -import org.eclipse.tm.tcf.protocol.IChannel; - - -class TCFDSFLaunchSequence extends Sequence { - - private final Step[] steps; - - TCFDSFLaunchSequence(final DsfSession session, final TCFDSFLaunch launch, RequestMonitor monitor) { - super(session.getExecutor(), monitor); - final IChannel channel = launch.getChannel(); - steps = new Step[] { - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new TCFDSFRunControl(launch.getLaunchConfiguration(), launch, session, channel, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new StepQueueManager(session).initialize(monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new TCFDSFStack(session, channel, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new TCFDSFMemory(session, channel, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new TCFDSFRegisters(session, channel, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - new TCFDSFBreakpoints(session, launch, monitor); - } - }, - }; - } - - @Override - public Step[] getSteps() { - return steps; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFShutdownSequence.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFShutdownSequence.java deleted file mode 100644 index 1fc5c974f..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFShutdownSequence.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.concurrent.Sequence; -import org.eclipse.dd.dsf.debug.service.StepQueueManager; -import org.eclipse.dd.dsf.service.DsfServicesTracker; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.service.IDsfService; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFBreakpoints; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFMemory; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFRegisters; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFRunControl; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFStack; - -class TCFDSFShutdownSequence extends Sequence { - - private final String session_id; - private final Step[] steps; - private DsfServicesTracker tracker; - - TCFDSFShutdownSequence(final DsfSession session, final TCFDSFLaunch launch, RequestMonitor monitor) { - super(session.getExecutor(), monitor); - session_id = session.getId(); - steps = new Step[] { - new Step() { - @Override - public void execute(RequestMonitor monitor) { - // Initialize services tracker. - tracker = new DsfServicesTracker(Activator.getBundleContext(), session_id); - monitor.done(); - } - - @Override - public void rollBack(RequestMonitor monitor) { - // In case the shutdown sequence aborts, - // ensure that the tracker is properly disposed. - tracker.dispose(); - tracker = null; - monitor.done(); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(TCFDSFBreakpoints.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(TCFDSFRegisters.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(TCFDSFMemory.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(TCFDSFStack.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(StepQueueManager.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - shutdownService(TCFDSFRunControl.class, monitor); - } - }, - new Step() { - @Override - public void execute(RequestMonitor monitor) { - tracker.dispose(); - tracker = null; - monitor.done(); - } - } - }; - } - - private void shutdownService(Class<?> clazz, final RequestMonitor requestMonitor) { - IDsfService service = (IDsfService)tracker.getService(clazz); - if (service != null) { - service.shutdown(new RequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleCompleted() { - if (!isSuccess()) { - Activator.getDefault().getLog().log(getStatus()); - } - requestMonitor.done(); - } - }); - } - else { - requestMonitor.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, - "Service '" + clazz.getName() + "' not found.", null)); //$NON-NLS-1$//$NON-NLS-2$ - requestMonitor.done(); - } - } - - @Override - public Step[] getSteps() { - return steps; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupDirector.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupDirector.java deleted file mode 100644 index cee6ddb6c..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupDirector.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; -import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; - -/** - * TCF/DSF source lookup director. - * For TCF/DSF source lookup there is one source lookup participant. - */ -public class TCFDSFSourceLookupDirector extends AbstractSourceLookupDirector { - - public void initializeParticipants() { - addParticipants(new ISourceLookupParticipant[] { new TCFDSFSourceLookupParticipant() }); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupParticipant.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupParticipant.java deleted file mode 100644 index 9eb7cdb96..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/launch/TCFDSFSourceLookupParticipant.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.launch; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.tm.internal.tcf.debug.launch.TCFSourceLookupParticipant; -import org.eclipse.tm.internal.tcf.debug.model.TCFSourceRef; -import org.eclipse.tm.internal.tcf.dsf.services.TCFDSFStack.TCFFrameDMC; -import org.eclipse.tm.tcf.protocol.Protocol; - -/** - * The TCF source lookup participant knows how to translate a TCFFrameData - * into a source file name - */ -public class TCFDSFSourceLookupParticipant extends TCFSourceLookupParticipant { - - @Override - public String getSourceName(final Object object) throws CoreException { - if (object instanceof TCFFrameDMC) { - final Object[] res = new Object[1]; - synchronized (res) { - Protocol.invokeLater(new Runnable() { - public void run() { - TCFFrameDMC dmc = (TCFFrameDMC)object; - if (!dmc.context_cache.validate(this)) return; - if (!dmc.source_cache.validate(this)) return; - synchronized (res) { - TCFSourceRef ref = dmc.source_cache.getData(); - if (ref != null) res[0] = ref.area; - res.notify(); - } - } - }); - try { - res.wait(); - } - catch (InterruptedException e) { - } - } - return super.getSourceName(res[0]); - } - return super.getSourceName(object); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFAddress.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFAddress.java deleted file mode 100644 index 325584887..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFAddress.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.math.BigInteger; - -import org.eclipse.cdt.core.IAddress; - -public final class TCFAddress implements IAddress { - - private final BigInteger addr; - - // TODO: TCFAddress should include memory space ID - public TCFAddress(Number addr) { - if (addr instanceof BigInteger) this.addr = (BigInteger)addr; - else this.addr = new BigInteger(addr.toString(), 10); - } - - public IAddress add(BigInteger i) { - return new TCFAddress(addr.add(i)); - } - - public IAddress add(long l) { - if (l == 0) return this; - return new TCFAddress(addr.add(BigInteger.valueOf(l))); - } - - public BigInteger distanceTo(IAddress a) { - return a.getValue().subtract(addr); - } - - public int getCharsNum() { - // TODO don't know what getCharsNum() is supposed to return - return 0; - } - - public BigInteger getMaxOffset() { - // TODO don't know what getMaxOffset() is supposed to return - return null; - } - - public int getSize() { - // TODO don't know what getSize() is supposed to return - return 0; - } - - public BigInteger getValue() { - return addr; - } - - public boolean isMax() { - return false; - } - - public boolean isZero() { - return addr.equals(BigInteger.ZERO); - } - - public String toBinaryAddressString() { - return toHexAddressString(); - } - - public String toHexAddressString() { - return "0x" + toString(16); - } - - public String toString(int radix) { - return addr.toString(radix); - } - - public int compareTo(Object o) { - return addr.compareTo(((TCFAddress)o).addr); - } - - public String toString() { - return "[" + toHexAddressString() + "]"; - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java deleted file mode 100644 index 520164dc8..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java +++ /dev/null @@ -1,402 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Map; -import java.util.Set; - -import org.eclipse.cdt.core.IAddress; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMContext; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.dsf.service.IDsfService; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.tm.internal.tcf.debug.model.ITCFBreakpointListener; -import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants; -import org.eclipse.tm.internal.tcf.debug.model.TCFBreakpointsModel; -import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.IBreakpoints; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.osgi.framework.BundleContext; - -public class TCFDSFBreakpoints extends AbstractDsfService implements org.eclipse.dd.dsf.debug.service.IBreakpoints { - - private class BreakpointDMC extends AbstractDMContext implements IBreakpointDMContext { - - final String id; - final IBreakpoint bp; - final TCFDataCache<Map<String,Object>> status; - final Set<IBreakpointsTargetDMContext> targets; - - boolean disposed; - - public BreakpointDMC(IDsfService service, final String id, IBreakpoint bp) { - super(service, new IDMContext[0]); - this.id = id; - this.bp = bp; - cache.put(id, this); - status = new TCFDataCache<Map<String,Object>>(channel) { - @Override - public boolean startDataRetrieval() { - assert command == null; - assert !disposed; - if (tcf_bpt_service == null) { - reset(null); - return true; - } - command = tcf_bpt_service.getStatus(id, new org.eclipse.tm.tcf.services.IBreakpoints.DoneGetStatus() { - public void doneGetStatus(IToken token, Exception err, Map<String,Object> status) { - set(token, err, status); - } - }); - return false; - } - }; - targets = new HashSet<IBreakpointsTargetDMContext>(); - } - - @Override - public boolean equals(Object other) { - return super.baseEquals(other) && ((BreakpointDMC)other).id.equals(id); - } - - @Override - public int hashCode() { - return id.hashCode(); - } - - void dispose() { - assert !disposed; - cache.remove(id); - for (IBreakpointsTargetDMContext t : targets.toArray( - new IBreakpointsTargetDMContext[targets.size()])) onRemoved(t); - assert targets.isEmpty(); - disposed = true; - } - - void onAdded(final IBreakpointsTargetDMContext t) { - targets.add(t); - IBreakpointsAddedEvent e = new IBreakpointsAddedEvent() { - public IBreakpointsTargetDMContext getDMContext() { - return t; - } - public IBreakpointDMContext[] getBreakpoints() { - return new IBreakpointDMContext[]{ BreakpointDMC.this }; - } - }; - getSession().dispatchEvent(e, getProperties()); - } - - void onUpdated(final IBreakpointsTargetDMContext t) { - assert targets.contains(t); - IBreakpointsUpdatedEvent e = new IBreakpointsUpdatedEvent() { - public IBreakpointsTargetDMContext getDMContext() { - return t; - } - public IBreakpointDMContext[] getBreakpoints() { - return new IBreakpointDMContext[]{ BreakpointDMC.this }; - } - }; - getSession().dispatchEvent(e, getProperties()); - } - - void onRemoved(final IBreakpointsTargetDMContext t) { - targets.remove(t); - IBreakpointsRemovedEvent e = new IBreakpointsRemovedEvent() { - public IBreakpointsTargetDMContext getDMContext() { - return t; - } - public IBreakpointDMContext[] getBreakpoints() { - return new IBreakpointDMContext[]{ BreakpointDMC.this }; - } - }; - getSession().dispatchEvent(e, getProperties()); - } - } - - private class BreakpointData implements IBreakpointDMData { - - final IBreakpoint bp; - final Map<String,Object> attrs; - final Map<String,Object> status; - final String file; - - @SuppressWarnings("unchecked") - BreakpointData(IBreakpoint bp, Map<String,Object> status) throws CoreException, IOException { - this.bp = bp; - this.status = status; - attrs = bp.getMarker().getAttributes(); - IResource resource = bp.getMarker().getResource(); - if (resource == ResourcesPlugin.getWorkspace().getRoot()) { - file = null; - } - else { - IPath p = resource.getRawLocation(); - if (p == null) file = null; - else file = p.toFile().getCanonicalPath(); - } - } - - public IBreakpoint getPlatformBreakpoint() { - return bp; - } - - public Map<String,Object> getStatus() { - return status; - } - - @SuppressWarnings("unchecked") - public IAddress[] getAddresses() { - if (status == null) return null; - Collection<Map<String,Object>> arr = (Collection<Map<String,Object>>)status.get(IBreakpoints.STATUS_INSTANCES); - if (arr == null) return null; - int cnt = 0; - for (Map<String,Object> m : arr) { - if (m.get(IBreakpoints.INSTANCE_ADDRESS) != null) cnt++; - } - IAddress[] res = new IAddress[cnt]; - int pos = 0; - for (Map<String,Object> m : arr) { - Number n = (Number)m.get(IBreakpoints.INSTANCE_ADDRESS); - if (n != null) res[pos++] = new TCFAddress(n); - } - return res; - } - - public String getBreakpointType() { - // TODO Auto-generated method stub - return null; - } - - public String getCondition() { - return (String)attrs.get(ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_CONDITION); - } - - public String getExpression() { - // TODO Auto-generated method stub - return null; - } - - public String getFileName() { - return file; - } - - public String getFunctionName() { - // TODO Auto-generated method stub - return null; - } - - public int getIgnoreCount() { - Integer count = (Integer)attrs.get(ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_IGNORECOUNT); - if (count != null) return count.intValue(); - return 0; - } - - public int getLineNumber() { - Integer line = (Integer)attrs.get(IMarker.LINE_NUMBER); - if (line != null) return line.intValue(); - return 0; - } - - public boolean isEnabled() { - Boolean enabled = (Boolean)attrs.get(IBreakpoint.ENABLED); - return enabled != null && enabled.booleanValue() && bp_manager.isEnabled(); - } - } - - private final ITCFBreakpointListener bp_listener = new ITCFBreakpointListener() { - - @SuppressWarnings("unchecked") - public void breakpointStatusChanged(String id) { - final BreakpointDMC dmc = cache.get(id); - if (dmc != null) { - TCFDSFRunControl rc = getServicesTracker().getService(TCFDSFRunControl.class); - Map<String,Object> map = launch.getBreakpointsStatus().getStatus(dmc.id); - dmc.status.reset(map); - Set<IBreakpointsTargetDMContext> add_targets = new HashSet<IBreakpointsTargetDMContext>(); - Set<IBreakpointsTargetDMContext> rem_targets = new HashSet<IBreakpointsTargetDMContext>(); - if (map != null) { - Collection<Map<String,Object>> arr = (Collection<Map<String,Object>>)map.get(IBreakpoints.STATUS_INSTANCES); - if (arr != null) { - for (Map<String,Object> m : arr) { - String ctx_id = (String)m.get(IBreakpoints.INSTANCE_CONTEXT); - if (ctx_id != null) add_targets.add(rc.getContext(ctx_id)); - } - } - } - for (IBreakpointsTargetDMContext t : dmc.targets) { - if (add_targets.contains(t)) { - dmc.onUpdated(t); - add_targets.remove(t); - } - else { - rem_targets.add(t); - } - } - for (IBreakpointsTargetDMContext t : rem_targets) dmc.onRemoved(t); - for (IBreakpointsTargetDMContext t : add_targets) dmc.onAdded(t); - } - } - - public void breakpointRemoved(String id) { - final BreakpointDMC dmc = cache.get(id); - if (dmc != null) dmc.dispose(); - } - }; - - private final TCFLaunch launch; - private final IChannel channel; - private final org.eclipse.tm.tcf.services.IBreakpoints tcf_bpt_service; - private final Map<String,BreakpointDMC> cache = new HashMap<String,BreakpointDMC>(); - private final IBreakpointManager bp_manager = DebugPlugin.getDefault().getBreakpointManager(); - - public TCFDSFBreakpoints(DsfSession session, TCFLaunch launch, final RequestMonitor monitor) { - super(session); - this.launch = launch; - channel = launch.getChannel(); - launch.getBreakpointsStatus().addListener(bp_listener); - tcf_bpt_service = channel.getRemoteService(org.eclipse.tm.tcf.services.IBreakpoints.class); - initialize(new RequestMonitor(getExecutor(), monitor) { - @Override - protected void handleSuccess() { - String[] class_names = { - org.eclipse.dd.dsf.debug.service.IBreakpoints.class.getName(), - TCFDSFBreakpoints.class.getName() - }; - register(class_names, new Hashtable<String,String>()); - monitor.done(); - } - }); - } - - @Override - public void shutdown(RequestMonitor monitor) { - unregister(); - super.shutdown(monitor); - } - - @Override - protected BundleContext getBundleContext() { - return Activator.getBundleContext(); - } - - public void getBreakpoints(IBreakpointsTargetDMContext ctx, DataRequestMonitor<IBreakpointDMContext[]> rm) { - TCFBreakpointsModel m = TCFBreakpointsModel.getBreakpointsModel(); - IBreakpoint[] arr = bp_manager.getBreakpoints(ITCFConstants.ID_TCF_DEBUG_MODEL); - ArrayList<IBreakpointDMContext> l = new ArrayList<IBreakpointDMContext>(); - if (arr != null && arr.length == 0) { - for (IBreakpoint bp : arr) { - if (m.isSupported(channel, bp)) { - IMarker marker = bp.getMarker(); - String id = marker.getAttribute(ITCFConstants.ID_TCF_DEBUG_MODEL + - '.' + org.eclipse.tm.tcf.services.IBreakpoints.PROP_ID, (String)null); - if (id != null) { - BreakpointDMC c = cache.get(id); - if (c == null) c = new BreakpointDMC(this, id, bp); - l.add(c); - } - } - } - } - rm.setData(l.toArray(new IBreakpointDMContext[l.size()])); - rm.done(); - } - - public void getBreakpointDMData(final IBreakpointDMContext dmc, final DataRequestMonitor<IBreakpointDMData> rm) { - if (dmc instanceof BreakpointDMC) { - BreakpointDMC bp = (BreakpointDMC)dmc; - if (!bp.status.validate()) { - bp.status.wait(new Runnable() { - public void run() { - getBreakpointDMData(dmc, rm); - } - }); - return; - } - if (bp.status.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", bp.status.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - try { - rm.setData(new BreakpointData(bp.bp, bp.status.getData())); - } - catch (Exception x) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", x)); //$NON-NLS-1$ - - } - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - @SuppressWarnings("unchecked") - public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) { - if (dmc instanceof BreakpointDMC) { - getBreakpointDMData((BreakpointDMC)dmc, (DataRequestMonitor<IBreakpointDMData>)rm); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void insertBreakpoint(IBreakpointsTargetDMContext context, Map<String,Object> attributes, - DataRequestMonitor<IBreakpointDMContext> rm) { - // Clients are not allowed to call this method. - // Use IBreakpointManager instead. - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not allowed", new Error())); //$NON-NLS-1$ - rm.done(); - } - - public void removeBreakpoint(IBreakpointDMContext dmc, RequestMonitor rm) { - // Clients are not allowed to call this method. - // Use IBreakpointManager instead. - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not allowed", new Error())); //$NON-NLS-1$ - rm.done(); - } - - public void updateBreakpoint(IBreakpointDMContext dmc, Map<String,Object> delta, RequestMonitor rm) { - // Clients are not allowed to call this method. - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not allowed", new Error())); //$NON-NLS-1$ - rm.done(); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFExecutionDMC.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFExecutionDMC.java deleted file mode 100644 index 7f836952b..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFExecutionDMC.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.dd.dsf.datamodel.AbstractDMContext; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; -import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.dsf.service.IDsfService; -import org.eclipse.tm.internal.tcf.debug.model.TCFContextState; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.IMemory; -import org.eclipse.tm.tcf.services.IRunControl; -import org.eclipse.tm.tcf.services.IRunControl.RunControlContext; -import org.eclipse.tm.tcf.util.TCFDataCache; - -public abstract class TCFDSFExecutionDMC extends AbstractDMContext - implements IExecutionDMContext, IContainerDMContext, IMemoryDMContext, IBreakpointsTargetDMContext { - - public final TCFDataCache<IMemory.MemoryContext> memory_context_cache; - public final TCFDataCache<RunControlContext> run_control_context_cache; - public final TCFDataCache<Map<String,TCFDSFExecutionDMC>> run_control_children_cache; - public final TCFDataCache<TCFContextState> run_control_state_cache; - - TCFDataCache<?> stack_frames_cache; - TCFDataCache<?> registers_cache; - - TCFDSFExecutionDMC(IChannel channel, IDsfService service, IDMContext[] parents) { - super(service, parents); - final IMemory tcf_mem_service = channel.getRemoteService(IMemory.class); - final IRunControl tcf_run_service = channel.getRemoteService(IRunControl.class); - memory_context_cache = new TCFDataCache<IMemory.MemoryContext>(channel) { - @Override - public boolean startDataRetrieval() { - assert command == null; - String id = getTcfContextId(); - if (id == null || tcf_mem_service == null) { - reset(null); - return true; - } - command = tcf_mem_service.getContext(id, - new org.eclipse.tm.tcf.services.IMemory.DoneGetContext() { - public void doneGetContext(IToken token, Exception err, - org.eclipse.tm.tcf.services.IMemory.MemoryContext ctx) { - set(token, err, ctx); - } - }); - return false; - } - }; - run_control_context_cache = new TCFDataCache<RunControlContext>(channel) { - @Override - public boolean startDataRetrieval() { - assert command == null; - String id = getTcfContextId(); - if (id == null || tcf_run_service == null) { - reset(null); - return true; - } - command = tcf_run_service.getContext(id, new IRunControl.DoneGetContext() { - public void doneGetContext(IToken token, Exception err, IRunControl.RunControlContext ctx) { - set(token, err, ctx); - } - }); - return false; - } - }; - run_control_children_cache = new TCFDataCache<Map<String,TCFDSFExecutionDMC>>(channel) { - @Override - public boolean startDataRetrieval() { - assert command == null; - if (tcf_run_service == null) { - reset(null); - return true; - } - String id = getTcfContextId(); - command = tcf_run_service.getChildren(id, new IRunControl.DoneGetChildren() { - public void doneGetChildren(IToken token, Exception err, String[] contexts) { - if (command != token) return; - HashMap<String,TCFDSFExecutionDMC> data = new HashMap<String,TCFDSFExecutionDMC>(); - if (contexts != null) { - for (int i = 0; i < contexts.length; i++) { - String id = contexts[i]; - TCFDSFExecutionDMC n = addChild(id); - data.put(id, n); - } - } - set(token, err, data); - } - }); - return false; - } - }; - run_control_state_cache = new TCFDataCache<TCFContextState>(channel) { - @Override - public boolean startDataRetrieval() { - assert command == null; - if (!run_control_context_cache.validate(this)) return false; - RunControlContext c = run_control_context_cache.getData(); - if (c == null || !c.hasState()) { - reset(null); - return true; - } - command = c.getState(new IRunControl.DoneGetState() { - public void doneGetState(IToken token, Exception err, boolean suspend, String pc, String reason, Map<String,Object> params) { - if (command != token) return; - TCFContextState data = new TCFContextState(); - data.is_suspended = suspend; - if (suspend) { - data.suspend_pc = pc; - data.suspend_reason = reason; - data.suspend_params = params; - } - set(token, err, data); - } - }); - return false; - } - }; - } - - public abstract void dispose(); - - /** - * Get TCF ID of execution context. - * @return TCF ID. - */ - public abstract String getTcfContextId(); - - /** - * Check if this context object is disposed, because, for example, a thread has exited. - * @return true if context object is disposed. - */ - public abstract boolean isDisposed(); - - protected abstract TCFDSFExecutionDMC addChild(String id); -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFMemory.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFMemory.java deleted file mode 100644 index 003e71895..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFMemory.java +++ /dev/null @@ -1,265 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.util.Hashtable; - -import org.eclipse.cdt.core.IAddress; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMEvent; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.debug.core.model.MemoryByte; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.IMemory; -import org.eclipse.tm.tcf.services.IMemory.MemoryContext; -import org.eclipse.tm.tcf.services.IMemory.MemoryError; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.osgi.framework.BundleContext; - - -public class TCFDSFMemory extends AbstractDsfService implements org.eclipse.dd.dsf.debug.service.IMemory { - - private static class MemoryChangedEvent extends AbstractDMEvent<IMemoryDMContext> implements IMemoryChangedEvent { - IAddress[] fAddresses; - IDMContext fContext; - - public MemoryChangedEvent(IMemoryDMContext context, IAddress[] addresses) { - super(context); - fAddresses = addresses; - } - - public IAddress[] getAddresses() { - return fAddresses; - } - } - - private final org.eclipse.tm.tcf.services.IMemory.MemoryListener mem_listener = - new org.eclipse.tm.tcf.services.IMemory.MemoryListener() { - - public void contextAdded(MemoryContext[] contexts) { - } - - public void contextChanged(MemoryContext[] contexts) { - } - - public void contextRemoved(String[] context_ids) { - } - - public void memoryChanged(String context_id, Number[] addr, long[] size) { - TCFDSFRunControl rc = getServicesTracker().getService(TCFDSFRunControl.class); - TCFDSFExecutionDMC exe = rc.getContext(context_id); - if (exe == null || exe.memory_context_cache == null) return; - for (int n = 0; n < addr.length; n++) { - long count = size[n]; - // TODO: DSF does not support address ranges - if (count > 256) count = 256; - IAddress[] addresses = new IAddress[(int)count]; - for (int i = 0; i < (int)count; i++) { - addresses[i] = new TCFAddress(addr[n]).add(i); - } - getSession().dispatchEvent(new MemoryChangedEvent(exe, addresses), getProperties()); - } - } - }; - - private final org.eclipse.tm.tcf.services.IMemory tcf_mem_service; - - public TCFDSFMemory(DsfSession session, IChannel channel, final RequestMonitor monitor) { - super(session); - tcf_mem_service = channel.getRemoteService(org.eclipse.tm.tcf.services.IMemory.class); - if (tcf_mem_service != null) tcf_mem_service.addListener(mem_listener); - initialize(new RequestMonitor(getExecutor(), monitor) { - @Override - protected void handleSuccess() { - String[] class_names = { - org.eclipse.dd.dsf.debug.service.IMemory.class.getName(), - TCFDSFMemory.class.getName() - }; - register(class_names, new Hashtable<String,String>()); - monitor.done(); - } - }); - } - - @Override - public void shutdown(RequestMonitor monitor) { - unregister(); - super.shutdown(monitor); - } - - @Override - protected BundleContext getBundleContext() { - return Activator.getBundleContext(); - } - - public void fillMemory(final IMemoryDMContext dmc, final IAddress address, final long offset, - final int word_size, final int count, final byte[] pattern, final RequestMonitor rm) { - if (tcf_mem_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Memory access service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - else if (dmc instanceof TCFDSFExecutionDMC) { - final TCFDSFExecutionDMC ctx = (TCFDSFExecutionDMC)dmc; - TCFDataCache<IMemory.MemoryContext> cache = ctx.memory_context_cache; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - fillMemory(dmc, address, offset, word_size, count, pattern, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - org.eclipse.tm.tcf.services.IMemory.MemoryContext mem = cache.getData(); - if (mem == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - mem.fill(address.add(offset).getValue(), word_size, pattern, count * word_size, 0, - new org.eclipse.tm.tcf.services.IMemory.DoneMemory() { - public void doneMemory(IToken token, MemoryError error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getMemory(final IMemoryDMContext dmc, final IAddress address, final long offset, - final int word_size, final int count, final DataRequestMonitor<MemoryByte[]> rm) { - if (tcf_mem_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Memory access service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - else if (dmc instanceof TCFDSFExecutionDMC) { - final TCFDSFExecutionDMC ctx = (TCFDSFExecutionDMC)dmc; - TCFDataCache<IMemory.MemoryContext> cache = ctx.memory_context_cache; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getMemory(dmc, address, offset, word_size, count, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - org.eclipse.tm.tcf.services.IMemory.MemoryContext mem = cache.getData(); - if (mem == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - final byte[] buffer = new byte[word_size * count]; - mem.get(address.add(offset).getValue(), word_size, buffer, 0, count * word_size, 0, - new org.eclipse.tm.tcf.services.IMemory.DoneMemory() { - public void doneMemory(IToken token, MemoryError error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - MemoryByte[] res = new MemoryByte[buffer.length]; - for (int i = 0; i < buffer.length; i++) { - res[i] = new MemoryByte(buffer[i]); - } - rm.setData(res); - rm.done(); - } - }); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void setMemory(final IMemoryDMContext dmc, final IAddress address, final long offset, - final int word_size, final int count, final byte[] buffer, final RequestMonitor rm) { - if (tcf_mem_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Memory access service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - else if (dmc instanceof TCFDSFExecutionDMC) { - final TCFDSFExecutionDMC ctx = (TCFDSFExecutionDMC)dmc; - TCFDataCache<IMemory.MemoryContext> cache = ctx.memory_context_cache; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - setMemory(dmc, address, offset, word_size, count, buffer, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - org.eclipse.tm.tcf.services.IMemory.MemoryContext mem = cache.getData(); - if (mem == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - mem.set(address.add(offset).getValue(), word_size, buffer, 0, count * word_size, 0, - new org.eclipse.tm.tcf.services.IMemory.DoneMemory() { - public void doneMemory(IToken token, MemoryError error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java deleted file mode 100644 index 21ef57ded..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java +++ /dev/null @@ -1,1171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMContext; -import org.eclipse.dd.dsf.datamodel.AbstractDMEvent; -import org.eclipse.dd.dsf.datamodel.CompositeDMContext; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.StateChangeReason; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfServiceEventHandler; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.IRegisters.DoneGet; -import org.eclipse.tm.tcf.services.IRegisters.DoneSearch; -import org.eclipse.tm.tcf.services.IRegisters.DoneSet; -import org.eclipse.tm.tcf.services.IRegisters.NamedValue; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.osgi.framework.BundleContext; - - -public class TCFDSFRegisters extends AbstractDsfService implements org.eclipse.dd.dsf.debug.service.IRegisters { - - private class ObjectDMC extends AbstractDMContext implements IFormattedDataDMContext { - - final String id; - final RegisterChildrenCache children; - final Map<String,ValueDMC> values; - - org.eclipse.tm.tcf.services.IRegisters.RegistersContext context; - boolean disposed; - - ObjectDMC(String session_id, IDMContext[] parents, String id) { - super(session_id, parents); - this.id = id; - children = new RegisterChildrenCache(channel, id, new IDMContext[]{ this }); - values = new HashMap<String,ValueDMC>(); - model.put(id, this); - } - - ObjectDMC(String session_id, IDMContext[] parents, String id, RegisterChildrenCache children) { - super(session_id, parents); - this.id = id; - this.children = children; - values = new HashMap<String,ValueDMC>(); - } - - @Override - public boolean equals(Object other) { - return super.baseEquals(other) && ((ObjectDMC)other).id.equals(id); - } - - @Override - public int hashCode() { - return id.hashCode(); - } - - public String getName() { - return context.getName(); - } - - void dispose() { - assert !disposed; - children.dispose(); - for (ValueDMC v : values.values()) v.dispose(); - values.clear(); - model.remove(id); - disposed = true; - } - } - - private class RegisterGroupDMC extends ObjectDMC implements IRegisterGroupDMContext { - - RegisterGroupDMC(String session_id, IDMContext[] parents, String id) { - super(session_id, parents, id); - } - - /* Constructor for a fake register group - DSF requires at least one group object */ - RegisterGroupDMC(String session_id, IDMContext[] parents, final String id, RegisterChildrenCache children) { - super(session_id, parents, id, children); - context = new org.eclipse.tm.tcf.services.IRegisters.RegistersContext() { - public int[] getBitNumbers() { - return null; - } - public String getDescription() { - return null; - } - public int getFirstBitNumber() { - return 0; - } - public String getID() { - return id; - } - public String getName() { - return null; - } - public NamedValue[] getNamedValues() { - return null; - } - public int getSize() { - return 0; - } - public String getParentID() { - return null; - } - public Map<String,Object> getProperties() { - return null; - } - public boolean hasSideEffects() { - return false; - } - public boolean isBigEndian() { - return false; - } - public boolean isFloat() { - return false; - } - public boolean isLeftToRight() { - return false; - } - public boolean isReadOnce() { - return false; - } - public boolean isReadable() { - return false; - } - public boolean isVolatile() { - return false; - } - public boolean isWriteOnce() { - return false; - } - public boolean isWriteable() { - return false; - } - public Collection<String> canSearch() { - return null; - } - public Number getMemoryAddress() { - return null; - } - public String getMemoryContext() { - return null; - } - public String getProcessID() { - return null; - } - public String getRole() { - return null; - } - public IToken get(DoneGet done) { - throw new Error(); - } - public IToken set(byte[] value, DoneSet done) { - throw new Error(); - } - public IToken search(Map<String, Object> filter, DoneSearch done) { - throw new Error(); - } - }; - } - } - - private class RegisterDMC extends ObjectDMC implements IRegisterDMContext { - - RegisterDMC(String session_id, IDMContext[] parents, String id) { - super(session_id, parents, id); - } - } - - private class BitFieldDMC extends ObjectDMC implements IBitFieldDMContext { - - BitFieldDMC(String session_id, IDMContext[] parents, String id) { - super(session_id, parents, id); - } - } - - private class ValueDMC extends FormattedValueDMContext { - - final RegisterValueCache cache; - - boolean disposed; - - ValueDMC(ObjectDMC parent, String fmt) { - super(TCFDSFRegisters.this, parent, fmt); - cache = new RegisterValueCache(channel, parent.context, fmt); - } - - void dispose() { - assert !disposed; - cache.dispose(); - disposed = true; - } - } - - private class RegisterGroupData implements IRegisterGroupDMData { - - final org.eclipse.tm.tcf.services.IRegisters.RegistersContext context; - - RegisterGroupData(org.eclipse.tm.tcf.services.IRegisters.RegistersContext context) { - this.context = context; - } - - public String getDescription() { - return context.getDescription(); - } - - public String getName() { - return context.getName(); - } - } - - private class RegisterData implements IRegisterDMData { - - final org.eclipse.tm.tcf.services.IRegisters.RegistersContext context; - - RegisterData(org.eclipse.tm.tcf.services.IRegisters.RegistersContext context) { - this.context = context; - } - - public String getDescription() { - return context.getDescription(); - } - - public String getName() { - return context.getName(); - } - - public boolean hasSideEffects() { - return context.hasSideEffects(); - } - - public boolean isFloat() { - return context.isFloat(); - } - - public boolean isReadOnce() { - return context.isReadOnce(); - } - - public boolean isReadable() { - return context.isReadable(); - } - - public boolean isVolatile() { - return context.isVolatile(); - } - - public boolean isWriteOnce() { - return context.isWriteOnce(); - } - - public boolean isWriteable() { - return context.isWriteable(); - } - } - - private class BitFieldData implements IBitFieldDMData { - - final org.eclipse.tm.tcf.services.IRegisters.RegistersContext context; - - IMnemonic[] mnemonics; - IBitGroup[] bit_groups; - - BitFieldData(org.eclipse.tm.tcf.services.IRegisters.RegistersContext context) { - this.context = context; - } - - public IBitGroup[] getBitGroup() { - if (bit_groups == null) { - int[] arr = context.getBitNumbers(); - if (arr == null) { - bit_groups = new IBitGroup[0]; - } - else { - Arrays.sort(arr); - ArrayList<IBitGroup> l = new ArrayList<IBitGroup>(); - int i = 0; - while (i < arr.length) { - int j = i; - while (j + 1 < arr.length && arr[j + 1] == arr[j] + 1) j++; - final int i0 = i; - final int i1 = j; - l.add(new IBitGroup() { - public int bitCount() { - return i1 - i0 + 1; - } - public int startBit() { - return i0; - } - }); - i = j + 1; - } - bit_groups = l.toArray(new IBitGroup[l.size()]); - } - } - return bit_groups; - } - - public IMnemonic getCurrentMnemonicValue() { - // TODO getCurrentMnemonicValue() should be async - return null; - } - - public String getDescription() { - return context.getDescription(); - } - - public IMnemonic[] getMnemonics() { - if (mnemonics == null) { - NamedValue[] arr = context.getNamedValues(); - if (arr == null) { - mnemonics = new IMnemonic[0]; - } - else { - int cnt = 0; - mnemonics = new IMnemonic[arr.length]; - for (final NamedValue v : arr) { - mnemonics[cnt++] = new IMnemonic() { - public String getLongName() { - return v.getDescription(); - } - public String getShortName() { - return v.getName(); - } - }; - } - } - } - return mnemonics; - } - - public String getName() { - return context.getName(); - } - - public boolean hasSideEffects() { - return context.hasSideEffects(); - } - - public boolean isReadOnce() { - return context.isReadOnce(); - } - - public boolean isReadable() { - return context.isReadable(); - } - - public boolean isWriteOnce() { - return context.isWriteOnce(); - } - - public boolean isWriteable() { - return context.isWriteable(); - } - - public boolean isZeroBasedNumbering() { - return context.getFirstBitNumber() == 0; - } - - public boolean isZeroBitLeftMost() { - return context.isLeftToRight(); - } - } - - private class RegisterChildrenCache extends TCFDataCache<Map<String,ObjectDMC>> { - - final String id; - final IDMContext[] parents; - - Map<String,ObjectDMC> dmc_pool = new HashMap<String,ObjectDMC>();; - - public RegisterChildrenCache(IChannel channel, String id, IDMContext[] parents) { - super(channel); - this.id = id; - this.parents = parents; - } - - void invalidateRegContents() { - for (ObjectDMC dmc : dmc_pool.values()) { - for (ValueDMC val : dmc.values.values()) val.cache.reset(); - dmc.children.invalidateRegContents(); - } - } - - @Override - public void dispose() { - super.dispose(); - for (ObjectDMC dmc : dmc_pool.values()) dmc.dispose(); - dmc_pool.clear(); - } - - @Override - public boolean startDataRetrieval() { - assert command == null; - if (tcf_reg_service == null) { - reset(null); - return true; - } - command = tcf_reg_service.getChildren(id, new org.eclipse.tm.tcf.services.IRegisters.DoneGetChildren() { - public void doneGetChildren(IToken token, Exception err, String[] contexts) { - if (command != token) return; - final LinkedHashMap<String,ObjectDMC> data = new LinkedHashMap<String,ObjectDMC>(); - if (err != null || contexts == null || contexts.length == 0) { - set(token, err, data); - return; - } - // TODO DSF service design does not support lazy retrieval of context attributes (because getName() is not async) - final Set<IToken> cmds = new HashSet<IToken>(); - final IToken cb = new IToken() { - public boolean cancel() { - for (IToken x : cmds) x.cancel(); - return false; - } - }; - command = cb; - org.eclipse.tm.tcf.services.IRegisters.DoneGetContext done = new org.eclipse.tm.tcf.services.IRegisters.DoneGetContext() { - public void doneGetContext(IToken token, Exception err, - org.eclipse.tm.tcf.services.IRegisters.RegistersContext context) { - cmds.remove(token); - if (command != cb) return; - if (err != null) { - command.cancel(); - set(cb, err, data); - return; - } - String id = context.getID(); - ObjectDMC dmc = model.get(id); - if (dmc == null) { - if (context.getBitNumbers() != null) { - dmc = new BitFieldDMC(getSession().getId(), parents, id); - } - else if (context.isReadable() || context.isWriteable()) { - dmc = new RegisterDMC(getSession().getId(), parents, id); - } - else { - dmc = new RegisterGroupDMC(getSession().getId(), parents, id); - } - } - dmc_pool.put(id, dmc); - dmc.context = context; - data.put(id, dmc); - if (cmds.isEmpty()) set(cb, null, data); - } - }; - for (String id : contexts) cmds.add(tcf_reg_service.getContext(id, done)); - } - }); - return false; - } - } - - private class RegisterValueCache extends TCFDataCache<FormattedValueDMData> { - - final org.eclipse.tm.tcf.services.IRegisters.RegistersContext context; - final String fmt; - - public RegisterValueCache(IChannel channel, - org.eclipse.tm.tcf.services.IRegisters.RegistersContext context, String fmt) { - super(channel); - this.context = context; - this.fmt = fmt; - } - - @Override - public boolean startDataRetrieval() { - assert command == null; - assert tcf_reg_service != null; - assert context != null; - command = context.get(new org.eclipse.tm.tcf.services.IRegisters.DoneGet() { - public void doneGet(IToken token, Exception err, byte[] value) { - if (command != token) return; - FormattedValueDMData data = null; - if (value != null) { - int radix = 10; - if (fmt.equals(HEX_FORMAT)) radix = 16; - else if (fmt.equals(OCTAL_FORMAT)) radix = 8; - byte[] temp = new byte[value.length + 1]; - temp[0] = 0; // Extra byte to avoid sign extension by BigInteger - if (context.isBigEndian()) { - System.arraycopy(value, 0, temp, 1, value.length); - } - else { - for (int i = 0; i < value.length; i++) { - temp[temp.length - i - 1] = value[i]; - } - } - String s = new BigInteger(temp).toString(radix); - switch (radix) { - case 8: - if (!s.startsWith("0")) s = "0" + s; - break; - case 16: - int l = value.length * 2 - s.length(); - if (l < 0) l = 0; - if (l > 16) l = 16; - s = "0000000000000000".substring(0, l) + s; - break; - } - data = new FormattedValueDMData(s); - } - set(token, err, data); - } - }); - return false; - } - } - - private static class RegisterGroupChangedEvent extends AbstractDMEvent<IRegisterGroupDMContext> - implements IGroupChangedDMEvent { - - public RegisterGroupChangedEvent(IRegisterGroupDMContext context) { - super(context); - } - } - - private static class RegisterChangedEvent extends AbstractDMEvent<IRegisterDMContext> - implements IRegisterChangedDMEvent { - - public RegisterChangedEvent(IRegisterDMContext context) { - super(context); - } - } - - private static class BitFieldChangedEvent extends AbstractDMEvent<IBitFieldDMContext> - implements IBitFieldChangedDMEvent { - - public BitFieldChangedEvent(IBitFieldDMContext context) { - super(context); - } - } - - private static class GroupsChangedEvent extends AbstractDMEvent<IDMContext> implements IGroupsChangedDMEvent { - - public GroupsChangedEvent(IExecutionDMContext context) { - super(context); - } - } - - private final org.eclipse.tm.tcf.services.IRegisters.RegistersListener listener = - new org.eclipse.tm.tcf.services.IRegisters.RegistersListener() { - - public void contextChanged() { - TCFDSFRunControl rc = getServicesTracker().getService(TCFDSFRunControl.class); - for (TCFDSFExecutionDMC dmc : rc.getCachedContexts()) { - RegisterChildrenCache c = (RegisterChildrenCache)dmc.registers_cache; - if (c != null) { - c.dispose(); - dmc.registers_cache = null; - getSession().dispatchEvent(new GroupsChangedEvent(dmc), getProperties()); - } - } - } - - public void registerChanged(String id) { - ObjectDMC dmc = model.get(id); - if (dmc != null) { - for (ValueDMC val : dmc.values.values()) val.cache.reset(); - dmc.children.invalidateRegContents(); - if (dmc instanceof RegisterGroupDMC) { - getSession().dispatchEvent(new RegisterGroupChangedEvent((RegisterGroupDMC)dmc), getProperties()); - } - else if (dmc instanceof RegisterDMC) { - getSession().dispatchEvent(new RegisterChangedEvent((RegisterDMC)dmc), getProperties()); - } - else if (dmc instanceof BitFieldDMC) { - getSession().dispatchEvent(new BitFieldChangedEvent((BitFieldDMC)dmc), getProperties()); - } - } - } - }; - - private final IChannel channel; - private final org.eclipse.tm.tcf.services.IRegisters tcf_reg_service; - private final Map<String,ObjectDMC> model; - - private final String[] available_formats = { - HEX_FORMAT, - DECIMAL_FORMAT, - OCTAL_FORMAT - }; - - public TCFDSFRegisters(DsfSession session, IChannel channel, final RequestMonitor monitor) { - super(session); - this.channel = channel; - model = new HashMap<String,ObjectDMC>(); - tcf_reg_service = channel.getRemoteService(org.eclipse.tm.tcf.services.IRegisters.class); - if (tcf_reg_service != null) tcf_reg_service.addListener(listener); - initialize(new RequestMonitor(getExecutor(), monitor) { - @Override - protected void handleSuccess() { - String[] class_names = { - org.eclipse.dd.dsf.debug.service.IRegisters.class.getName(), - TCFDSFRegisters.class.getName() - }; - register(class_names, new Hashtable<String,String>()); - getSession().addServiceEventListener(TCFDSFRegisters.this, null); - monitor.done(); - } - }); - } - - @Override - public void shutdown(RequestMonitor monitor) { - getSession().removeServiceEventListener(this); - unregister(); - super.shutdown(monitor); - } - - @Override - protected BundleContext getBundleContext() { - return Activator.getBundleContext(); - } - - public void getRegisterGroupData(IRegisterGroupDMContext dmc, DataRequestMonitor<IRegisterGroupDMData> rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - } - else if (dmc instanceof RegisterGroupDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - } - else { - rm.setData(new RegisterGroupData(((RegisterGroupDMC)dmc).context)); - } - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void getRegisterData(IRegisterDMContext dmc, DataRequestMonitor<IRegisterDMData> rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - } - else if (dmc instanceof RegisterDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - } - else { - rm.setData(new RegisterData(((RegisterDMC)dmc).context)); - } - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void getBitFieldData(IBitFieldDMContext dmc, DataRequestMonitor<IBitFieldDMData> rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - } - else if (dmc instanceof BitFieldDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - } - else { - rm.setData(new BitFieldData(((BitFieldDMC)dmc).context)); - } - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - private RegisterChildrenCache getRegisterChildrenCache(IDMContext dmc, DataRequestMonitor<?> rm) { - RegisterChildrenCache cache = null; - if (dmc instanceof CompositeDMContext) { - for (IDMContext ctx : dmc.getParents()) { - if (ctx instanceof TCFDSFExecutionDMC || ctx instanceof TCFDSFStack.TCFFrameDMC || - ctx instanceof RegisterGroupDMC || ctx instanceof RegisterDMC) { - dmc = ctx; - break; - } - } - } - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - } - else if (dmc instanceof TCFDSFExecutionDMC) { - TCFDSFExecutionDMC exe = (TCFDSFExecutionDMC)dmc; - if (exe.registers_cache == null) exe.registers_cache = - new RegisterChildrenCache(channel, exe.getTcfContextId(), new IDMContext[]{ exe }); - cache = (RegisterChildrenCache)exe.registers_cache; - } - else if (dmc instanceof ObjectDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - } - else { - cache = ((ObjectDMC)dmc).children; - } - } - else if (dmc instanceof TCFDSFStack.TCFFrameDMC && ((TCFDSFStack.TCFFrameDMC)dmc).level == 0) { - TCFDSFExecutionDMC exe = ((TCFDSFStack.TCFFrameDMC)dmc).exe_dmc; - if (exe.registers_cache == null) exe.registers_cache = - new RegisterChildrenCache(channel, exe.getTcfContextId(), new IDMContext[]{ exe }); - cache = (RegisterChildrenCache)exe.registers_cache; - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - return cache; - } - - public void getRegisterGroups(final IDMContext dmc, final DataRequestMonitor<IRegisterGroupDMContext[]> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getRegisterGroups(dmc, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - int cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof RegisterGroupDMC) cnt++; - } - RegisterGroupDMC[] arr = new RegisterGroupDMC[cnt]; - cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof RegisterGroupDMC) arr[cnt++] = (RegisterGroupDMC)x; - } - rm.setData(arr); - } - rm.done(); - } - - public void getRegisterSubGroups(IDMContext dmc, DataRequestMonitor<IRegisterGroupDMContext[]> rm) { - getRegisterGroups(dmc, rm); - } - - public void getRegisters(final IDMContext dmc, final DataRequestMonitor<IRegisterDMContext[]> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getRegisters(dmc, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - int cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof RegisterDMC) cnt++; - } - RegisterDMC[] arr = new RegisterDMC[cnt]; - cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof RegisterDMC) arr[cnt++] = (RegisterDMC)x; - } - rm.setData(arr); - } - rm.done(); - } - - public void getBitFields(final IDMContext dmc, final DataRequestMonitor<IBitFieldDMContext[]> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getBitFields(dmc, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - int cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof BitFieldDMC) cnt++; - } - BitFieldDMC[] arr = new BitFieldDMC[cnt]; - cnt = 0; - for (IDMContext x : c.values()) { - if (x instanceof BitFieldDMC) arr[cnt++] = (BitFieldDMC)x; - } - rm.setData(arr); - } - rm.done(); - } - - public void findBitField(final IDMContext dmc, final String name, final DataRequestMonitor<IBitFieldDMContext> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - findBitField(dmc, name, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - BitFieldDMC res = null; - for (IDMContext x : c.values()) { - if (x instanceof BitFieldDMC) { - if (((BitFieldDMC)x).getName().equals(name)) { - res = (BitFieldDMC)x; - break; - } - } - } - if (res != null) rm.setData(res); - else rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not found", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void findRegister(final IDMContext dmc, final String name, final DataRequestMonitor<IRegisterDMContext> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - findRegister(dmc, name, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - RegisterDMC res = null; - for (IDMContext x : c.values()) { - if (x instanceof RegisterDMC) { - if (((RegisterDMC)x).getName().equals(name)) { - res = (RegisterDMC)x; - break; - } - } - } - if (res != null) rm.setData(res); - else rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not found", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void findRegisterGroup(final IDMContext dmc, final String name, final DataRequestMonitor<IRegisterGroupDMContext> rm) { - if (rm.isCanceled()) return; - RegisterChildrenCache cache = getRegisterChildrenCache(dmc, rm); - if (cache != null) { - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - findRegisterGroup(dmc, name, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,ObjectDMC> c = cache.getData(); - RegisterGroupDMC res = null; - for (IDMContext x : c.values()) { - if (x instanceof RegisterGroupDMC) { - if (((RegisterGroupDMC)x).getName().equals(name)) { - res = (RegisterGroupDMC)x; - break; - } - } - } - if (res != null) rm.setData(res); - else rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Not found", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void writeBitField(IBitFieldDMContext dmc, String val, String fmt, final RequestMonitor rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - else if (dmc instanceof ObjectDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - int radix = 10; - if (fmt.equals(HEX_FORMAT)) radix = 16; - else if (fmt.equals(OCTAL_FORMAT)) radix = 8; - byte[] data = new BigInteger(val, radix).toByteArray(); - if (!((ObjectDMC)dmc).context.isBigEndian()) { - byte[] temp = new byte[data.length]; - for (int i = 0; i < data.length; i++) { - temp[temp.length - i - 1] = data[i]; - } - data = temp; - } - ((ObjectDMC)dmc).context.set(data, new org.eclipse.tm.tcf.services.IRegisters.DoneSet() { - public void doneSet(IToken token, Exception error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void writeBitField(IBitFieldDMContext dmc, IMnemonic mnemonic, final RequestMonitor rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - } - else if (dmc instanceof ObjectDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - NamedValue[] arr = ((ObjectDMC)dmc).context.getNamedValues(); - if (arr != null) { - for (NamedValue nv : arr) { - if (nv.getName().equals(mnemonic.getShortName())) { - byte[] val = nv.getValue(); - ((ObjectDMC)dmc).context.set(val, new org.eclipse.tm.tcf.services.IRegisters.DoneSet() { - public void doneSet(IToken token, Exception error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - return; - } - } - } - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown mnemonic", null)); //$NON-NLS-1$ - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public void writeRegister(IRegisterDMContext dmc, String val, String fmt, final RequestMonitor rm) { - if (tcf_reg_service == null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Registers service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - else if (dmc instanceof ObjectDMC) { - if (((ObjectDMC)dmc).disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - int radix = 10; - if (fmt.equals(HEX_FORMAT)) radix = 16; - else if (fmt.equals(OCTAL_FORMAT)) radix = 8; - byte[] data = new BigInteger(val, radix).toByteArray(); - if (!((ObjectDMC)dmc).context.isBigEndian()) { - byte[] temp = new byte[data.length]; - for (int i = 0; i < data.length; i++) { - temp[temp.length - i - 1] = data[i]; - } - data = temp; - } - ((ObjectDMC)dmc).context.set(data, new org.eclipse.tm.tcf.services.IRegisters.DoneSet() { - public void doneSet(IToken token, Exception error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getAvailableFormats(IFormattedDataDMContext dmc, DataRequestMonitor<String[]> rm) { - rm.setData(available_formats); - rm.done(); - } - - public void getFormattedExpressionValue(final FormattedValueDMContext dmc, - final DataRequestMonitor<FormattedValueDMData> rm) { - if (rm.isCanceled()) return; - if (dmc instanceof ValueDMC) { - ValueDMC vmc = (ValueDMC)dmc; - if (vmc.disposed) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - rm.done(); - return; - } - if (!vmc.cache.validate()) { - vmc.cache.wait(new Runnable() { - public void run() { - getFormattedExpressionValue(dmc, rm); - } - }); - return; - } - if (vmc.cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", vmc.cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - rm.setData(vmc.cache.getData()); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - } - rm.done(); - } - - public FormattedValueDMContext getFormattedValueContext(IFormattedDataDMContext dmc, String fmt) { - if (dmc instanceof ObjectDMC) { - ObjectDMC omc = (ObjectDMC)dmc; - ValueDMC res = omc.values.get(fmt); - if (res == null) { - omc.values.put(fmt, res = new ValueDMC(omc, fmt)); - } - return res; - } - return null; - } - - @SuppressWarnings("unchecked") - public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) { - if (dmc instanceof RegisterGroupDMC) { - getRegisterGroupData((RegisterGroupDMC)dmc, (DataRequestMonitor<IRegisterGroupDMData>)rm); - } - else if (dmc instanceof RegisterDMC) { - getRegisterData((RegisterDMC)dmc, (DataRequestMonitor<IRegisterDMData>)rm); - } - else if (dmc instanceof BitFieldDMC) { - getBitFieldData((BitFieldDMC)dmc, (DataRequestMonitor<IBitFieldDMData>)rm); - } - else if (dmc instanceof FormattedValueDMContext) { - getFormattedExpressionValue((FormattedValueDMContext)dmc, (DataRequestMonitor<FormattedValueDMData>)rm); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - @DsfServiceEventHandler - public void eventDispatched(org.eclipse.dd.dsf.debug.service.IRunControl.IResumedDMEvent e) { - if (e.getReason() != StateChangeReason.STEP) { - RegisterChildrenCache cache = (RegisterChildrenCache)((TCFDSFExecutionDMC)e.getDMContext()).registers_cache; - if (cache != null) cache.invalidateRegContents(); - } - } - - @DsfServiceEventHandler - public void eventDispatched(org.eclipse.dd.dsf.debug.service.IRunControl.ISuspendedDMEvent e) { - RegisterChildrenCache cache = (RegisterChildrenCache)((TCFDSFExecutionDMC)e.getDMContext()).registers_cache; - if (cache != null) cache.invalidateRegContents(); - } - - @DsfServiceEventHandler - public void eventDispatched(org.eclipse.dd.dsf.debug.service.IRunControl.IExitedDMEvent e) { - RegisterChildrenCache cache = (RegisterChildrenCache)((TCFDSFExecutionDMC)e.getDMContext()).registers_cache; - if (cache != null) cache.dispose(); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRunControl.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRunControl.java deleted file mode 100644 index 1fa80c91b..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRunControl.java +++ /dev/null @@ -1,1091 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMEvent; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.debug.model.DsfMemoryBlockRetrieval; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IMemoryBlockRetrieval; -import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension; -import org.eclipse.tm.internal.tcf.debug.actions.TCFActionStepInto; -import org.eclipse.tm.internal.tcf.debug.actions.TCFActionStepOut; -import org.eclipse.tm.internal.tcf.debug.actions.TCFActionStepOver; -import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants; -import org.eclipse.tm.internal.tcf.debug.model.TCFContextState; -import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch; -import org.eclipse.tm.internal.tcf.debug.model.TCFSourceRef; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.IRunControl; -import org.eclipse.tm.tcf.services.IRunControl.RunControlContext; -import org.eclipse.tm.tcf.services.IStackTrace.StackTraceContext; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.osgi.framework.BundleContext; - - -public class TCFDSFRunControl extends AbstractDsfService implements org.eclipse.dd.dsf.debug.service.IRunControl { - - public static class SuspendedEvent extends AbstractDMEvent<IExecutionDMContext> implements ISuspendedDMEvent { - - private final StateChangeReason reason; - - public SuspendedEvent(IExecutionDMContext dmc, String reason) { - super(dmc); - this.reason = toStateChangeReason(reason); - } - - public StateChangeReason getReason() { - return reason; - } - } - - public static class ResumedEvent extends AbstractDMEvent<IExecutionDMContext> implements IResumedDMEvent { - - public ResumedEvent(IExecutionDMContext dmc) { - super(dmc); - } - - public StateChangeReason getReason() { - return StateChangeReason.USER_REQUEST; - } - } - - public class ContainerSuspendedEvent extends AbstractDMEvent<IExecutionDMContext> implements IContainerSuspendedDMEvent { - - private final String trigger_id; - private final StateChangeReason reason; - - public ContainerSuspendedEvent(IExecutionDMContext dmc, String trigger_id, String reason) { - super(dmc); - this.trigger_id = trigger_id; - this.reason = toStateChangeReason(reason); - } - - public StateChangeReason getReason() { - return reason; - } - - public IExecutionDMContext[] getTriggeringContexts() { - IExecutionDMContext ctx = trigger_id == null ? null : cache.get(trigger_id); - return ctx == null ? new IExecutionDMContext[0] : new IExecutionDMContext[]{ ctx }; - } - } - - public class ContainerResumedEvent extends AbstractDMEvent<IExecutionDMContext> implements IContainerResumedDMEvent { - - private final String trigger_id; - - public ContainerResumedEvent(IExecutionDMContext dmc, String trigger_id) { - super(dmc); - this.trigger_id = trigger_id; - } - - public StateChangeReason getReason() { - return StateChangeReason.USER_REQUEST; - } - - public IExecutionDMContext[] getTriggeringContexts() { - IExecutionDMContext ctx = trigger_id == null ? null : cache.get(trigger_id); - return ctx == null ? new IExecutionDMContext[0] : new IExecutionDMContext[]{ ctx }; - } - } - - public static class StartedEvent extends AbstractDMEvent<IExecutionDMContext> implements IStartedDMEvent { - - public StartedEvent(IExecutionDMContext dmc) { - super(dmc); - } - } - - public static class ChangedEvent extends AbstractDMEvent<IExecutionDMContext> { - - public ChangedEvent(IExecutionDMContext dmc) { - super(dmc); - } - } - - public static class ExitedEvent extends AbstractDMEvent<IExecutionDMContext> implements IExitedDMEvent { - - public ExitedEvent(IContainerDMContext dmc) { - super(dmc); - } - } - - private final org.eclipse.tm.tcf.services.IRunControl.RunControlListener run_listener = - new org.eclipse.tm.tcf.services.IRunControl.RunControlListener() { - - public void containerResumed(String[] context_ids) { - for (String id : context_ids) { - ExecutionDMC n = cache.get(id); - if (n != null) n.onContextResumed(); - } - for (String id : context_ids) { - ExecutionDMC n = cache.get(id); - if (n != null && n.run_control_context_cache.isValid()) { - RunControlContext c = n.run_control_context_cache.getData(); - if (c.isContainer()) { - getSession().dispatchEvent(new ContainerResumedEvent(n, null), getProperties()); - } - } - } - } - - public void containerSuspended(String trigger_id, String pc, - String reason, Map<String, Object> params, - String[] suspended_ids) { - if (trigger_id != null) { - ExecutionDMC n = cache.get(trigger_id); - if (n != null) n.onContextSuspended(pc, reason, params); - } - for (String id : suspended_ids) { - if (id.equals(trigger_id)) continue; - ExecutionDMC n = cache.get(id); - if (n != null) n.onContainerSuspended(reason); - } - for (String id : suspended_ids) { - ExecutionDMC n = cache.get(id); - if (n != null && n.run_control_context_cache.isValid()) { - RunControlContext c = n.run_control_context_cache.getData(); - if (c.isContainer()) { - getSession().dispatchEvent(new ContainerSuspendedEvent(n, trigger_id, reason), getProperties()); - } - } - } - } - - public void contextAdded(RunControlContext[] contexts) { - for (RunControlContext ctx : contexts) { - ExecutionDMC n = cache.get(ctx.getParentID()); - if (n != null) n.onContextAdded(ctx); - } - } - - public void contextChanged(RunControlContext[] contexts) { - for (RunControlContext ctx : contexts) { - ExecutionDMC n = cache.get(ctx.getID()); - if (n != null) n.onContextChanged(ctx); - } - } - - public void contextException(String id, String msg) { - ExecutionDMC n = cache.get(id); - if (n != null) n.onContextException(msg); - } - - public void contextRemoved(String[] context_ids) { - for (String id : context_ids) { - ExecutionDMC n = cache.get(id); - if (n != null) n.onContextRemoved(); - } - } - - public void contextResumed(String id) { - ExecutionDMC n = cache.get(id); - if (n != null) n.onContextResumed(); - } - - public void contextSuspended(String id, String pc, String reason, Map<String, Object> params) { - ExecutionDMC n = cache.get(id); - if (n != null) n.onContextSuspended(pc, reason, params); - } - }; - - private class ExecutionDMC extends TCFDSFExecutionDMC { - - final String id; - final ExecutionDMC parent; - final IMemoryBlockRetrievalExtension mem_retrieval; - - boolean disposed; - int is_stepping; - int is_resuming; - - public ExecutionDMC(ExecutionDMC parent, final String id) { - super(channel, TCFDSFRunControl.this, parent == null ? - new IDMContext[0] : new IDMContext[] { parent }); - this.parent = parent; - this.id = id; - DsfMemoryBlockRetrieval mr = null; - try { - mr = new DsfMemoryBlockRetrieval(ITCFConstants.ID_TCF_DEBUG_MODEL, config, getSession()); - } - catch (DebugException e) { - e.printStackTrace(); - }; - mem_retrieval = mr; - } - - @Override - protected TCFDSFExecutionDMC addChild(String id) { - ExecutionDMC n = cache.get(id); - if (n == null) { - n = new ExecutionDMC(ExecutionDMC.this, id); - cache.put(id, n); - } - return n; - } - - @Override - public String toString() { - return baseToString() + ".context[" + id + "]"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - @Override - public boolean equals(Object obj) { - if (!super.baseEquals(obj)) return false; - String obj_id = ((ExecutionDMC)obj).id; - if (obj_id == null) return id == null; - return obj_id.equals(id); - } - - @Override - public int hashCode() { - if (id == null) return 0; - return id.hashCode(); - } - - @Override - @SuppressWarnings("unchecked") - public Object getAdapter(Class cls) { - Object obj = null; - if (cls == IMemoryBlockRetrieval.class) obj = mem_retrieval; - if (cls == IMemoryBlockRetrievalExtension.class) obj = mem_retrieval; - if (obj == null) obj = super.getAdapter(cls); - return obj; - } - - @Override - public String getTcfContextId() { - return id; - } - - @Override - public boolean isDisposed() { - return disposed; - } - - @Override - public void dispose() { - assert !disposed; - run_control_context_cache.cancel(); - run_control_children_cache.cancel(); - run_control_state_cache.cancel(); - if (run_control_children_cache.isValid()) { - Map<String,TCFDSFExecutionDMC> m = run_control_children_cache.getData(); - if (m != null) { - for (TCFDSFExecutionDMC n : m.values()) n.dispose(); - } - } - cache.remove(id); - disposed = true; - } - - /*--------------------------------------------------------------------------------------*/ - /* Events */ - - void onContextAdded(IRunControl.RunControlContext c) { - String id = c.getID(); - assert !disposed; - assert cache.get(id) == null; - ExecutionDMC n = new ExecutionDMC(this, id); - n.run_control_context_cache.reset(c); - if (run_control_children_cache.isValid()) { - Map<String,TCFDSFExecutionDMC> m = run_control_children_cache.getData(); - if (m != null) m.put(id, n); - } - cache.put(id, n); - getSession().dispatchEvent(new StartedEvent(n), getProperties()); - } - - void onContextChanged(IRunControl.RunControlContext c) { - assert !disposed; - run_control_context_cache.reset(c); - getSession().dispatchEvent(new ChangedEvent(this), getProperties()); - } - - void onContextRemoved() { - assert !disposed; - if (parent != null && parent.run_control_children_cache.isValid()) { - Map<String,TCFDSFExecutionDMC> m = parent.run_control_children_cache.getData(); - if (m != null) m.remove(id); - } - dispose(); - getSession().dispatchEvent(new ExitedEvent(this), getProperties()); - } - - void onContainerSuspended(String reason) { - assert !disposed; - if (!run_control_context_cache.isValid()) return; - RunControlContext rc = run_control_context_cache.getData(); - if (rc == null) return; - if (!rc.hasState()) return; - run_control_state_cache.reset(); - getSession().dispatchEvent(new SuspendedEvent(this, reason), getProperties()); - } - - void onContextSuspended(String pc, String reason, Map<String,Object> params) { - assert !disposed; - assert !run_control_context_cache.isValid() || run_control_context_cache.getData().hasState(); - TCFContextState st = new TCFContextState(); - st.is_suspended = true; - st.suspend_pc = pc; - st.suspend_reason = reason; - st.suspend_params = params; - run_control_state_cache.reset(st); - getSession().dispatchEvent(new SuspendedEvent(this, reason), getProperties()); - } - - void onContextResumed() { - assert !disposed; - assert !run_control_context_cache.isValid() || run_control_context_cache.getData().hasState(); - TCFContextState st = new TCFContextState(); - run_control_state_cache.reset(st); - getSession().dispatchEvent(new ResumedEvent(this), getProperties()); - } - - void onContextException(String msg) { - assert !disposed; - // TODO onContextException handling - } - } - - private static class ExecutionData implements IExecutionDMData { - - private final StateChangeReason reason; - - ExecutionData(StateChangeReason reason) { - this.reason = reason; - } - - public boolean isValid() { - return true; - } - - public StateChangeReason getStateChangeReason() { - return reason; - } - } - - private static StateChangeReason toStateChangeReason(String s) { - if (s == null) return StateChangeReason.UNKNOWN; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_USER_REQUEST)) return StateChangeReason.USER_REQUEST; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_STEP)) return StateChangeReason.STEP; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_BREAKPOINT)) return StateChangeReason.BREAKPOINT; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_EXCEPTION)) return StateChangeReason.EXCEPTION; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_CONTAINER)) return StateChangeReason.CONTAINER; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_WATCHPOINT)) return StateChangeReason.WATCHPOINT; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_SIGNAL)) return StateChangeReason.SIGNAL; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_SHAREDLIB)) return StateChangeReason.SHAREDLIB; - if (s.equals(org.eclipse.tm.tcf.services.IRunControl.REASON_ERROR)) return StateChangeReason.ERROR; - return StateChangeReason.UNKNOWN; - } - - private final ILaunchConfiguration config; - private final TCFLaunch launch; - private final IChannel channel; - private final org.eclipse.tm.tcf.services.IRunControl tcf_run_service; - private final Map<String,ExecutionDMC> cache = new HashMap<String,ExecutionDMC>(); - private final ExecutionDMC root_dmc; - - public TCFDSFRunControl(ILaunchConfiguration config, TCFLaunch launch, - DsfSession session, IChannel channel, final RequestMonitor monitor) { - super(session); - this.config = config; - this.launch = launch; - this.channel = channel; - tcf_run_service = channel.getRemoteService(org.eclipse.tm.tcf.services.IRunControl.class); - if (tcf_run_service != null) tcf_run_service.addListener(run_listener); - root_dmc = new ExecutionDMC(null, null); - cache.put(null, root_dmc); - initialize(new RequestMonitor(getExecutor(), monitor) { - @Override - protected void handleSuccess() { - String[] class_names = { - org.eclipse.dd.dsf.debug.service.IRunControl.class.getName(), - TCFDSFRunControl.class.getName() - }; - register(class_names, new Hashtable<String,String>()); - monitor.done(); - } - }); - } - - @Override - public void shutdown(RequestMonitor monitor) { - if (tcf_run_service != null) tcf_run_service.removeListener(run_listener); - unregister(); - super.shutdown(monitor); - } - - @Override - protected BundleContext getBundleContext() { - return Activator.getBundleContext(); - } - - @SuppressWarnings("unchecked") - public void getModelData(IDMContext dmc, final DataRequestMonitor<?> rm) { - if (dmc instanceof ExecutionDMC) { - final ExecutionDMC ctx = (ExecutionDMC)dmc; - if (!ctx.run_control_context_cache.validate()) { - ctx.run_control_context_cache.wait(new Runnable() { - public void run() { - getModelData(ctx, rm); - } - }); - return; - } - if (ctx.run_control_context_cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", ctx.run_control_context_cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - if (ctx.run_control_context_cache.getData() == null) { - ExecutionData dt = new ExecutionData(StateChangeReason.UNKNOWN); - ((DataRequestMonitor<IExecutionDMData>)rm).setData(dt); - rm.done(); - return; - } - if (!ctx.run_control_context_cache.getData().hasState()) { - ExecutionData dt = new ExecutionData(StateChangeReason.UNKNOWN); - ((DataRequestMonitor<IExecutionDMData>)rm).setData(dt); - rm.done(); - return; - } - if (!ctx.run_control_state_cache.validate()) { - ctx.run_control_state_cache.wait(new Runnable() { - public void run() { - getModelData(ctx, rm); - } - }); - return; - } - if (ctx.run_control_state_cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", ctx.run_control_state_cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - if (ctx.run_control_state_cache.getData() == null) { - ExecutionData dt = new ExecutionData(StateChangeReason.UNKNOWN); - ((DataRequestMonitor<IExecutionDMData>)rm).setData(dt); - rm.done(); - return; - } - ExecutionData dt = new ExecutionData(toStateChangeReason(ctx.run_control_state_cache.getData().suspend_reason)); - ((DataRequestMonitor<IExecutionDMData>)rm).setData(dt); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public boolean isValid() { - return true; - } - - public void canResume(final IExecutionDMContext context, final DataRequestMonitor<Boolean> rm) { - if (context instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)context; - if (!ctx.run_control_context_cache.validate()) { - ctx.run_control_context_cache.wait(new Runnable() { - public void run() { - canResume(context, rm); - } - }); - } - else { - RunControlContext c = ctx.run_control_context_cache.getData(); - rm.setData(c != null && c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_RESUME)); - rm.done(); - } - } - else { - rm.setData(false); - rm.done(); - } - } - - public void canStep(final IExecutionDMContext context, final StepType step_type, final DataRequestMonitor<Boolean> rm) { - if (context instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)context; - if (!ctx.run_control_context_cache.validate()) { - ctx.run_control_context_cache.wait(new Runnable() { - public void run() { - canStep(context, step_type, rm); - } - }); - } - else { - RunControlContext c = ctx.run_control_context_cache.getData(); - int md = toTCFStepType(step_type); - boolean b = c != null && c.canResume(md); - if (!b && c != null) { - // Check if can emulate desired step type - // TODO: check breakpoints service - it is needed to emulate step commands - switch (md) { - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER_LINE: - b = c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER) || - c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO); - break; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER: - b = c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO); - break; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO_LINE: - b = c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO); - break; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OUT: - b = c.canResume(org.eclipse.tm.tcf.services.IRunControl.RM_RESUME); - break; - } - } - rm.setData(b); - rm.done(); - } - } - else { - rm.setData(false); - rm.done(); - } - } - - public void canSuspend(final IExecutionDMContext context, final DataRequestMonitor<Boolean> rm) { - if (context instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)context; - if (!ctx.run_control_context_cache.validate()) { - ctx.run_control_context_cache.wait(new Runnable() { - public void run() { - canSuspend(context, rm); - } - }); - } - else { - RunControlContext c = ctx.run_control_context_cache.getData(); - rm.setData(c != null && c.canSuspend()); - rm.done(); - } - } - else { - rm.setData(false); - rm.done(); - } - } - - public TCFDSFExecutionDMC getContext(String id) { - return cache.get(id); - } - - public void getContainerContexts(IContainerDMContext context, final DataRequestMonitor<IExecutionDMContext[]> rm) { - getContexts(context, rm, false, false); - } - - public void getExecutionContexts(IContainerDMContext context, final DataRequestMonitor<IExecutionDMContext[]> rm) { - getContexts(context, rm, false, true); - } - - public void getAllContexts(IContainerDMContext context, final DataRequestMonitor<IExecutionDMContext[]> rm) { - getContexts(context, rm, true, true); - } - - public void getContexts(IContainerDMContext context, - final DataRequestMonitor<IExecutionDMContext[]> rm, - final boolean all, final boolean has_state) { - if (context == null) context = root_dmc; - if (context instanceof ExecutionDMC) { - final ExecutionDMC ctx = (ExecutionDMC)context; - TCFDataCache<Map<String,TCFDSFExecutionDMC>> cache = ctx.run_control_children_cache; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getContexts(ctx, rm, all, has_state); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - if (cache.getData() == null) { - rm.setData(new ExecutionDMC[0]); - rm.done(); - return; - } - final Set<Runnable> reqs = new HashSet<Runnable>(); - for (TCFDSFExecutionDMC e : cache.getData().values()) { - if (!e.run_control_context_cache.validate()) { - Runnable req = new Runnable() { - public void run() { - if (reqs.remove(this) && reqs.isEmpty()) getContexts(ctx, rm, all, has_state); - } - }; - reqs.add(req); - e.run_control_context_cache.wait(req); - } - // TODO DSF service design does not support lazy retrieval of context state (because isSuspened() is not async) - else if (!e.run_control_state_cache.validate()) { - Runnable req = new Runnable() { - public void run() { - if (reqs.remove(this) && reqs.isEmpty()) getContexts(ctx, rm, all, has_state); - } - }; - reqs.add(req); - e.run_control_state_cache.wait(req); - } - } - if (reqs.isEmpty()) { - ArrayList<TCFDSFExecutionDMC> l = new ArrayList<TCFDSFExecutionDMC>(); - for (TCFDSFExecutionDMC e : cache.getData().values()) { - assert e.run_control_context_cache.isValid(); - RunControlContext c = e.run_control_context_cache.getData(); - if (all || has_state == c.hasState()) l.add(e); - } - rm.setData(l.toArray(new ExecutionDMC[l.size()])); - rm.done(); - } - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public Collection<TCFDSFExecutionDMC> getCachedContexts() { - ArrayList<TCFDSFExecutionDMC> l = new ArrayList<TCFDSFExecutionDMC>(); - for (ExecutionDMC dmc : cache.values()) l.add(dmc); - return l; - } - - public int toTCFStepType(StepType step_type) { - switch (step_type) { - case STEP_OVER: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER_LINE; - case STEP_INTO: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO_LINE; - case STEP_RETURN: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OUT; - case INSTRUCTION_STEP_OVER: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER; - case INSTRUCTION_STEP_INTO: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO; - case INSTRUCTION_STEP_RETUTRN: - return org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OUT; - } - return -1; - } - - private class StepIntoAction extends TCFActionStepInto { - - private final ExecutionDMC ctx; - private final RequestMonitor monitor; - - private TCFDSFStack.TCFFrameDMC frame; - - StepIntoAction(TCFLaunch launch, ExecutionDMC ctx, RequestMonitor monitor, boolean src_step) { - super(launch, ctx.run_control_context_cache.getData(), src_step); - this.ctx = ctx; - this.monitor = monitor; - ctx.is_stepping++; - } - - @Override - protected TCFDataCache<TCFContextState> getContextState() { - return ctx.run_control_state_cache; - } - - @Override - protected TCFDataCache<TCFSourceRef> getLineInfo() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - frame = service.getTopFrame(ctx); - if (frame == null) return null; - } - return frame.source_cache; - } - - @Override - protected TCFDataCache<StackTraceContext> getStackFrame() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - frame = service.getTopFrame(ctx); - if (frame == null) return null; - } - return frame.context_cache; - } - - @Override - protected int getStackFrameIndex() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return 0; - frame = service.getTopFrame(ctx); - if (frame == null) return 0; - } - return frame.getLevel(); - } - - @Override - protected TCFDataCache<?> getStackTrace() { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - return service.getFramesCache(ctx, null); - } - - @Override - protected void exit(Throwable error) { - if (exited) return; - super.exit(error); - ctx.is_stepping--; - if (error != null) { - monitor.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - monitor.done(); - } - } - - private class StepOverAction extends TCFActionStepOver { - - private final ExecutionDMC ctx; - private final RequestMonitor monitor; - - private TCFDSFStack.TCFFrameDMC frame; - - StepOverAction(TCFLaunch launch, ExecutionDMC ctx, RequestMonitor monitor, boolean src_step) { - super(launch, ctx.run_control_context_cache.getData(), src_step); - this.ctx = ctx; - this.monitor = monitor; - ctx.is_stepping++; - } - - @Override - protected TCFDataCache<TCFContextState> getContextState() { - return ctx.run_control_state_cache; - } - - @Override - protected TCFDataCache<TCFSourceRef> getLineInfo() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - frame = service.getTopFrame(ctx); - if (frame == null) return null; - } - return frame.source_cache; - } - - @Override - protected TCFDataCache<StackTraceContext> getStackFrame() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - frame = service.getTopFrame(ctx); - if (frame == null) return null; - } - return frame.context_cache; - } - - @Override - protected int getStackFrameIndex() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return 0; - frame = service.getTopFrame(ctx); - if (frame == null) return 0; - } - return frame.getLevel(); - } - - @Override - protected TCFDataCache<?> getStackTrace() { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - return service.getFramesCache(ctx, null); - } - - @Override - protected void exit(Throwable error) { - if (exited) return; - super.exit(error); - ctx.is_stepping--; - if (error != null) { - monitor.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - monitor.done(); - } - } - - private class StepOutAction extends TCFActionStepOut { - - private final ExecutionDMC ctx; - private final RequestMonitor monitor; - - private TCFDSFStack.TCFFrameDMC frame; - - StepOutAction(TCFLaunch launch, ExecutionDMC ctx, RequestMonitor monitor) { - super(launch, ctx.run_control_context_cache.getData()); - this.ctx = ctx; - this.monitor = monitor; - ctx.is_stepping++; - } - - @Override - protected TCFDataCache<TCFContextState> getContextState() { - return ctx.run_control_state_cache; - } - - @Override - protected TCFDataCache<StackTraceContext> getStackFrame() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - frame = service.getTopFrame(ctx); - if (frame == null) return null; - } - return frame.context_cache; - } - - @Override - protected int getStackFrameIndex() { - if (frame == null) { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return 0; - frame = service.getTopFrame(ctx); - if (frame == null) return 0; - } - return frame.getLevel(); - } - - @Override - protected TCFDataCache<?> getStackTrace() { - TCFDSFStack service = getServicesTracker().getService(TCFDSFStack.class); - if (service == null) return null; - return service.getFramesCache(ctx, null); - } - - @Override - protected void exit(Throwable error) { - if (exited) return; - super.exit(error); - ctx.is_stepping--; - if (error != null) { - monitor.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - monitor.done(); - } - } - - public void step(final IExecutionDMContext context, final StepType step_type, final RequestMonitor rm) { - if (context instanceof ExecutionDMC) { - final ExecutionDMC ctx = (ExecutionDMC)context; - if (!ctx.run_control_context_cache.validate()) { - ctx.run_control_context_cache.wait(new Runnable() { - public void run() { - step(context, step_type, rm); - } - }); - return; - } - if (ctx.run_control_context_cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", ctx.run_control_context_cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - RunControlContext c = ctx.run_control_context_cache.getData(); - if (c != null) { - int md = toTCFStepType(step_type); - if (md < 0) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - NOT_SUPPORTED, "Invalid step type", null)); //$NON-NLS-1$ - rm.done(); - } - else { - switch (md) { - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO: - new StepIntoAction(launch, ctx, rm, false); - return; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_INTO_LINE: - new StepIntoAction(launch, ctx, rm, true); - return; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER: - new StepOverAction(launch, ctx, rm, false); - return; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OVER_LINE: - new StepOverAction(launch, ctx, rm, true); - return; - case org.eclipse.tm.tcf.services.IRunControl.RM_STEP_OUT: - new StepOutAction(launch, ctx, rm); - return; - } - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - NOT_SUPPORTED, "Invalid step type", null)); //$NON-NLS-1$ - rm.done(); - } - return; - } - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid context", null)); //$NON-NLS-1$ - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public boolean isStepping(IExecutionDMContext context) { - if (context instanceof ExecutionDMC) { - ExecutionDMC x = (ExecutionDMC)context; - return x.is_stepping > 0; - } - return false; - } - - public void resume(IExecutionDMContext context, final RequestMonitor rm) { - if (context instanceof ExecutionDMC) { - final ExecutionDMC ctx = (ExecutionDMC)context; - if (ctx.run_control_context_cache.isValid()) { - RunControlContext c = ctx.run_control_context_cache.getData(); - if (c != null) { - c.resume(org.eclipse.tm.tcf.services.IRunControl.RM_RESUME, 1, - new org.eclipse.tm.tcf.services.IRunControl.DoneCommand() { - public void doneCommand(IToken token, Exception error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - ctx.is_resuming--; - rm.done(); - } - }); - ctx.is_resuming++; - return; - } - } - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid context", null)); //$NON-NLS-1$ - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void suspend(IExecutionDMContext context, final RequestMonitor rm) { - if (context instanceof ExecutionDMC) { - final ExecutionDMC ctx = (ExecutionDMC)context; - if (ctx.run_control_context_cache.isValid()) { - RunControlContext c = ctx.run_control_context_cache.getData(); - if (c != null) { - c.suspend(new org.eclipse.tm.tcf.services.IRunControl.DoneCommand() { - public void doneCommand(IToken token, Exception error) { - if (rm.isCanceled()) return; - if (error != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Command error", error)); //$NON-NLS-1$ - } - rm.done(); - } - }); - return; - } - } - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Invalid context", null)); //$NON-NLS-1$ - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public boolean hasState(IExecutionDMContext context) { - boolean r = false; - if (context instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)context; - if (ctx.run_control_context_cache.isValid()) { - RunControlContext c = ctx.run_control_context_cache.getData(); - return c != null && c.hasState(); - } - } - return r; - } - - public boolean isSuspended(IExecutionDMContext context) { - boolean r = false; - if (context instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)context; - if (ctx.run_control_context_cache.isValid()) { - RunControlContext c = ctx.run_control_context_cache.getData(); - if (c != null && c.hasState()) { - if (ctx.is_resuming == 0 && ctx.is_stepping == 0 && ctx.run_control_state_cache.isValid()) { - TCFContextState st = ctx.run_control_state_cache.getData(); - if (st != null) r = st.is_suspended; - } - } - } - } - return r; - } - - public void getExecutionData(IExecutionDMContext dmc, DataRequestMonitor<IExecutionDMData> rm) { - if (dmc instanceof ExecutionDMC) { - ExecutionDMC ctx = (ExecutionDMC)dmc; - StateChangeReason r = StateChangeReason.UNKNOWN; - if (ctx.run_control_state_cache.isValid()) { - TCFContextState st = ctx.run_control_state_cache.getData(); - if (st != null && st.suspend_reason != null) { - r = toStateChangeReason(st.suspend_reason); - } - } - rm.setData(new ExecutionData(r)); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Given context: " + dmc + " is not an execution context.", null)); //$NON-NLS-1$ //$NON-NLS-2$ - } - rm.done(); - } -} diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFStack.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFStack.java deleted file mode 100644 index 3a4e09af8..000000000 --- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFStack.java +++ /dev/null @@ -1,530 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.tcf.dsf.services; - -import java.math.BigInteger; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import org.eclipse.cdt.core.IAddress; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMContext; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl; -import org.eclipse.dd.dsf.debug.service.IStack; -import org.eclipse.dd.dsf.debug.service.IRunControl.StateChangeReason; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfServiceEventHandler; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.tm.internal.tcf.debug.model.TCFSourceRef; -import org.eclipse.tm.internal.tcf.dsf.Activator; -import org.eclipse.tm.tcf.protocol.IChannel; -import org.eclipse.tm.tcf.protocol.IToken; -import org.eclipse.tm.tcf.services.ILineNumbers; -import org.eclipse.tm.tcf.services.IStackTrace; -import org.eclipse.tm.tcf.services.ILineNumbers.CodeArea; -import org.eclipse.tm.tcf.util.TCFDataCache; -import org.osgi.framework.BundleContext; - - -public class TCFDSFStack extends AbstractDsfService implements IStack { - - public class TCFFrameDMC extends AbstractDMContext implements IFrameDMContext, Comparable<TCFFrameDMC> { - - public final String id; - public final TCFDSFExecutionDMC exe_dmc; - public final TCFDataCache<IStackTrace.StackTraceContext> context_cache; - public final TCFDataCache<TCFSourceRef> source_cache; - - int level; - TCFSourceRef prev_data; - - public TCFFrameDMC(final TCFDSFExecutionDMC exe_dmc, final String id) { - super(TCFDSFStack.this.getSession().getId(), new IDMContext[] { exe_dmc }); - this.id = id; - this.exe_dmc = exe_dmc; - context_cache = new TCFDataCache<IStackTrace.StackTraceContext>(channel) { - - @Override - public boolean startDataRetrieval() { - assert command == null; - if (id == null || tcf_stk_service == null) { - reset(null); - return true; - } - command = tcf_stk_service.getContext(new String[]{ id }, new IStackTrace.DoneGetContext() { - public void doneGetContext(IToken token, Exception err, IStackTrace.StackTraceContext[] context) { - if (command != token) return; - IStackTrace.StackTraceContext ctx = null; - if (context != null && context.length > 0) ctx = context[0]; - set(token, err, ctx); - } - }); - return false; - } - }; - - source_cache = new TCFDataCache<TCFSourceRef>(channel) { - - @Override - protected boolean startDataRetrieval() { - if (!context_cache.validate(this)) return false; - IStackTrace.StackTraceContext ctx = context_cache.getData(); - Number n = ctx.getInstructionAddress(); - BigInteger a = null; - if (n != null) a = new BigInteger(n.toString()); - // Optimization: skip source position lookup if same address - TCFSourceRef data = null; - if (prev_data != null && prev_data.address != null && prev_data.address.equals(a)) { - data = prev_data; - } - else { - data = new TCFSourceRef(); - data.address = a; - if (!getSourcePos(data)) return false; - } - set(null, null, prev_data = data); - return true; - } - - private boolean getSourcePos(final TCFSourceRef data) { - if (tcf_lns_service == null) return true; - if (data.address == null) return true; - BigInteger a1 = data.address; - BigInteger a2 = data.address.add(BigInteger.valueOf(1)); - command = tcf_lns_service.mapToSource(exe_dmc.getTcfContextId(), a1, a2, new ILineNumbers.DoneMapToSource() { - public void doneMapToSource(IToken token, Exception err, CodeArea[] areas) { - if (command != token) return; - if (areas != null && areas.length > 0) { - for (ILineNumbers.CodeArea area : areas) { - if (data.area == null || area.start_line < data.area.start_line) { - data.area = area; - } - } - } - set(token, err, prev_data = data); - } - }); - return false; - } - }; - } - - public int getLevel() { - return level; - } - - @Override - public boolean equals(Object other) { - return super.baseEquals(other) && ((TCFFrameDMC)other).id.equals(id); - } - - @Override - public int hashCode() { - return id.hashCode(); - } - - @Override - public String toString() { - return baseToString() + ".frame[" + id + "]"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - public int compareTo(TCFFrameDMC f) { - if (level < f.level) return -1; - if (level > f.level) return +1; - return 0; - } - } - - public static class TCFFrameData implements IFrameDMData { - - public final IStackTrace.StackTraceContext context; - public final IAddress address; - public final int level; - public final String function; - public final ILineNumbers.CodeArea code_area; - - TCFFrameData(TCFFrameDMC dmc) { - context = dmc.context_cache.getData(); - TCFSourceRef ref = dmc.source_cache.getData(); - address = ref.address != null ? new TCFAddress(ref.address) : null; - level = dmc.getLevel(); - function = null; - code_area = ref.area; - } - - public IAddress getAddress() { - return address; - } - - public String getFunction() { - return function; - } - - public int getLevel() { - return level; - } - - public String getFile() { - if (code_area == null) return null; - return code_area.file; - } - - public int getLine() { - if (code_area == null) return -1; - return code_area.start_line; - } - - public int getColumn() { - if (code_area == null) return -1; - return code_area.start_column; - } - } - - private class FramesCache extends TCFDataCache<Map<String,TCFFrameDMC>> { - - private final TCFDSFExecutionDMC dmc; - private final Map<String,TCFFrameDMC> frame_pool; - - private String top_frame_id; - - FramesCache(IChannel channel, TCFDSFExecutionDMC dmc) { - super(channel); - this.dmc = dmc; - frame_pool = new HashMap<String,TCFFrameDMC>(); - } - - @Override - public boolean startDataRetrieval() { - assert command == null; - if (!dmc.run_control_context_cache.validate()) { - dmc.run_control_context_cache.wait(this); - return false; - } - if (dmc.run_control_context_cache.getError() != null) { - set(null, dmc.run_control_context_cache.getError(), null); - return true; - } - org.eclipse.tm.tcf.services.IRunControl.RunControlContext ctx = dmc.run_control_context_cache.getData(); - if (ctx == null || !ctx.hasState()) { - set(null, new Exception("DMC does not have a stack"), null); //$NON-NLS-1$ - return true; - } - if (tcf_stk_service == null) { - HashMap<String,TCFFrameDMC> data = new HashMap<String,TCFFrameDMC>(); - top_frame_id = "TopFrame:" + dmc.getTcfContextId(); - data.put(top_frame_id, createFrameDMC(top_frame_id, 0)); - set(null, null, data); - return true; - } - assert !dmc.isDisposed(); - command = tcf_stk_service.getChildren(dmc.getTcfContextId(), new IStackTrace.DoneGetChildren() { - public void doneGetChildren(IToken token, Exception err, String[] contexts) { - if (command != token) return; - HashMap<String,TCFFrameDMC> data = new HashMap<String,TCFFrameDMC>(); - if (contexts != null) { - for (int i = 0; i < contexts.length; i++) { - String id = contexts[i]; - data.put(id, createFrameDMC(id, contexts.length - i - 1)); - } - } - set(token, err, data); - } - }); - return false; - } - - TCFFrameDMC createFrameDMC(String id, int level) { - TCFFrameDMC n = frame_pool.get(id); - if (n == null) frame_pool.put(id, n = new TCFFrameDMC(dmc, id)); - n.level = level; - if (n.level == 0) top_frame_id = id; - return n; - } - - void invalidateFrames() { - reset(); - for (TCFFrameDMC dmc : frame_pool.values()) { - dmc.context_cache.reset(); - dmc.source_cache.reset(); - } - } - } - - private final IChannel channel; - private final IStackTrace tcf_stk_service; - private final ILineNumbers tcf_lns_service; - - public TCFDSFStack(DsfSession session, IChannel channel, final RequestMonitor monitor) { - super(session); - this.channel = channel; - tcf_stk_service = channel.getRemoteService(IStackTrace.class); - tcf_lns_service = channel.getRemoteService(ILineNumbers.class); - initialize(new RequestMonitor(getExecutor(), monitor) { - @Override - protected void handleSuccess() { - String[] class_names = { - IStack.class.getName(), - TCFDSFStack.class.getName() - }; - register(class_names, new Hashtable<String,String>()); - getSession().addServiceEventListener(TCFDSFStack.this, null); - monitor.done(); - } - }); - } - - @Override - public void shutdown(RequestMonitor monitor) { - getSession().removeServiceEventListener(this); - unregister(); - super.shutdown(monitor); - } - - @Override - protected BundleContext getBundleContext() { - return Activator.getBundleContext(); - } - - public void getArguments(IFrameDMContext dmc, DataRequestMonitor<IVariableDMContext[]> rm) { - if (dmc instanceof TCFFrameDMC) { - // TODO function arguments - rm.setData(new IVariableDMContext[0]); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getFrameData(final IFrameDMContext dmc, final DataRequestMonitor<IFrameDMData> rm) { - if (dmc instanceof TCFFrameDMC) { - final TCFFrameDMC frame_dmc = (TCFFrameDMC)dmc; - if (!frame_dmc.context_cache.validate()) { - frame_dmc.context_cache.wait(new Runnable() { - public void run() { - getFrameData(dmc, rm); - } - }); - return; - } - if (frame_dmc.context_cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", frame_dmc.context_cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - if (!frame_dmc.source_cache.validate()) { - frame_dmc.source_cache.wait(new Runnable() { - public void run() { - getFrameData(dmc, rm); - } - }); - return; - } - if (frame_dmc.source_cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", frame_dmc.source_cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - rm.setData(new TCFFrameData(frame_dmc)); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public TCFDataCache<?> getFramesCache(TCFDSFExecutionDMC exe, DataRequestMonitor<?> rm) { - if (tcf_stk_service == null) { - if (rm != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Stack trace service is not available", null)); //$NON-NLS-1$ - rm.done(); - } - return null; - } - if (exe.isDisposed()) { - if (rm != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Disposed DMC", null)); //$NON-NLS-1$ - rm.done(); - } - return null; - } - if (exe.stack_frames_cache == null) exe.stack_frames_cache = new FramesCache(channel, exe); - return (FramesCache)exe.stack_frames_cache; - } - - public void getFrames(final IDMContext dmc, final DataRequestMonitor<IFrameDMContext[]> rm) { - if (dmc instanceof TCFDSFExecutionDMC) { - TCFDSFExecutionDMC exe = (TCFDSFExecutionDMC)dmc; - FramesCache cache = (FramesCache)getFramesCache(exe, rm); - if (cache == null) return; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getFrames(dmc, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - Map<String,TCFFrameDMC> map = cache.getData(); - TCFFrameDMC[] arr = map.values().toArray(new TCFFrameDMC[map.size()]); - Arrays.sort(arr); - rm.setData(arr); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getLocals(IFrameDMContext dmc, DataRequestMonitor<IVariableDMContext[]> rm) { - if (dmc instanceof TCFFrameDMC) { - // TODO function local variables - rm.setData(new IVariableDMContext[0]); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getStackDepth(final IDMContext dmc, final int maxDepth, final DataRequestMonitor<Integer> rm) { - if (dmc instanceof TCFDSFExecutionDMC) { - TCFDSFExecutionDMC exe = (TCFDSFExecutionDMC)dmc; - FramesCache cache = (FramesCache)getFramesCache(exe, rm); - if (cache == null) return; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getStackDepth(dmc, maxDepth, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - rm.setData(cache.getData().size()); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public void getTopFrame(final IDMContext dmc, final DataRequestMonitor<IFrameDMContext> rm) { - if (dmc instanceof TCFDSFExecutionDMC) { - TCFDSFExecutionDMC exe = (TCFDSFExecutionDMC)dmc; - FramesCache cache = (FramesCache)getFramesCache(exe, rm); - if (cache == null) return; - if (!cache.validate()) { - cache.wait(new Runnable() { - public void run() { - getTopFrame(dmc, rm); - } - }); - return; - } - if (cache.getError() != null) { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - REQUEST_FAILED, "Data error", cache.getError())); //$NON-NLS-1$ - rm.done(); - return; - } - rm.setData(cache.createFrameDMC(cache.top_frame_id, 0)); - rm.done(); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - public TCFFrameDMC getTopFrame(TCFDSFExecutionDMC exe) { - FramesCache cache = (FramesCache)getFramesCache(exe, null); - assert cache != null; - assert cache.isValid(); - assert cache.getError() == null; - return cache.createFrameDMC(cache.top_frame_id, 0); - } - - public void getVariableData(IVariableDMContext variableDmc, DataRequestMonitor<IVariableDMData> rm) { - // TODO model data for local variables - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - - public boolean isStackAvailable(IDMContext dmc) { - return tcf_stk_service != null && dmc instanceof TCFDSFExecutionDMC; - } - - @SuppressWarnings("unchecked") - public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) { - if (dmc instanceof IFrameDMContext) { - getFrameData((IFrameDMContext)dmc, (DataRequestMonitor<IFrameDMData>)rm); - } - else { - rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, - INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - @DsfServiceEventHandler - public void eventDispatched(IRunControl.IResumedDMEvent e) { - if (e.getReason() != StateChangeReason.STEP) { - FramesCache cache = (FramesCache)((TCFDSFExecutionDMC)e.getDMContext()).stack_frames_cache; - if (cache != null) cache.invalidateFrames(); - } - } - - @DsfServiceEventHandler - public void eventDispatched(IRunControl.ISuspendedDMEvent e) { - FramesCache cache = (FramesCache)((TCFDSFExecutionDMC)e.getDMContext()).stack_frames_cache; - if (cache != null) cache.invalidateFrames(); - } - - @DsfServiceEventHandler - public void eventDispatched(IRunControl.IExitedDMEvent e) { - FramesCache cache = (FramesCache)((TCFDSFExecutionDMC)e.getDMContext()).stack_frames_cache; - if (cache != null) cache.dispose(); - } -} |