Author: martin
Date: 2006-10-20 13:22:02 -0400 (Fri, 20 Oct 2006)
New Revision: 66837
Added:
trunk/debugger/api/
trunk/debugger/api/IBacktrace.cs
trunk/debugger/api/IDebugger.cs
trunk/debugger/api/IMethod.cs
trunk/debugger/api/IMethodSource.cs
trunk/debugger/api/IProcess.cs
trunk/debugger/api/IProcessStart.cs
trunk/debugger/api/ISourceFile.cs
trunk/debugger/api/IStackFrame.cs
trunk/debugger/api/ISymbolLookup.cs
trunk/debugger/api/ITargetArrayObject.cs
trunk/debugger/api/ITargetArrayType.cs
trunk/debugger/api/ITargetClassObject.cs
trunk/debugger/api/ITargetClassType.cs
trunk/debugger/api/ITargetEnumObject.cs
trunk/debugger/api/ITargetEnumType.cs
trunk/debugger/api/ITargetEvent.cs
trunk/debugger/api/ITargetFunctionType.cs
trunk/debugger/api/ITargetFundamentalObject.cs
trunk/debugger/api/ITargetFundamentalType.cs
trunk/debugger/api/ITargetMember.cs
trunk/debugger/api/ITargetMemoryAccess.cs
trunk/debugger/api/ITargetNotification.cs
trunk/debugger/api/ITargetObject.cs
trunk/debugger/api/ITargetObjectObject.cs
trunk/debugger/api/ITargetObjectType.cs
trunk/debugger/api/ITargetPointerObject.cs
trunk/debugger/api/ITargetPointerType.cs
trunk/debugger/api/ITargetType.cs
trunk/debugger/api/ITargetVariable.cs
trunk/debugger/api/IThread.cs
trunk/debugger/api/TargetAddress.cs
trunk/debugger/api/TargetObjectKind.cs
Log:
Debugger API.
Added: trunk/debugger/api/IBacktrace.cs
===================================================================
--- trunk/debugger/api/IBacktrace.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IBacktrace.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,24 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IBacktrace
+ {
+ int Count {
+ get;
+ }
+
+ int CurrentFrameIndex {
+ get;
+ set;
+ }
+
+ IStackFrame[] Frames {
+ get;
+ }
+
+ IStackFrame CurrentFrame {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/IDebugger.cs
===================================================================
--- trunk/debugger/api/IDebugger.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IDebugger.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,27 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public delegate void DebuggerEventHandler (IDebugger debugger);
+ public delegate void ThreadEventHandler (IDebugger debugger, IThread
thread);
+ public delegate void ProcessEventHandler (IDebugger debugger, IProcess
process);
+
+ public interface IDebugger
+ {
+ event ProcessEventHandler ProcessCreatedEvent;
+ event ProcessEventHandler ProcessExitedEvent;
+ event ProcessEventHandler ProcessExecdEvent;
+
+ void Kill ();
+
+ void Detach ();
+
+ IProcess Run (IProcessStart start);
+
+ IProcess Attach (IProcessStart start, int pid);
+
+ IProcess[] Processes {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/IMethod.cs
===================================================================
--- trunk/debugger/api/IMethod.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IMethod.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,73 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IMethod : ISymbolLookup, IComparable
+ {
+ string Name {
+ get;
+ }
+
+ string ImageFile {
+ get;
+ }
+
+ bool IsWrapper {
+ get;
+ }
+
+ bool IsLoaded {
+ get;
+ }
+
+ bool HasMethodBounds {
+ get;
+ }
+
+ TargetAddress StartAddress {
+ get;
+ }
+
+ TargetAddress EndAddress {
+ get;
+ }
+
+ TargetAddress MethodStartAddress {
+ get;
+ }
+
+ TargetAddress MethodEndAddress {
+ get;
+ }
+
+ bool HasSource {
+ get;
+ }
+
+ IMethodSource Source {
+ get;
+ }
+
+ ITargetClassType DeclaringType {
+ get;
+ }
+
+ bool HasThis {
+ get;
+ }
+
+ ITargetVariable This {
+ get;
+ }
+
+ ITargetVariable[] Parameters {
+ get;
+ }
+
+ ITargetVariable[] Locals {
+ get;
+ }
+
+ ITargetVariable GetVariableByName (TargetAddress address,
string name);
+ }
+}
Added: trunk/debugger/api/IMethodSource.cs
===================================================================
--- trunk/debugger/api/IMethodSource.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IMethodSource.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,31 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IMethodSource
+ {
+ string Name {
+ get;
+ }
+
+ bool IsDynamic {
+ get;
+ }
+
+ ISourceBuffer SourceBuffer {
+ get;
+ }
+
+ ISourceFile SourceFile {
+ get;
+ }
+
+ int StartRow {
+ get;
+ }
+
+ int EndRow {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/IProcess.cs
===================================================================
--- trunk/debugger/api/IProcess.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IProcess.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,41 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IProcess
+ {
+ event TargetOutputHandler TargetOutputEvent;
+ event ThreadEventHandler ThreadCreatedEvent;
+ event ThreadEventHandler ThreadExitedEvent;
+ event DebuggerEventHandler TargetExitedEvent;
+ event TargetEventHandler TargetEvent;
+
+ int ID {
+ get;
+ }
+
+ IDebugger Debugger {
+ get;
+ }
+
+ IThread MainThread {
+ get;
+ }
+
+ bool IsManaged {
+ get;
+ }
+
+ IProcessStart ProcessStart {
+ get;
+ }
+
+ void Kill ();
+
+ void Detach ();
+
+ IThread[] Threads {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/IProcessStart.cs
===================================================================
--- trunk/debugger/api/IProcessStart.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IProcessStart.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,23 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IProcessStart
+ {
+ string[] CommandLineArguments {
+ get;
+ }
+
+ string[] Environment {
+ get;
+ }
+
+ string TargetApplication {
+ get;
+ }
+
+ string WorkingDirectory {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ISourceFile.cs
===================================================================
--- trunk/debugger/api/ISourceFile.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ISourceFile.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,26 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ISourceBuffer
+ {
+ string Name {
+ get;
+ }
+
+ string[] Contents {
+ get;
+ }
+ }
+
+ public interface ISourceFile
+ {
+ string Name {
+ get;
+ }
+
+ string FileName {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/IStackFrame.cs
===================================================================
--- trunk/debugger/api/IStackFrame.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IStackFrame.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,73 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IRegister
+ {
+ string Name {
+ get;
+ }
+
+ int Index {
+ get;
+ }
+
+ bool IsValid {
+ get;
+ }
+
+ long Value {
+ get; set;
+ }
+ }
+
+ public interface IRegisters : ICollection
+ {
+ IRegister this [int index] {
+ get;
+ }
+
+ IRegister this [string name] {
+ get;
+ }
+
+ bool FromCurrentFrame {
+ get;
+ }
+ }
+
+ public interface IStackFrame
+ {
+ int Level {
+ get;
+ }
+
+ TargetAddress TargetAddress {
+ get;
+ }
+
+ TargetAddress StackPointer {
+ get;
+ }
+
+ TargetAddress FrameAddress {
+ get;
+ }
+
+ IThread Thread {
+ get;
+ }
+
+ IRegisters Registers {
+ get;
+ }
+
+ IMethod Method {
+ get;
+ }
+
+ ITargetObject ExceptionObject {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ISymbolLookup.cs
===================================================================
--- trunk/debugger/api/ISymbolLookup.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ISymbolLookup.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,9 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ISymbolLookup
+ {
+ IMethod Lookup (TargetAddress address);
+ }
+}
Added: trunk/debugger/api/ITargetArrayObject.cs
===================================================================
--- trunk/debugger/api/ITargetArrayObject.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetArrayObject.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,20 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetArrayObject : ITargetObject
+ {
+ new ITargetArrayType Type {
+ get;
+ }
+
+ int GetLowerBound (IThread target, int dimension);
+
+ int GetUpperBound (IThread target, int dimension);
+
+ ITargetObject GetElement (IThread target, int[] indices);
+
+ void SetElement (IThread target, int[] indices, ITargetObject
obj);
+ }
+}
+
Added: trunk/debugger/api/ITargetArrayType.cs
===================================================================
--- trunk/debugger/api/ITargetArrayType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetArrayType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,15 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetArrayType : ITargetType
+ {
+ int Rank {
+ get;
+ }
+
+ ITargetType ElementType {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetClassObject.cs
===================================================================
--- trunk/debugger/api/ITargetClassObject.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetClassObject.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,17 @@
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetClassObject : ITargetObject
+ {
+ new ITargetClassType Type {
+ get;
+ }
+
+ ITargetClassObject GetParentObject (IThread target);
+
+ ITargetClassObject GetCurrentObject (IThread target);
+
+ ITargetObject GetField (IThread target, ITargetFieldInfo field);
+
+ void SetField (IThread target, ITargetFieldInfo field,
ITargetObject obj);
+ }
+}
Added: trunk/debugger/api/ITargetClassType.cs
===================================================================
--- trunk/debugger/api/ITargetClassType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetClassType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,61 @@
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetClassType : ITargetType
+ {
+ bool HasParent {
+ get;
+ }
+
+ ITargetClassType ParentType {
+ get;
+ }
+
+ ITargetFieldInfo[] Fields {
+ get;
+ }
+
+ ITargetFieldInfo[] StaticFields {
+ get;
+ }
+
+ ITargetObject GetStaticField (IThread target, ITargetFieldInfo
field);
+
+ void SetStaticField (IThread target, ITargetFieldInfo field,
+ ITargetObject obj);
+
+ ITargetPropertyInfo[] Properties {
+ get;
+ }
+
+ ITargetPropertyInfo[] StaticProperties {
+ get;
+ }
+
+ ITargetEventInfo[] Events {
+ get;
+ }
+
+ ITargetEventInfo[] StaticEvents {
+ get;
+ }
+
+ ITargetMethodInfo[] Methods {
+ get;
+ }
+
+ ITargetMethodInfo[] StaticMethods {
+ get;
+ }
+
+ ITargetMethodInfo[] Constructors {
+ get;
+ }
+
+ ITargetMethodInfo[] StaticConstructors {
+ get;
+ }
+
+ ITargetMemberInfo FindMember (string name, bool search_static,
+ bool search_instance);
+ }
+}
Added: trunk/debugger/api/ITargetEnumObject.cs
===================================================================
--- trunk/debugger/api/ITargetEnumObject.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetEnumObject.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,15 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetEnumObject : ITargetObject
+ {
+ new ITargetEnumType Type {
+ get;
+ }
+
+ ITargetObject Value {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetEnumType.cs
===================================================================
--- trunk/debugger/api/ITargetEnumType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetEnumType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,19 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetEnumType : ITargetType
+ {
+ bool IsFlagsEnum {
+ get;
+ }
+
+ ITargetFieldInfo Value {
+ get;
+ }
+
+ ITargetFieldInfo[] Members {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetEvent.cs
===================================================================
--- trunk/debugger/api/ITargetEvent.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ITargetEvent.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,33 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public delegate void TargetEventHandler (IThread thread,
ITargetEventArgs args);
+
+ [Serializable]
+ public enum TargetEventType
+ {
+ TargetRunning,
+ TargetStopped,
+ TargetHitBreakpoint,
+ TargetSignaled,
+ TargetExited,
+ Exception,
+ UnhandledException
+ }
+
+ public interface ITargetEventArgs
+ {
+ TargetEventType Type {
+ get;
+ }
+
+ object Data {
+ get;
+ }
+
+ IStackFrame Frame {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetFunctionType.cs
===================================================================
--- trunk/debugger/api/ITargetFunctionType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetFunctionType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,43 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetFunctionType : ITargetType
+ {
+ string FullName {
+ get;
+ }
+
+ bool IsStatic {
+ get;
+ }
+
+ bool IsConstructor {
+ get;
+ }
+
+ bool HasReturnValue {
+ get;
+ }
+
+ ITargetType ReturnType {
+ get;
+ }
+
+ ITargetType[] ParameterTypes {
+ get;
+ }
+
+ IMethodSource Source {
+ get;
+ }
+
+ ITargetClassType DeclaringType {
+ get;
+ }
+
+ bool IsLoaded {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetFundamentalObject.cs
===================================================================
--- trunk/debugger/api/ITargetFundamentalObject.cs 2006-10-20 17:06:34 UTC
(rev 66836)
+++ trunk/debugger/api/ITargetFundamentalObject.cs 2006-10-20 17:22:02 UTC
(rev 66837)
@@ -0,0 +1,15 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetFundamentalObject : ITargetObject
+ {
+ new ITargetFundamentalType Type {
+ get;
+ }
+
+ object GetObject (IThread target);
+
+ void SetObject (IThread target, object obj);
+ }
+}
Added: trunk/debugger/api/ITargetFundamentalType.cs
===================================================================
--- trunk/debugger/api/ITargetFundamentalType.cs 2006-10-20 17:06:34 UTC
(rev 66836)
+++ trunk/debugger/api/ITargetFundamentalType.cs 2006-10-20 17:22:02 UTC
(rev 66837)
@@ -0,0 +1,32 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public enum FundamentalKind
+ {
+ Unknown,
+ Object,
+ Boolean,
+ Char,
+ SByte,
+ Byte,
+ Int16,
+ UInt16,
+ Int32,
+ UInt32,
+ Int64,
+ UInt64,
+ Single,
+ Double,
+ String,
+ IntPtr,
+ UIntPtr
+ }
+
+ public interface ITargetFundamentalType : ITargetType
+ {
+ FundamentalKind FundamentalKind {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetMember.cs
===================================================================
--- trunk/debugger/api/ITargetMember.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ITargetMember.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,79 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetMemberInfo
+ {
+ ITargetType Type {
+ get;
+ }
+
+ string Name {
+ get;
+ }
+
+ int Index {
+ get;
+ }
+
+ bool IsStatic {
+ get;
+ }
+ }
+
+ public interface ITargetFieldInfo : ITargetMemberInfo
+ {
+ bool HasConstValue {
+ get;
+ }
+
+ object ConstValue {
+ get;
+ }
+ }
+
+ public interface ITargetPropertyInfo : ITargetMemberInfo
+ {
+ bool CanRead {
+ get;
+ }
+
+ bool CanWrite {
+ get;
+ }
+
+ ITargetFunctionType Getter {
+ get;
+ }
+
+ ITargetFunctionType Setter {
+ get;
+ }
+ }
+
+ public interface ITargetEventInfo : ITargetMemberInfo
+ {
+ ITargetFunctionType Add {
+ get;
+ }
+
+ ITargetFunctionType Remove {
+ get;
+ }
+
+ ITargetFunctionType Raise {
+ get;
+ }
+ }
+
+ public interface ITargetMethodInfo : ITargetMemberInfo
+ {
+ string FullName {
+ get;
+ }
+
+ new ITargetFunctionType Type {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetMemoryAccess.cs
===================================================================
--- trunk/debugger/api/ITargetMemoryAccess.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetMemoryAccess.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,21 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetMemoryAccess
+ {
+ byte ReadByte (TargetAddress address);
+
+ int ReadInteger (TargetAddress address);
+
+ long ReadLongInteger (TargetAddress address);
+
+ TargetAddress ReadAddress (TargetAddress address);
+
+ string ReadString (TargetAddress address);
+
+ byte[] ReadBuffer (TargetAddress address, int size);
+
+ IRegisters GetRegisters ();
+ }
+}
Added: trunk/debugger/api/ITargetNotification.cs
===================================================================
--- trunk/debugger/api/ITargetNotification.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetNotification.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,68 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public delegate void TargetOutputHandler (bool is_stderr, string
output);
+ public delegate void DebuggerOutputHandler (string output);
+ public delegate void DebuggerErrorHandler (object sender, string
message, Exception e);
+ public delegate void StateChangedHandler (TargetState new_state, int
arg);
+
+ /// <summary>
+ /// State of the target (the application we're debugging).
+ /// </summary>
+ public enum TargetState
+ {
+ // <summary>
+ // There is no target to debug.
+ // </summary>
+ NoTarget,
+
+ // <summary>
+ // The debugger is busy doing some things.
+ // </summary>
+ Busy,
+
+ // <summary>
+ // The target is running.
+ // </summary>
+ Running,
+
+ // <summary>
+ // The target is stopped.
+ // </summary>
+ Stopped,
+
+ // <summary>
+ // The target has exited.
+ // </summary>
+ Exited,
+
+ // <summary>
+ // Undebuggable daemon thread.
+ // </summary>
+ Daemon,
+
+ // <summary>
+ // This is a core file.
+ // </summary>
+ CoreFile,
+
+ LAST
+ }
+
+ public interface ITargetNotification
+ {
+ // <summary>
+ // Get the state of the target we're debugging.
+ // </summary>
+ TargetState State {
+ get;
+ }
+
+ // <summary>
+ // This event is emitted when the state of the target we're
currently debugging
+ // has changed, for instance when the target has stopped or
exited.
+ // </summary>
+ event StateChangedHandler StateChanged;
+ }
+}
Added: trunk/debugger/api/ITargetObject.cs
===================================================================
--- trunk/debugger/api/ITargetObject.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ITargetObject.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,25 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetObject
+ {
+ ITargetType Type {
+ get;
+ }
+
+ bool IsNull {
+ get;
+ }
+
+ bool HasAddress {
+ get;
+ }
+
+ TargetAddress Address {
+ get;
+ }
+
+ string Print (IThread target);
+ }
+}
Added: trunk/debugger/api/ITargetObjectObject.cs
===================================================================
--- trunk/debugger/api/ITargetObjectObject.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetObjectObject.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,13 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetObjectObject : ITargetPointerObject
+ {
+ new ITargetObjectType Type {
+ get;
+ }
+
+ ITargetClassObject GetClassObject (IThread target);
+ }
+}
Added: trunk/debugger/api/ITargetObjectType.cs
===================================================================
--- trunk/debugger/api/ITargetObjectType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetObjectType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,11 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetObjectType : ITargetPointerType
+ {
+ ITargetClassType ClassType {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetPointerObject.cs
===================================================================
--- trunk/debugger/api/ITargetPointerObject.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetPointerObject.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,15 @@
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetPointerObject : ITargetObject
+ {
+ new ITargetPointerType Type {
+ get;
+ }
+
+ ITargetType GetCurrentType (IThread target);
+
+ ITargetObject GetDereferencedObject (IThread target);
+
+ ITargetObject GetArrayElement (IThread target, int index);
+ }
+}
Added: trunk/debugger/api/ITargetPointerType.cs
===================================================================
--- trunk/debugger/api/ITargetPointerType.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetPointerType.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,23 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetPointerType : ITargetType
+ {
+ bool IsArray {
+ get;
+ }
+
+ bool IsTypesafe {
+ get;
+ }
+
+ bool HasStaticType {
+ get;
+ }
+
+ ITargetType StaticType {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetType.cs
===================================================================
--- trunk/debugger/api/ITargetType.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/ITargetType.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,15 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetType
+ {
+ TargetObjectKind Kind {
+ get;
+ }
+
+ string Name {
+ get;
+ }
+ }
+}
Added: trunk/debugger/api/ITargetVariable.cs
===================================================================
--- trunk/debugger/api/ITargetVariable.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/ITargetVariable.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,25 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface ITargetVariable
+ {
+ string Name {
+ get;
+ }
+
+ ITargetType Type {
+ get;
+ }
+
+ bool IsInScope (TargetAddress address);
+
+ ITargetObject GetObject (IStackFrame frame);
+
+ bool CanWrite {
+ get;
+ }
+
+ void SetObject (IStackFrame frame, ITargetObject obj);
+ }
+}
Added: trunk/debugger/api/IThread.cs
===================================================================
--- trunk/debugger/api/IThread.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/IThread.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,109 @@
+using System;
+using System.Threading;
+
+namespace Mono.Debugger.Interface
+{
+ [Serializable]
+ public delegate object TargetAccessDelegate (IThread target, object
user_data);
+
+ public interface IThread
+ {
+ WaitHandle WaitHandle {
+ get;
+ }
+
+ TargetState State {
+ get;
+ }
+
+ int ID {
+ get;
+ }
+
+ string Name {
+ get;
+ }
+
+ long TID {
+ get;
+ }
+
+ IProcess Process {
+ get;
+ }
+
+ bool IsSystemThread {
+ get;
+ }
+
+ IStackFrame CurrentFrame {
+ get;
+ }
+
+ TargetAddress CurrentFrameAddress {
+ get;
+ }
+
+ IBacktrace GetBacktrace (int max_frames);
+
+ IRegisters GetRegisters ();
+
+ void SetRegisters (IRegisters registers);
+
+ void StepInstruction ();
+
+ void StepNativeInstruction ();
+
+ void NextInstruction ();
+
+ void StepLine ();
+
+ void NextLine ();
+
+ void Finish (bool native);
+
+ void Continue ();
+
+ void Continue (TargetAddress until);
+
+#region Blocking
+ ICommandResult RuntimeInvoke (ITargetFunctionType function,
+ ITargetClassObject
object_argument,
+ ITargetObject[] param_objects,
+ bool is_virtual);
+#endregion
+
+ void Kill ();
+
+ void Detach ();
+
+ void Stop ();
+
+ void Wait ();
+
+ bool HasTarget {
+ get;
+ }
+
+ bool CanRun {
+ get;
+ }
+
+ bool IsStopped {
+ get;
+ }
+ }
+
+ public interface ICommandResult
+ {
+ object Result {
+ get;
+ }
+
+ WaitHandle CompletedEvent {
+ get;
+ }
+
+ void Wait ();
+ }
+}
Added: trunk/debugger/api/TargetAddress.cs
===================================================================
--- trunk/debugger/api/TargetAddress.cs 2006-10-20 17:06:34 UTC (rev 66836)
+++ trunk/debugger/api/TargetAddress.cs 2006-10-20 17:22:02 UTC (rev 66837)
@@ -0,0 +1,216 @@
+using System;
+
+namespace Mono.Debugger.Interface
+{
+ public interface IAddressDomain
+ {
+ int ID {
+ get;
+ }
+
+ string Name {
+ get;
+ }
+ }
+
+ // <summary>
+ // This is used to store an address in the target's address space.
+ // Addresses are only valid in the target that was used to get them.
+ //
+ // You should always use this struct to pass addresses around, it is a
+ // valuetype and has operators to compare, add, increment, decrement
+ // addresses.
+ //
+ // Note that it is not allowed to compare addresses from different
+ // targets, you'll get an ArgumentException() if you attempt to do so.
+ // This is also the reason why you should never use the `Address'
property
+ // unless you know exactly what you're doing: by using this whole
valuetype
+ // to pass addresses around, it'll protect you against accidentally
using
+ // an address in another target.
+ // </summary>
+ [Serializable]
+ public struct TargetAddress : IComparable
+ {
+ private ulong address;
+ private IAddressDomain domain;
+
+ // <remarks>
+ // Don't use this in a comparision, use IsNull instead.
+ // (TargetAddress.Null is in the null domain and comparision
between
+ // different domains is not allowed).
+ // </remarks>
+ public static TargetAddress Null = new TargetAddress (null, 0);
+
+ // <summary>
+ // This is not what it looks like.
+ // Never use this constructor unless you know exactly what
you're doing.
+ // </summary>
+ public TargetAddress (IAddressDomain domain, long address)
+ {
+ this.domain = domain;
+ // FIXME: hack
+ // address &= 0x00000000ffffffffL;
+ this.address = (ulong) address;
+ }
+
+ public TargetAddress (IAddressDomain domain, IRegister register)
+ : this (domain, register.Value)
+ {
+ }
+
+ // <summary>
+ // This is not what it looks like.
+ // Never use this property unless you know exactly what
you're doing.
+ // </summary>
+ public long Address {
+ get {
+ return (long) address;
+ }
+ }
+
+ // <summary>
+ // The `domain' in which this address lives.
+ // Normally, this is in instance of the IInferior object, but
it can also
+ // be anything else. It is used to ensure that addresses are
only used in
+ // the domain they came from.
+ // </summary>
+ public IAddressDomain Domain {
+ get {
+ return domain;
+ }
+ }
+
+ // <summary>
+ // Use this to check whether an address is null.
+ // </summary>
+ public bool IsNull {
+ get {
+ return (address == 0) && (domain == null);
+ }
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("0x{0}", FormatAddress ((long)
address));
+ }
+
+ public static string FormatAddress (long address)
+ {
+ int bits = 8;
+ string saddr = address.ToString ("x");
+ for (int i = saddr.Length; i < bits; i++)
+ saddr = "0" + saddr;
+ return saddr;
+ }
+
+ static void check_domains (TargetAddress a, TargetAddress b)
+ {
+ if (a.domain == b.domain)
+ return;
+
+ throw new ArgumentException (String.Format (
+ "Cannot compare addresses from different
domains {0} and {1}",
+ a.Domain, b.Domain));
+ }
+
+ public int CompareTo (object obj)
+ {
+ TargetAddress addr = (TargetAddress) obj;
+
+ check_domains (addr, this);
+
+ if (address < addr.address)
+ return -1;
+ else if (address > addr.address)
+ return 1;
+ else
+ return 0;
+ }
+
+ public override bool Equals (object o)
+ {
+ if (o == null || !(o is TargetAddress))
+ return false;
+
+ TargetAddress b = (TargetAddress)o;
+ return address == b.address;
+ }
+
+ public override int GetHashCode ()
+ {
+ return (int)address;
+ }
+
+ //
+ // Operators
+ //
+
+ public static bool operator < (TargetAddress a, TargetAddress b)
+ {
+ check_domains (a, b);
+ return a.address < b.address;
+ }
+
+ public static bool operator > (TargetAddress a, TargetAddress b)
+ {
+ check_domains (a, b);
+ return a.address > b.address;
+ }
+
+ public static bool operator == (TargetAddress a, TargetAddress
b)
+ {
+ check_domains (a, b);
+ return a.Equals (b);
+ }
+
+ public static bool operator != (TargetAddress a, TargetAddress
b)
+ {
+ check_domains (a, b);
+ return a.address != b.address;
+ }
+
+ public static bool operator <= (TargetAddress a, TargetAddress
b)
+ {
+ check_domains (a, b);
+ return a.address <= b.address;
+ }
+
+ public static bool operator >= (TargetAddress a, TargetAddress
b)
+ {
+ check_domains (a, b);
+ return a.address >= b.address;
+ }
+
+ public static TargetAddress operator + (TargetAddress a, long
offset)
+ {
+ return new TargetAddress (a.domain, (long) (a.address +
(ulong) offset));
+ }
+
+ public static TargetAddress operator - (TargetAddress a, long
offset)
+ {
+ return new TargetAddress (a.domain, (long) (a.address -
(ulong) offset));
+ }
+
+ public static TargetAddress operator ++ (TargetAddress a)
+ {
+ a.address++;
+ return a;
+ }
+
+ public static TargetAddress operator -- (TargetAddress a)
+ {
+ a.address--;
+ return a;
+ }
+
+ public static long operator - (TargetAddress a, TargetAddress b)
+ {
+ check_domains (a, b);
+
+ if (a > b)
+ return (long) (a.address - b.address);
+ else
+ return - (long) (b.address - a.address);
+ }
+ }
+}
Added: trunk/debugger/api/TargetObjectKind.cs
===================================================================
--- trunk/debugger/api/TargetObjectKind.cs 2006-10-20 17:06:34 UTC (rev
66836)
+++ trunk/debugger/api/TargetObjectKind.cs 2006-10-20 17:22:02 UTC (rev
66837)
@@ -0,0 +1,16 @@
+namespace Mono.Debugger.Interface
+{
+ public enum TargetObjectKind
+ {
+ Unknown,
+ Fundamental,
+ Enum,
+ Array,
+ Struct,
+ Class,
+ Pointer,
+ Object,
+ Function,
+ Alias
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches