Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-08-12 13:39:39 -0400
committerMike Rennie2013-08-12 13:40:15 -0400
commit7076decdceeadf55f1dc9aa6a3bb65ecf5b64f83 (patch)
tree84b0fe33f090bb92f48dd05f91ecddca48f29bce /org.eclipse.debug.examples.memory
parent67cbbcd605b80ae26e36621af6643bf983f3de76 (diff)
downloadeclipse.platform.debug-7076decdceeadf55f1dc9aa6a3bb65ecf5b64f83.tar.gz
eclipse.platform.debug-7076decdceeadf55f1dc9aa6a3bb65ecf5b64f83.tar.xz
eclipse.platform.debug-7076decdceeadf55f1dc9aa6a3bb65ecf5b64f83.zip
Bug 414212 - Add memory examples
Diffstat (limited to 'org.eclipse.debug.examples.memory')
-rw-r--r--org.eclipse.debug.examples.memory/.classpath8
-rw-r--r--org.eclipse.debug.examples.memory/.project28
-rw-r--r--org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.core.prefs409
-rw-r--r--org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.ui.prefs109
-rw-r--r--org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF22
-rw-r--r--org.eclipse.debug.examples.memory/build.properties11
-rw-r--r--org.eclipse.debug.examples.memory/icons/full/obj16/hex_tree.gifbin0 -> 587 bytes
-rw-r--r--org.eclipse.debug.examples.memory/icons/full/obj16/launch.gifbin0 -> 325 bytes
-rw-r--r--org.eclipse.debug.examples.memory/icons/full/obj16/memory_segment.gifbin0 -> 361 bytes
-rw-r--r--org.eclipse.debug.examples.memory/icons/full/obj16/memory_unit.gifbin0 -> 197 bytes
-rw-r--r--org.eclipse.debug.examples.memory/plugin.properties6
-rw-r--r--org.eclipse.debug.examples.memory/plugin.xml78
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/MemoryViewSamplePlugin.java127
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/Messages.java20
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleDebugTarget.java323
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java422
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java31
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegisterGroup.java70
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java186
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java273
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java59
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java80
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/messages.properties6
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleEngine.java367
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleMemoryUnit.java36
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchConfigurationDelegateEx.java42
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchTabGroup.java36
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleModelPresentation.java168
28 files changed, 2917 insertions, 0 deletions
diff --git a/org.eclipse.debug.examples.memory/.classpath b/org.eclipse.debug.examples.memory/.classpath
new file mode 100644
index 000000000..342ed2c14
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib" path="bin" sourcepath="bin"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.debug.examples.memory/.project b/org.eclipse.debug.examples.memory/.project
new file mode 100644
index 000000000..2589572a0
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.debug.examples.memory</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/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..3d48a5a78
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,409 @@
+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
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=0
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=0
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+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=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+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.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+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=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=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_semicolon_in_try_resources=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_try=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_try=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_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=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=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+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.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..666d89f41
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,109 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Platform Debug Cleanups
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Platform Debug Formatting
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..96690739b
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.debug.examples.memory;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-ClassPath: bin/
+Bundle-Activator: org.eclipse.debug.examples.internal.memory.MemoryViewSamplePlugin
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
+Export-Package: org.eclipse.debug.examples.internal.memory;x-internal:=true,
+ org.eclipse.debug.examples.internal.memory.core;x-internal:=true,
+ org.eclipse.debug.examples.internal.memory.engine;x-internal:=true,
+ org.eclipse.debug.examples.internal.memory.launchconfig;x-internal:=true
+Require-Bundle: org.eclipse.core.expressions,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.core;bundle-version="3.9.0",
+ org.eclipse.debug.ui;bundle-version="3.10.0",
+ org.eclipse.core.resources,
+ org.eclipse.jface.text
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.debug.examples.memory/build.properties b/org.eclipse.debug.examples.memory/build.properties
new file mode 100644
index 000000000..1f9ff115c
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/build.properties
@@ -0,0 +1,11 @@
+bin.includes = .classpath,\
+ .project,\
+ build.properties,\
+ icons/,\
+ plugin.xml,\
+ bin/,\
+ META-INF/,\
+ plugin.properties
+output.. = bin/
+src.includes = icons/
+source.. = src/
diff --git a/org.eclipse.debug.examples.memory/icons/full/obj16/hex_tree.gif b/org.eclipse.debug.examples.memory/icons/full/obj16/hex_tree.gif
new file mode 100644
index 000000000..2fa1d777b
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/icons/full/obj16/hex_tree.gif
Binary files differ
diff --git a/org.eclipse.debug.examples.memory/icons/full/obj16/launch.gif b/org.eclipse.debug.examples.memory/icons/full/obj16/launch.gif
new file mode 100644
index 000000000..7ce111283
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/icons/full/obj16/launch.gif
Binary files differ
diff --git a/org.eclipse.debug.examples.memory/icons/full/obj16/memory_segment.gif b/org.eclipse.debug.examples.memory/icons/full/obj16/memory_segment.gif
new file mode 100644
index 000000000..173661c5d
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/icons/full/obj16/memory_segment.gif
Binary files differ
diff --git a/org.eclipse.debug.examples.memory/icons/full/obj16/memory_unit.gif b/org.eclipse.debug.examples.memory/icons/full/obj16/memory_unit.gif
new file mode 100644
index 000000000..a831fe727
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/icons/full/obj16/memory_unit.gif
Binary files differ
diff --git a/org.eclipse.debug.examples.memory/plugin.properties b/org.eclipse.debug.examples.memory/plugin.properties
new file mode 100644
index 000000000..f1d3653e0
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/plugin.properties
@@ -0,0 +1,6 @@
+#Properties file for org.eclipse.debug.examples.memory
+Bundle-Vendor = Eclipse.org
+Bundle-Name = Sample Memory View Plugin
+launchConfigurationType.name = Sample Memory Launch Type
+context.description = Sample Adapter
+context.name = Sample Adapter \ No newline at end of file
diff --git a/org.eclipse.debug.examples.memory/plugin.xml b/org.eclipse.debug.examples.memory/plugin.xml
new file mode 100644
index 000000000..caceaeffa
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/plugin.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+
+<!-- Launch Configuration for IExtendedMemoryBlock -->
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.debug.examples.internal.memory.launchconfig.SampleLaunchConfigurationDelegateEx"
+ id="example.debug.memoryview.samplelaunch.iextendedmemoryblock"
+ modes="debug"
+ name="%launchConfigurationType.name"
+ public="true">
+ </launchConfigurationType>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ type="example.debug.memoryview.samplelaunch.iextendedmemoryblock"
+ class="org.eclipse.debug.examples.internal.memory.launchconfig.SampleLaunchTabGroup"
+ id="example.debug.memoryview.samplelaunch.sampletabgroup">
+ </launchConfigurationTabGroup>
+ </extension>
+<!-- model presentation -->
+<extension
+ point="org.eclipse.debug.ui.debugModelPresentations">
+ <debugModelPresentation
+ class="org.eclipse.debug.examples.internal.memory.launchconfig.SampleModelPresentation"
+ id="example.debug.memoryview">
+ </debugModelPresentation>
+</extension>
+<!-- rendering bindings -->
+<extension
+ point="org.eclipse.debug.ui.memoryRenderings">
+ <renderingBindings
+ defaultIds="org.eclipse.debug.ui.rendering.raw_memory,org.eclipse.debug.ui.rendering.signedint"
+ 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.debug.examples.internal.memory.core.SampleMemoryBlock"/>
+ </enablement>
+ </renderingBindings>
+</extension>
+<!-- context binding to open memory view automatically -->
+<extension
+ point="org.eclipse.ui.contexts">
+ <context
+ name="%context.name"
+ description="%context.description"
+ parentId="org.eclipse.debug.ui.debugging"
+ id="example.debug.memoryview.debugging">
+ </context>
+
+</extension>
+ <extension
+ point="org.eclipse.debug.ui.debugModelContextBindings">
+ <modelContextBinding
+ debugModelId="example.debug.memoryview"
+ contextId="example.debug.memoryview.debugging">
+ </modelContextBinding>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.contextViewBindings">
+ <contextViewBinding
+ autoOpen="true"
+ contextId="example.debug.memoryview.debugging"
+ viewId="org.eclipse.debug.ui.MemoryView">
+ </contextViewBinding>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ configTypeID="example.debug.memoryview.samplelaunch.iextendedmemoryblock"
+ icon="icons/full/obj16/launch.gif"
+ id="example.debug.memoryview.launchConfigurationTypeImage1"/>
+ </extension>
+</plugin>
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/MemoryViewSamplePlugin.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/MemoryViewSamplePlugin.java
new file mode 100644
index 000000000..eec34d170
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/MemoryViewSamplePlugin.java
@@ -0,0 +1,127 @@
+package org.eclipse.debug.examples.internal.memory;
+
+import java.net.URL;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class for sample adapter
+ */
+public class MemoryViewSamplePlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.debug.examples.memory"; //$NON-NLS-1$
+
+ // The shared instance.
+ private static MemoryViewSamplePlugin plugin;
+
+ // Resource bundle.
+ private ResourceBundle resourceBundle;
+
+ private final static String ICONS_PATH = "icons/full/";//$NON-NLS-1$
+ private final static String PATH_OBJECT = ICONS_PATH + "obj16/"; //Model object icons //$NON-NLS-1$
+
+ public final static String IMG_OBJ_HEX_TREE = "IMB_OBJ_HEX_TREE"; //$NON-NLS-1$
+ public final static String IMG_OBJ_MEMORY_SEGMENT = "IMG_OBJ_MEMORY_SEGMENT"; //$NON-NLS-1$
+ public final static String IMG_OBJ_MEMORY_UNIT = "IMG_OBJ_MEMORY_UNIT"; //$NON-NLS-1$
+
+ /**
+ * The constructor.
+ */
+ public MemoryViewSamplePlugin() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle(PLUGIN_ID);
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static MemoryViewSamplePlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle, or 'key' if not
+ * found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = MemoryViewSamplePlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse
+ * .jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ declareImage(IMG_OBJ_HEX_TREE, PATH_OBJECT + "hex_tree.gif"); //$NON-NLS-1$
+ declareImage(IMG_OBJ_MEMORY_SEGMENT, PATH_OBJECT + "memory_segment.gif"); //$NON-NLS-1$
+ declareImage(IMG_OBJ_MEMORY_UNIT, PATH_OBJECT + "memory_unit.gif"); //$NON-NLS-1$
+ }
+
+ /**
+ * Declares a workbench image given the path of the image file (relative to
+ * the workbench plug-in). This is a helper method that creates the image
+ * descriptor and passes it to the main <code>declareImage</code> method.
+ *
+ * @param symbolicName the symbolic name of the image
+ * @param path the path of the image file relative to the base of the
+ * workbench plug-ins install directory <code>false</code> if
+ * this is not a shared image
+ */
+ private void declareImage(String key, String path) {
+ ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
+ Bundle bundle = Platform.getBundle(PLUGIN_ID);
+ URL url = null;
+ if (bundle != null) {
+ url = FileLocator.find(bundle, new Path(path), null);
+ if (url != null) {
+ desc = ImageDescriptor.createFromURL(url);
+ }
+ }
+ getImageRegistry().put(key, desc);
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/Messages.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/Messages.java
new file mode 100644
index 000000000..fda8edf73
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/Messages.java
@@ -0,0 +1,20 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.debug.examples.internal.memory.core.messages"; //$NON-NLS-1$
+ public static String SampleDebugTarget_0;
+ public static String SampleDebugTarget_1;
+ public static String SampleMemoryBlock_0;
+ public static String SampleRegisterGroup_0;
+ public static String SampleStackFrame_0;
+ public static String SampleThread_0;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleDebugTarget.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleDebugTarget.java
new file mode 100644
index 000000000..2578937a0
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleDebugTarget.java
@@ -0,0 +1,323 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IMemoryBlock;
+import org.eclipse.debug.core.model.IMemoryBlockExtension;
+import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.examples.internal.memory.MemoryViewSamplePlugin;
+import org.eclipse.debug.examples.internal.memory.engine.SampleEngine;
+
+/**
+ * Abstract Sample debug target
+ */
+
+public class SampleDebugTarget extends DebugElement implements IDebugTarget, IMemoryBlockRetrievalExtension {
+
+ boolean fTerminate = false;
+ boolean fSuspend = true;
+
+ protected ILaunch fLaunch;
+ protected SampleEngine fEngine = new SampleEngine();
+ protected ArrayList<IMemoryBlockExtension> fMemoryBlocks = new ArrayList<IMemoryBlockExtension>();
+ protected IThread fThread;
+ protected boolean fBusy;
+
+ /**
+ * Creates SampleDebugTarget
+ *
+ * @param launch the launch this debug target belongs to
+ */
+ public SampleDebugTarget(ILaunch launch) {
+ super(null);
+ fLaunch = launch;
+ fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugTarget#getProcess()
+ */
+ @Override
+ public IProcess getProcess() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugTarget#hasThreads()
+ */
+ @Override
+ public boolean hasThreads() throws DebugException {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(org.eclipse
+ * .debug.core.model.IBreakpoint)
+ */
+ @Override
+ public boolean supportsBreakpoint(IBreakpoint breakpoint) {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
+ */
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
+ */
+ @Override
+ public ILaunch getLaunch() {
+ return fLaunch;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
+ */
+ @Override
+ public boolean canTerminate() {
+ return !fTerminate;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
+ */
+ @Override
+ public boolean isTerminated() {
+ return fTerminate;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#terminate()
+ */
+ @Override
+ public void terminate() throws DebugException {
+ fTerminate = true;
+ fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
+ */
+ @Override
+ public boolean canResume() {
+ return fSuspend && !fTerminate;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
+ */
+ @Override
+ public boolean canSuspend() {
+ return !fSuspend && !fTerminate;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
+ */
+ @Override
+ public boolean isSuspended() {
+ return fSuspend;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#resume()
+ */
+ @Override
+ public void resume() throws DebugException {
+ fSuspend = false;
+ fEngine.resume();
+ fireEvent(new DebugEvent(this, DebugEvent.RESUME));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
+ */
+ @Override
+ public void suspend() throws DebugException {
+ fSuspend = true;
+ fireEvent(new DebugEvent(getEngine().getThreads(this)[0], DebugEvent.SUSPEND));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse
+ * .debug.core.model.IBreakpoint)
+ */
+ @Override
+ public void breakpointAdded(IBreakpoint breakpoint) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse
+ * .debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
+ */
+ @Override
+ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse
+ * .debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
+ */
+ @Override
+ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
+ */
+ @Override
+ public boolean canDisconnect() {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDisconnect#disconnect()
+ */
+ @Override
+ public void disconnect() throws DebugException {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDisconnect#isDisconnected()
+ */
+ @Override
+ public boolean isDisconnected() {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval
+ * ()
+ */
+ @Override
+ public boolean supportsStorageRetrieval() {
+ return true;
+ }
+
+ /**
+ * @return the debug engine
+ */
+ public SampleEngine getEngine() {
+ return fEngine;
+ }
+
+ /**
+ * Remove the memory block from this debug session.
+ *
+ * @param memBlk
+ */
+ public void removeMemoryBlock(IMemoryBlock memBlk) {
+ fMemoryBlocks.remove(memBlk);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long,
+ * long)
+ */
+ @Override
+ public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException {
+
+ return null;
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+
+ if (adapter == ILaunch.class) {
+ return getLaunch();
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ @Override
+ public IThread[] getThreads() throws DebugException {
+ if (isTerminated()) {
+ return new IThread[0];
+ }
+
+ return getEngine().getThreads(this);
+ }
+
+ @Override
+ public String getName() throws DebugException {
+ return Messages.SampleDebugTarget_0;
+ }
+
+ @Override
+ public String getModelIdentifier() {
+ return MemoryViewSamplePlugin.PLUGIN_ID;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension#
+ * getExtendedMemoryBlock(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public IMemoryBlockExtension getExtendedMemoryBlock(String expression, Object context) throws DebugException {
+
+ // ask debug engine for an address
+ BigInteger address = getEngine().evaluateExpression(expression, context);
+
+ // if address can be evaluated to an address, create memory block
+ if (address != null) {
+ IMemoryBlockExtension memoryBlock = new SampleMemoryBlock(this, expression, address);
+ fMemoryBlocks.add(memoryBlock);
+
+ return memoryBlock;
+ }
+ // otherwise throw debug exception
+ IStatus status = new Status(IStatus.ERROR, MemoryViewSamplePlugin.PLUGIN_ID, 0, Messages.SampleDebugTarget_1, null);
+ DebugException exception = new DebugException(status);
+ throw exception;
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
new file mode 100644
index 000000000..23990ea05
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
@@ -0,0 +1,422 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IMemoryBlockExtension;
+import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
+import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
+import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.examples.internal.memory.MemoryViewSamplePlugin;
+import org.eclipse.debug.examples.internal.memory.launchconfig.SampleModelPresentation;
+import org.eclipse.jface.viewers.IColorProvider;
+
+/**
+ * Memory Block Implementation
+ *
+ */
+public class SampleMemoryBlock extends DebugElement implements IMemoryBlockExtension {
+
+ private String fExpression;
+ private SampleDebugTarget fDebugTarget;
+
+ private boolean isEnabled = true;
+ private BigInteger fBaseAddress;
+
+ private ArrayList<Object> fConnections = new ArrayList<Object>();
+
+ /**
+ * Creates memory block
+ *
+ * @param debugTarget
+ * @param expression
+ * @param address
+ */
+ public SampleMemoryBlock(SampleDebugTarget debugTarget, String expression, BigInteger address) {
+ super(debugTarget);
+ fDebugTarget = debugTarget;
+ fExpression = expression;
+ fBaseAddress = address;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getBigBaseAddress()
+ */
+ @Override
+ public BigInteger getBigBaseAddress() throws DebugException {
+ fBaseAddress = fDebugTarget.getEngine().evaluateExpression(fExpression, null);
+ return fBaseAddress;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#
+ * supportBaseAddressModification()
+ */
+ @Override
+ public boolean supportBaseAddressModification() throws DebugException {
+ return fDebugTarget.getEngine().suppostsBaseAddressModification(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#setBaseAddress(java
+ * .math.BigInteger)
+ */
+ @Override
+ public void setBaseAddress(BigInteger address) throws DebugException {
+ try {
+ fDebugTarget.getEngine().setBaseAddress(this, address);
+ } catch (CoreException e) {
+ throw new DebugException(e.getStatus());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getBytesFromOffset
+ * (long, long)
+ */
+ @Override
+ synchronized public MemoryByte[] getBytesFromOffset(BigInteger offset, long length) throws DebugException {
+ BigInteger address = fBaseAddress.subtract(offset);
+ return getBytesFromAddress(address, length);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getBytesFromAddress
+ * (java.math.BigInteger, long)
+ */
+ @Override
+ public MemoryByte[] getBytesFromAddress(BigInteger address, long length) throws DebugException {
+
+ try {
+ MemoryByte[] bytes = new MemoryByte[(int) length * fDebugTarget.getEngine().getAddressableSize()];
+ BigInteger addressCnt = address;
+ int lengthCnt = (int) length;
+ int i = 0;
+
+ // asks engine to get bytes from address
+ MemoryByte[] engineBytes = fDebugTarget.getEngine().getBytesFromAddress(addressCnt, lengthCnt);
+ System.arraycopy(engineBytes, 0, bytes, i, engineBytes.length);
+
+ // if engine did not return enough memory, pad with dummy memory
+ for (int j = i + engineBytes.length; j < bytes.length; j++) {
+ MemoryByte mb = new MemoryByte((byte) 0);
+ mb.setReadable(false);
+ mb.setWritable(false);
+ mb.setBigEndian(fDebugTarget.getEngine().isBigEndian(address.add(BigInteger.valueOf(j))));
+ bytes[j] = mb;
+ }
+
+ return bytes;
+ } catch (RuntimeException e) {
+ throw e;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#connect(java.lang.
+ * Object)
+ */
+ @Override
+ public void connect(Object object) {
+
+ if (!fConnections.contains(object)) {
+ fConnections.add(object);
+ }
+
+ if (fConnections.size() == 1) {
+ enable();
+ }
+ }
+
+ /**
+ * Enable this memory block
+ */
+ private void enable() {
+ isEnabled = true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#disconnect(java.lang
+ * .Object)
+ */
+ @Override
+ public void disconnect(Object object) {
+
+ if (fConnections.contains(object)) {
+ fConnections.remove(object);
+ }
+
+ if (fConnections.size() == 0) {
+ disable();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#getConnected()
+ */
+ @Override
+ public Object[] getConnections() {
+ return fConnections.toArray();
+ }
+
+ /**
+ * Disable this memory block
+ */
+ private void disable() {
+ isEnabled = false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress()
+ */
+ @Override
+ public long getStartAddress() {
+ // no need to implement this method as it belongs to IMemoryBlock
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlock#getLength()
+ */
+ @Override
+ public long getLength() {
+ // no need to implement this method as it belongs to IMemoryBlock
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlock#getBytes()
+ */
+ @Override
+ public byte[] getBytes() throws DebugException {
+ // no need to implement this method as it belongs to IMemoryBlock
+ return new byte[0];
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification()
+ */
+ @Override
+ public boolean supportsValueModification() {
+ return fDebugTarget.getEngine().supportsValueModification(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[])
+ */
+ @Override
+ public void setValue(BigInteger offset, byte[] bytes) throws DebugException {
+ try {
+ // ask the engine to modify memory at specified address
+ fDebugTarget.getEngine().setValue(fBaseAddress.add(offset), bytes);
+ fireContentChangeEvent();
+ } catch (RuntimeException e) {
+ IStatus status = new Status(IStatus.ERROR, MemoryViewSamplePlugin.PLUGIN_ID, 0, Messages.SampleMemoryBlock_0, e);
+ DebugException exception = new DebugException(status);
+ throw exception;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
+ */
+ @Override
+ public String getModelIdentifier() {
+ return getDebugTarget().getModelIdentifier();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
+ */
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fDebugTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
+ */
+ @Override
+ public ILaunch getLaunch() {
+ return fDebugTarget.getLaunch();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+
+ if (adapter.equals(IMemoryBlockRetrievalExtension.class)) {
+ return getDebugTarget();
+ }
+
+ if (adapter == IColorProvider.class) {
+ return SampleModelPresentation.getSampleModelPresentation();
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#getExpression()
+ */
+ @Override
+ public String getExpression() {
+ return fExpression;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#dispose()
+ */
+ @Override
+ public void dispose() throws DebugException {
+ // remove this memory block from debug target
+ fDebugTarget.removeMemoryBlock(this);
+ }
+
+ /**
+ * @return is enabled
+ */
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * com.ibm.debug.extended.ui.IMemoryBlockExtension#getMemoryBlockRetrieval()
+ */
+ @Override
+ public IMemoryBlockRetrieval getMemoryBlockRetrieval() {
+ return getDebugTarget();
+ }
+
+ /**
+ *
+ */
+ private void fireContentChangeEvent() {
+ DebugEvent evt = new DebugEvent(this, DebugEvent.CHANGE);
+ fireEvent(evt);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * com.ibm.debug.extended.ui.IMemoryBlockExtension#isMemoryChangesManaged()
+ */
+ @Override
+ public boolean supportsChangeManagement() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getAddressableSize()
+ */
+ @Override
+ public int getAddressableSize() throws DebugException {
+ return fDebugTarget.getEngine().getAddressableSize();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#getAddressSize()
+ */
+ @Override
+ public int getAddressSize() throws DebugException {
+ try {
+ return fDebugTarget.getEngine().getAddressSize();
+ } catch (CoreException e) {
+ throw new DebugException(e.getStatus());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getMemoryBlockStartAddress
+ * ()
+ */
+ @Override
+ public BigInteger getMemoryBlockStartAddress() throws DebugException {
+
+ // if (true)
+ // return fBaseAddress.subtract(BigInteger.valueOf(250));
+ // Return null by default.
+ // Null is acceptable if default start address is to be used.
+ // Default is 0.
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.IMemoryBlockExtension#getMemoryBlockEndAddress
+ * ()
+ */
+ @Override
+ public BigInteger getMemoryBlockEndAddress() throws DebugException {
+
+ // if (true)
+ // return fBaseAddress.add(BigInteger.valueOf(250));
+ // Return null by default.
+ // Null is accpetable if default end address is to be used.
+ // Default end address is calculated based on address size.
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[])
+ */
+ @Override
+ public void setValue(long offset, byte[] bytes) throws DebugException {
+ // do not need to implement for IMemoryBlockExtension
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IMemoryBlockExtension#getBigLength()
+ */
+ @Override
+ public BigInteger getBigLength() throws DebugException {
+ // return -1 by default and default length is calculated
+ return BigInteger.valueOf(-1);
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java
new file mode 100644
index 000000000..9d8a535b8
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IRegister;
+import org.eclipse.debug.core.model.IRegisterGroup;
+
+public class SampleRegister extends SampleVariable implements IRegister {
+
+ private SampleRegisterGroup fGroup;
+
+ SampleRegister(SampleStackFrame frame, SampleRegisterGroup group, String name) {
+ super(frame, name);
+ fGroup = group;
+ }
+
+ @Override
+ public IRegisterGroup getRegisterGroup() throws DebugException {
+ return fGroup;
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegisterGroup.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegisterGroup.java
new file mode 100644
index 000000000..a15421f89
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegisterGroup.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IRegister;
+import org.eclipse.debug.core.model.IRegisterGroup;
+
+public class SampleRegisterGroup extends DebugElement implements IRegisterGroup {
+
+ SampleRegister fRegister1;
+ SampleRegister fRegister2;
+ SampleStackFrame fFrame;
+
+ public SampleRegisterGroup(SampleStackFrame frame) {
+ super(frame.getDebugTarget());
+ fFrame = frame;
+ }
+
+ @Override
+ public String getName() throws DebugException {
+ return Messages.SampleRegisterGroup_0;
+ }
+
+ @Override
+ public IRegister[] getRegisters() throws DebugException {
+ if (fRegister1 == null) {
+ fRegister1 = new SampleRegister(fFrame, this, "eax"); //$NON-NLS-1$
+ }
+
+ if (fRegister2 == null) {
+ fRegister2 = new SampleRegister(fFrame, this, "ebx"); //$NON-NLS-1$
+ }
+
+ return new IRegister[] { fRegister1, fRegister2 };
+ }
+
+ @Override
+ public boolean hasRegisters() throws DebugException {
+ return true;
+ }
+
+ @Override
+ public String getModelIdentifier() {
+ return fFrame.getModelIdentifier();
+ }
+
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fFrame.getDebugTarget();
+ }
+
+ @Override
+ public ILaunch getLaunch() {
+ return fFrame.getLaunch();
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java
new file mode 100644
index 000000000..687e6e4e1
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java
@@ -0,0 +1,186 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IRegisterGroup;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ */
+public class SampleStackFrame extends DebugElement implements IStackFrame {
+
+ private SampleThread fThread;
+ private SampleRegisterGroup fRegisterGroup;
+ private long timeStamp;
+ private String fName;
+
+ /**
+ * Constructs a SampleStackFrame
+ *
+ * @param thread
+ * @param name
+ */
+ public SampleStackFrame(SampleThread thread, String name) {
+ super(thread.getDebugTarget());
+ fThread = thread;
+ fName = name;
+ timeStamp = System.currentTimeMillis();
+ }
+
+ @Override
+ public IThread getThread() {
+ return fThread;
+ }
+
+ @Override
+ public IVariable[] getVariables() throws DebugException {
+
+ return new IVariable[] { new SampleVariable(this, "sampleVariable") }; //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean hasVariables() throws DebugException {
+ return true;
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == ILaunch.class) {
+ return getLaunch();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ @Override
+ public int getLineNumber() throws DebugException {
+ return 0;
+ }
+
+ @Override
+ public int getCharStart() throws DebugException {
+ return 0;
+ }
+
+ @Override
+ public int getCharEnd() throws DebugException {
+ return 0;
+ }
+
+ @Override
+ public String getName() throws DebugException {
+ return NLS.bind(Messages.SampleStackFrame_0, new Object[] {
+ fName, timeStamp });
+ }
+
+ @Override
+ public IRegisterGroup[] getRegisterGroups() throws DebugException {
+ if (fRegisterGroup == null) {
+ fRegisterGroup = new SampleRegisterGroup(this);
+ }
+ return new IRegisterGroup[] { fRegisterGroup };
+ }
+
+ @Override
+ public boolean hasRegisterGroups() throws DebugException {
+ return true;
+ }
+
+ @Override
+ public String getModelIdentifier() {
+ return fThread.getModelIdentifier();
+ }
+
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fThread.getDebugTarget();
+ }
+
+ @Override
+ public ILaunch getLaunch() {
+ return fThread.getDebugTarget().getLaunch();
+ }
+
+ @Override
+ public boolean canStepInto() {
+ return false;
+ }
+
+ @Override
+ public boolean canStepOver() {
+ return fThread.canStepOver();
+ }
+
+ @Override
+ public boolean canStepReturn() {
+ return false;
+ }
+
+ @Override
+ public boolean isStepping() {
+ return false;
+ }
+
+ @Override
+ public void stepInto() throws DebugException {
+
+ }
+
+ @Override
+ public void stepOver() throws DebugException {
+ fThread.stepOver();
+ }
+
+ @Override
+ public void stepReturn() throws DebugException {
+
+ }
+
+ @Override
+ public boolean canResume() {
+ return fThread.canResume();
+ }
+
+ @Override
+ public boolean canSuspend() {
+ return fThread.canSuspend();
+ }
+
+ @Override
+ public boolean isSuspended() {
+ return fThread.isSuspended();
+ }
+
+ @Override
+ public void resume() throws DebugException {
+ fThread.resume();
+
+ }
+
+ @Override
+ public void suspend() throws DebugException {
+ fThread.suspend();
+ }
+
+ @Override
+ public boolean canTerminate() {
+ return fThread.canTerminate();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return fThread.isTerminated();
+ }
+
+ @Override
+ public void terminate() throws DebugException {
+ fThread.terminate();
+
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java
new file mode 100644
index 000000000..a198f4f30
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java
@@ -0,0 +1,273 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+
+/**
+ * Abstract Sample Thread
+ *
+ */
+public class SampleThread extends DebugElement implements IThread {
+
+ private SampleDebugTarget fTarget;
+
+ /**
+ * Constructs SampleThread
+ *
+ * @param target
+ */
+ public SampleThread(SampleDebugTarget target) {
+ super(target);
+ fTarget = target;
+ try {
+ getStackFrames();
+ } catch (DebugException e) {
+ e.printStackTrace();
+ }
+ fireEvent(new DebugEvent(this, DebugEvent.SUSPEND));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#getStackFrames()
+ */
+ @Override
+ public IStackFrame[] getStackFrames() throws DebugException {
+ return ((SampleDebugTarget) getDebugTarget()).getEngine().getStackframes(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#hasStackFrames()
+ */
+ @Override
+ public boolean hasStackFrames() throws DebugException {
+
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#getPriority()
+ */
+ @Override
+ public int getPriority() throws DebugException {
+
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#getTopStackFrame()
+ */
+ @Override
+ public IStackFrame getTopStackFrame() throws DebugException {
+ return ((SampleDebugTarget) getDebugTarget()).getEngine().getStackframes(this)[0];
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#getName()
+ */
+ @Override
+ public String getName() throws DebugException {
+ return Messages.SampleThread_0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IThread#getBreakpoints()
+ */
+ @Override
+ public IBreakpoint[] getBreakpoints() {
+
+ return new IBreakpoint[0];
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
+ */
+ @Override
+ public String getModelIdentifier() {
+ return fTarget.getModelIdentifier();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
+ */
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
+ */
+ @Override
+ public ILaunch getLaunch() {
+ return fTarget.getLaunch();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#canResume()
+ */
+ @Override
+ public boolean canResume() {
+ return fTarget.canResume();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
+ */
+ @Override
+ public boolean canSuspend() {
+ return fTarget.canSuspend();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
+ */
+ @Override
+ public boolean isSuspended() {
+ return fTarget.isSuspended();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#resume()
+ */
+ @Override
+ public void resume() throws DebugException {
+ fTarget.resume();
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
+ */
+ @Override
+ public void suspend() throws DebugException {
+ fTarget.suspend();
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#canStepInto()
+ */
+ @Override
+ public boolean canStepInto() {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#canStepOver()
+ */
+ @Override
+ public boolean canStepOver() {
+ if (!fTarget.isTerminated()) {
+ return true;
+ }
+
+ return fTarget.isSuspended();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#canStepReturn()
+ */
+ @Override
+ public boolean canStepReturn() {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#isStepping()
+ */
+ @Override
+ public boolean isStepping() {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#stepInto()
+ */
+ @Override
+ public void stepInto() throws DebugException {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#stepOver()
+ */
+ @Override
+ public void stepOver() throws DebugException {
+ fTarget.resume();
+ fTarget.suspend();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IStep#stepReturn()
+ */
+ @Override
+ public void stepReturn() throws DebugException {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
+ */
+ @Override
+ public boolean canTerminate() {
+ return fTarget.canTerminate();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
+ */
+ @Override
+ public boolean isTerminated() {
+ return fTarget.isTerminated();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ITerminate#terminate()
+ */
+ @Override
+ public void terminate() throws DebugException {
+ fTarget.terminate();
+
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == ILaunch.class) {
+ return getLaunch();
+ }
+ return super.getAdapter(adapter);
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java
new file mode 100644
index 000000000..07a067dfe
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java
@@ -0,0 +1,59 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IVariable;
+
+public class SampleValue extends DebugElement implements IValue {
+
+ private SampleVariable fVariable;
+
+ public SampleValue(SampleVariable variable) {
+ super(variable.getDebugTarget());
+ fVariable = variable;
+ }
+
+ @Override
+ public String getReferenceTypeName() throws DebugException {
+ return ""; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getValueString() throws DebugException {
+ return String.valueOf(System.currentTimeMillis());
+ }
+
+ @Override
+ public boolean isAllocated() throws DebugException {
+ return false;
+ }
+
+ @Override
+ public IVariable[] getVariables() throws DebugException {
+ return new IVariable[0];
+ }
+
+ @Override
+ public boolean hasVariables() throws DebugException {
+ return false;
+ }
+
+ @Override
+ public String getModelIdentifier() {
+ return fVariable.getModelIdentifier();
+ }
+
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fVariable.getDebugTarget();
+ }
+
+ @Override
+ public ILaunch getLaunch() {
+ return fVariable.getLaunch();
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java
new file mode 100644
index 000000000..a849248d1
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java
@@ -0,0 +1,80 @@
+package org.eclipse.debug.examples.internal.memory.core;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.DebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IVariable;
+
+public class SampleVariable extends DebugElement implements IVariable {
+
+ private final SampleStackFrame fFrame;
+ private String fName;
+
+ SampleVariable(SampleStackFrame frame, String name) {
+ super(frame.getDebugTarget());
+ fFrame = frame;
+ fName = name;
+ }
+
+ @Override
+ public IValue getValue() throws DebugException {
+ return new SampleValue(this);
+ }
+
+ @Override
+ public String getName() throws DebugException {
+ return fName;
+ }
+
+ @Override
+ public String getReferenceTypeName() throws DebugException {
+ return ""; //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean hasValueChanged() throws DebugException {
+ return false;
+ }
+
+ @Override
+ public String getModelIdentifier() {
+ return fFrame.getModelIdentifier();
+ }
+
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return fFrame.getDebugTarget();
+ }
+
+ @Override
+ public ILaunch getLaunch() {
+ return fFrame.getLaunch();
+ }
+
+ @Override
+ public void setValue(IValue value) throws DebugException {
+
+ }
+
+ @Override
+ public boolean supportsValueModification() {
+ return false;
+ }
+
+ @Override
+ public boolean verifyValue(IValue value) throws DebugException {
+ return false;
+ }
+
+ @Override
+ public void setValue(String expression) throws DebugException {
+
+ }
+
+ @Override
+ public boolean verifyValue(String expression) throws DebugException {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/messages.properties b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/messages.properties
new file mode 100644
index 000000000..f3363cbf1
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/messages.properties
@@ -0,0 +1,6 @@
+SampleDebugTarget_0=[Debug Target:] Memory View Example Program
+SampleDebugTarget_1=Expression cannot be evaluated to an address
+SampleMemoryBlock_0=Failed to edit.
+SampleRegisterGroup_0=Register Group
+SampleStackFrame_0=[Stackframe:] {0} {1}
+SampleThread_0=[Thread:] Thread \#1
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleEngine.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleEngine.java
new file mode 100644
index 000000000..c82fc8a66
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleEngine.java
@@ -0,0 +1,367 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.examples.internal.memory.engine;
+
+import java.math.BigInteger;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Random;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.examples.internal.memory.core.SampleDebugTarget;
+import org.eclipse.debug.examples.internal.memory.core.SampleMemoryBlock;
+import org.eclipse.debug.examples.internal.memory.core.SampleStackFrame;
+import org.eclipse.debug.examples.internal.memory.core.SampleThread;
+
+/**
+ * Sample engine for sample deug adapter This engine randomly generates content
+ * for a memory block. To get to this engine, call
+ * {@link SampleDebugTarget#getEngine()};
+ */
+public class SampleEngine {
+
+ Random fRandom = new Random();
+ byte[] fMemory;
+ Hashtable<BigInteger, SampleMemoryUnit> memoryBlockTable;
+ Hashtable<String, BigInteger> expressionAddressTable = new Hashtable<String, BigInteger>();
+ Hashtable<SampleDebugTarget, Object> threadTable = new Hashtable<SampleDebugTarget, Object>();
+ Hashtable<SampleThread, Object> stackframeTable = new Hashtable<SampleThread, Object>();
+
+ Random random = new Random();
+
+ /**
+ * Allow debug adapters to get memory from an address
+ *
+ * @param address
+ * @param length
+ * @return memory byte from an address
+ * @throws RuntimeException
+ */
+ synchronized public MemoryByte[] getBytesFromAddress(BigInteger address, long length) throws RuntimeException {
+
+ if (memoryBlockTable == null) {
+ // create new memoryBlock table
+ memoryBlockTable = new Hashtable<BigInteger, SampleMemoryUnit>();
+ byte[] bytes = new byte[(int) length * getAddressableSize()];
+ BigInteger addressKey = address;
+
+ random.nextBytes(bytes);
+
+ for (int i = 0; i < bytes.length; i = i + getAddressableSize()) {
+ addressKey = addressKey.add(BigInteger.valueOf(1));
+
+ MemoryByte[] byteUnit = new MemoryByte[getAddressableSize()];
+ for (int j = 0; j < getAddressableSize(); j++) {
+ MemoryByte oneByte = new MemoryByte(bytes[i + j]);
+ oneByte.setBigEndian(isBigEndian(addressKey));
+ oneByte.setWritable(isWritable(addressKey));
+ oneByte.setReadable(isReadable(addressKey));
+ byteUnit[j] = oneByte;
+ }
+ SampleMemoryUnit unit = new SampleMemoryUnit(byteUnit);
+ memoryBlockTable.put(addressKey, unit);
+ }
+ }
+
+ MemoryByte[] returnBytes = new MemoryByte[(int) length * getAddressableSize()];
+ BigInteger addressKey;
+
+ for (int i = 0; i < returnBytes.length; i = i + getAddressableSize()) {
+ addressKey = address.add(BigInteger.valueOf(i / getAddressableSize()));
+ SampleMemoryUnit temp = (memoryBlockTable.get(addressKey));
+
+ // if memoryBlock does not already exist in the table, generate a
+ // value
+ if (temp == null) {
+ byte[] x = new byte[getAddressableSize()];
+ random.nextBytes(x);
+ byte flag = 0;
+ flag |= MemoryByte.READABLE;
+ flag |= MemoryByte.ENDIANESS_KNOWN;
+ flag |= MemoryByte.WRITABLE;
+
+ MemoryByte[] byteUnit = new MemoryByte[getAddressableSize()];
+ for (int j = 0; j < getAddressableSize(); j++) {
+ MemoryByte oneByte = new MemoryByte(x[j], flag);
+ byteUnit[j] = oneByte;
+ byteUnit[j].setBigEndian(isBigEndian(addressKey));
+ byteUnit[j].setWritable(isWritable(addressKey));
+ byteUnit[j].setReadable(isReadable(addressKey));
+ returnBytes[i + j] = oneByte;
+ }
+ SampleMemoryUnit unit = new SampleMemoryUnit(byteUnit);
+ memoryBlockTable.put(addressKey, unit);
+
+ } else {
+ MemoryByte[] bytes = temp.getBytes();
+
+ for (int j = 0; j < bytes.length; j++) {
+ MemoryByte oneByte = new MemoryByte(bytes[j].getValue(), bytes[j].getFlags());
+ returnBytes[i + j] = oneByte;
+ returnBytes[i + j].setBigEndian(isBigEndian(addressKey));
+ returnBytes[i + j].setWritable(isWritable(addressKey));
+ }
+ }
+ }
+
+ return returnBytes;
+ }
+
+ /**
+ * Run the debuggee
+ */
+ public void resume() {
+ changeValue();
+ }
+
+ /**
+ * Convenience function to cause changes in a memoryBlock block. Changes
+ * could result from running the program, changing a variable, etc.
+ */
+ synchronized public void changeValue() {
+ if (memoryBlockTable == null) {
+ return;
+ }
+
+ Enumeration<BigInteger> enumeration = memoryBlockTable.keys();
+ long randomChange = random.nextInt(37);
+
+ while (randomChange <= 5) {
+ randomChange = random.nextInt(37);
+ }
+
+ while (enumeration.hasMoreElements()) {
+ BigInteger key = enumeration.nextElement();
+ if (key.remainder(BigInteger.valueOf(randomChange)).equals(BigInteger.valueOf(0))) {
+ byte[] x = new byte[getAddressableSize()];
+ random.nextBytes(x);
+
+ MemoryByte unitBytes[] = new MemoryByte[getAddressableSize()];
+ for (int i = 0; i < x.length; i++) {
+ MemoryByte oneByte = new MemoryByte();
+ oneByte.setValue(x[i]);
+ oneByte.setReadable(true);
+ oneByte.setChanged(true);
+ oneByte.setHistoryKnown(true);
+ oneByte.setBigEndian(isBigEndian(key));
+ oneByte.setWritable(isWritable(key));
+ oneByte.setReadable(isReadable(key));
+ unitBytes[i] = oneByte;
+ }
+
+ SampleMemoryUnit unit = new SampleMemoryUnit(unitBytes);
+
+ memoryBlockTable.put(key, unit);
+ } else {
+ SampleMemoryUnit unit = memoryBlockTable.get(key);
+
+ MemoryByte[] bytes = unit.getBytes();
+
+ for (int i = 0; i < bytes.length; i++) {
+ bytes[i].setChanged(false);
+ bytes[i].setHistoryKnown(true);
+ }
+
+ unit.setBytes(bytes);
+
+ memoryBlockTable.put(key, unit);
+ }
+ }
+ }
+
+ /**
+ * Simulates evaluation of an expression. Given an expression, return ad
+ * address
+ *
+ * @param expression
+ * @param evalContext
+ * @return the address the expression is evaluated to
+ */
+ public BigInteger evaluateExpression(String expression, Object evalContext) {
+ BigInteger expAddress = expressionAddressTable.get(expression);
+ if (expAddress == null) {
+ int address = random.nextInt();
+
+ // make sure number is positive
+ if (address < 0) {
+ address = address * -1;
+ }
+
+ expAddress = BigInteger.valueOf(address);
+ expressionAddressTable.put(expression, expAddress);
+ }
+ return expAddress;
+ }
+
+ /**
+ * Simulates checking if storage retrieval is supported
+ *
+ * @return if the engine supports storage retrieval
+ */
+ public boolean supportsStorageRetrieval() {
+ return true;
+ }
+
+ /**
+ * Simulates modifying memory using BigInteger as the address
+ *
+ * @param address
+ * @param bytes
+ * @throws RuntimeException
+ */
+ public void setValue(BigInteger address, byte[] bytes) throws RuntimeException {
+ BigInteger convertedAddress = address;
+
+ for (int i = 0; i < bytes.length; i = i + getAddressableSize()) {
+ SampleMemoryUnit unit = memoryBlockTable.get(convertedAddress);
+
+ MemoryByte[] unitBytes = unit.getBytes();
+ for (int j = 0; j < unitBytes.length; j++) {
+ unitBytes[j].setValue(bytes[i + j]);
+ unitBytes[j].setChanged(true);
+ unitBytes[j].setHistoryKnown(true);
+ }
+ convertedAddress = convertedAddress.add(BigInteger.valueOf(1));
+ }
+ }
+
+ /**
+ * @return addrssablesize of the debuggee
+ */
+ public int getAddressableSize() {
+ return 1;
+ }
+
+ /**
+ * @param address
+ * @return true if the debuggee is big endian, false otherwise
+ */
+ public boolean isBigEndian(BigInteger address) {
+ // simulate mixed endianess in a memory block
+ // memory before the boundary address is little endian
+ // memory after the boundaress is big endian
+ BigInteger boundary = new BigInteger("12345678", 16); //$NON-NLS-1$
+ if (address.compareTo(boundary) > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @param address
+ * @return true if the address is writable, false otherwise Read only
+ * segment: 0xab123456 to 0xab123556
+ */
+ public boolean isWritable(BigInteger address) {
+ BigInteger boundary = new BigInteger("ab123456", 16); //$NON-NLS-1$
+ BigInteger boundaryEnd = new BigInteger("ab123556", 16); //$NON-NLS-1$
+ if (address.compareTo(boundary) > 0 && address.compareTo(boundaryEnd) < 0) {
+ return false;
+ }
+
+ boundary = new BigInteger("cd123456", 16); //$NON-NLS-1$
+ boundaryEnd = new BigInteger("cd123576", 16); //$NON-NLS-1$
+ if (address.compareTo(boundary) > 0 && address.compareTo(boundaryEnd) < 0) {
+ return false;
+ }
+
+ return true;
+
+ }
+
+ /**
+ * @param address
+ * @return
+ */
+ public boolean isReadable(BigInteger address) {
+ BigInteger boundary = new BigInteger("cd123456", 16); //$NON-NLS-1$
+ BigInteger boundaryEnd = new BigInteger("cd123576", 16); //$NON-NLS-1$
+ if (address.compareTo(boundary) > 0 && address.compareTo(boundaryEnd) < 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param target
+ * @return
+ */
+ public SampleThread[] getThreads(SampleDebugTarget target) {
+ Object thread = threadTable.get(target);
+ if (thread == null) {
+ thread = new SampleThread(target);
+ threadTable.put(target, thread);
+ }
+ return new SampleThread[] { (SampleThread) thread };
+ }
+
+ /**
+ * @param thread
+ * @return
+ */
+ public SampleStackFrame[] getStackframes(SampleThread thread) {
+ Object stackframes = stackframeTable.get(thread);
+ if (stackframes == null) {
+ stackframes = createStackframes(thread);
+ stackframeTable.put(thread, stackframes);
+ }
+ return (SampleStackFrame[]) stackframes;
+ }
+
+ /**
+ *
+ */
+ private SampleStackFrame[] createStackframes(SampleThread thread) {
+ SampleStackFrame[] stackframes = new SampleStackFrame[2];
+ stackframes[0] = new SampleStackFrame(thread, "Frame1"); //$NON-NLS-1$
+ stackframes[1] = new SampleStackFrame(thread, "Frame2"); //$NON-NLS-1$
+ return stackframes;
+ }
+
+ /**
+ * @param mb
+ * @return true if memory block is to support base address modification,
+ * false otherwise
+ */
+ public boolean suppostsBaseAddressModification(SampleMemoryBlock mb) {
+ return false;
+ }
+
+ /**
+ * Sets the base address of this memory block
+ *
+ * @param mb the memory block to change base address
+ * @param address the new base address of the memory block
+ * @throws CoreException
+ */
+ public void setBaseAddress(SampleMemoryBlock mb, BigInteger address) throws CoreException {
+ }
+
+ /**
+ * @param mb
+ * @return true if this memory block supports value modification, false
+ * otherwise
+ * @throws CoreException
+ */
+ public boolean supportsValueModification(SampleMemoryBlock mb) {
+ return true;
+ }
+
+ /**
+ * @return address size of the debuggee
+ * @throws CoreException
+ */
+ public int getAddressSize() throws CoreException {
+ return 4;
+ }
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleMemoryUnit.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleMemoryUnit.java
new file mode 100644
index 000000000..bf2ebb89e
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/engine/SampleMemoryUnit.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.examples.internal.memory.engine;
+
+import org.eclipse.debug.core.model.MemoryByte;
+
+/**
+ * For testing addressable size > 1. Group each addressable unit in a MemoryByte
+ * array.
+ *
+ */
+public class SampleMemoryUnit {
+
+ MemoryByte[] fBytes;
+
+ public SampleMemoryUnit(MemoryByte[] bytes) {
+ fBytes = bytes;
+ }
+
+ public MemoryByte[] getBytes() {
+ return fBytes;
+ }
+
+ public void setBytes(MemoryByte[] bytes) {
+ fBytes = bytes;
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchConfigurationDelegateEx.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchConfigurationDelegateEx.java
new file mode 100644
index 000000000..475792f93
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchConfigurationDelegateEx.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.examples.internal.memory.launchconfig;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
+import org.eclipse.debug.examples.internal.memory.core.SampleDebugTarget;
+
+/**
+ * Sample Launch configuraiton delegate For creating the debug target that
+ * supports IMemoryBlockExtension
+ * */
+public class SampleLaunchConfigurationDelegateEx extends LaunchConfigurationDelegate {
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.
+ * eclipse.debug.core.ILaunchConfiguration, java.lang.String,
+ * org.eclipse.debug.core.ILaunch,
+ * org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ IDebugTarget target = new SampleDebugTarget(launch);
+ launch.addDebugTarget(target);
+
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchTabGroup.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchTabGroup.java
new file mode 100644
index 000000000..fc88ed59c
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleLaunchTabGroup.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.examples.internal.memory.launchconfig;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+
+/**
+ * Sample launch tab group
+ */
+public class SampleLaunchTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse
+ * .debug.ui.ILaunchConfigurationDialog, java.lang.String)
+ */
+ @Override
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[1];
+ tabs[0] = new CommonTab();
+ setTabs(tabs);
+ }
+
+}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleModelPresentation.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleModelPresentation.java
new file mode 100644
index 000000000..ed87642cd
--- /dev/null
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/launchconfig/SampleModelPresentation.java
@@ -0,0 +1,168 @@
+package org.eclipse.debug.examples.internal.memory.launchconfig;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.examples.internal.memory.MemoryViewSamplePlugin;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.debug.ui.memory.MemoryRenderingElement;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.progress.UIJob;
+
+/**
+ * Model presentation for sample debug adapter
+ */
+
+public class SampleModelPresentation implements IDebugModelPresentation, IColorProvider {
+
+ private static SampleModelPresentation fPresentation;
+ private static Color blue;
+
+ public static SampleModelPresentation getSampleModelPresentation() {
+ if (fPresentation == null) {
+ fPresentation = new SampleModelPresentation();
+
+ UIJob job = new UIJob("get colors") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ Display display = MemoryViewSamplePlugin.getDefault().getWorkbench().getDisplay();
+ blue = display.getSystemColor(SWT.COLOR_BLUE);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+
+ return fPresentation;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.
+ * jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(org.eclipse
+ * .debug.core.model.IValue, org.eclipse.debug.ui.IValueDetailListener)
+ */
+ @Override
+ public void computeDetail(IValue value, IValueDetailListener listener) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+
+ }
+
+ @Override
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.
+ * IEditorInput, java.lang.Object)
+ */
+ @Override
+ public String getEditorId(IEditorInput input, Object element) {
+
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object)
+ */
+ @Override
+ public IEditorInput getEditorInput(Object element) {
+
+ return null;
+ }
+
+ @Override
+ public Color getForeground(Object element) {
+
+ if (element instanceof MemoryRenderingElement) {
+ MemoryRenderingElement elm = (MemoryRenderingElement) element;
+ MemoryByte[] bytes = elm.getBytes();
+ if (!bytes[0].isWritable()) {
+ return blue;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang
+ * .Object, java.lang.String)
+ */
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse
+ * .jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String
+ * , java.lang.Object)
+ */
+ @Override
+ public void setAttribute(String attribute, Object value) {
+ }
+}

Back to the top