jdwp

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 15 Imported by: 6

Documentation

Overview

Package jdwp implements types to communicate using the the Java Debug Wire Protocol.

Index

Constants

View Source
const (
	// StatusVerified is used to describe a class in the verified state.
	StatusVerified = ClassStatus(1)
	// StatusPrepared is used to describe a class in the prepared state.
	StatusPrepared = ClassStatus(2)
	// StatusInitialized is used to describe a class in the initialized state.
	StatusInitialized = ClassStatus(4)
	// StatusError is used to describe a class in the error state.
	StatusError = ClassStatus(8)
)
View Source
const (
	ErrNone                                = Error(0)
	ErrInvalidThread                       = Error(10)
	ErrInvalidThreadGroup                  = Error(11)
	ErrInvalidPriority                     = Error(12)
	ErrThreadNotSuspended                  = Error(13)
	ErrThreadSuspended                     = Error(14)
	ErrInvalidObject                       = Error(20)
	ErrInvalidClass                        = Error(21)
	ErrClassNotPrepared                    = Error(22)
	ErrInvalidMethodID                     = Error(23)
	ErrInvalidLocation                     = Error(24)
	ErrInvalidFieldID                      = Error(25)
	ErrInvalidFrameID                      = Error(30)
	ErrNoMoreFrames                        = Error(31)
	ErrOpaqueFrame                         = Error(32)
	ErrNotCurrentFrame                     = Error(33)
	ErrTypeMismatch                        = Error(34)
	ErrInvalidSlot                         = Error(35)
	ErrDuplicate                           = Error(40)
	ErrNotFound                            = Error(41)
	ErrInvalidMonitor                      = Error(50)
	ErrNotMonitorOwner                     = Error(51)
	ErrInterrupt                           = Error(52)
	ErrInvalidClassFormat                  = Error(60)
	ErrCircularClassDefinition             = Error(61)
	ErrFailsVerification                   = Error(62)
	ErrAddMethodNotImplemented             = Error(63)
	ErrSchemaChangeNotImplemented          = Error(64)
	ErrInvalidTypestate                    = Error(65)
	ErrHierarchyChangeNotImplemented       = Error(66)
	ErrDeleteMethodNotImplemented          = Error(67)
	ErrUnsupportedVersion                  = Error(68)
	ErrNamesDontMatch                      = Error(69)
	ErrClassModifiersChangeNotImplemented  = Error(70)
	ErrMethodModifiersChangeNotImplemented = Error(71)
	ErrNotImplemented                      = Error(99)
	ErrNullPointer                         = Error(100)
	ErrAbsentInformation                   = Error(101)
	ErrInvalidEventType                    = Error(102)
	ErrIllegalArgument                     = Error(103)
	ErrOutOfMemory                         = Error(110)
	ErrAccessDenied                        = Error(111)
	ErrVMDead                              = Error(112)
	ErrInternal                            = Error(113)
	ErrUnattachedThread                    = Error(115)
	ErrInvalidTag                          = Error(500)
	ErrAlreadyInvoking                     = Error(502)
	ErrInvalidIndex                        = Error(503)
	ErrInvalidLength                       = Error(504)
	ErrInvalidString                       = Error(506)
	ErrInvalidClassLoader                  = Error(507)
	ErrInvalidArray                        = Error(508)
	ErrTransportLoad                       = Error(509)
	ErrTransportInit                       = Error(510)
	ErrNativeMethod                        = Error(511)
	ErrInvalidCount                        = Error(512)
)
View Source
const (
	// SingleStep is the kind of event raised when a single-step has been completed.
	SingleStep = EventKind(1)
	// Breakpoint is the kind of event raised when a breakpoint has been hit.
	Breakpoint = EventKind(2)
	// FramePop is the kind of event raised when a stack-frame is popped.
	FramePop = EventKind(3)
	// Exception is the kind of event raised when an exception is thrown.
	Exception = EventKind(4)
	// UserDefined is the kind of event raised when a user-defind event is fired.
	UserDefined = EventKind(5)
	// ThreadStart is the kind of event raised when a new thread is started.
	ThreadStart = EventKind(6)
	// ThreadDeath is the kind of event raised when a thread is stopped.
	ThreadDeath = EventKind(7)
	// ClassPrepare is the kind of event raised when a class enters the prepared state.
	ClassPrepare = EventKind(8)
	// ClassUnload is the kind of event raised when a class is unloaded.
	ClassUnload = EventKind(9)
	// ClassLoad is the kind of event raised when a class enters the loaded state.
	ClassLoad = EventKind(10)
	// FieldAccess is the kind of event raised when a field is accessed.
	FieldAccess = EventKind(20)
	// FieldModification is the kind of event raised when a field is modified.
	FieldModification = EventKind(21)
	// ExceptionCatch is the kind of event raised when an exception is caught.
	ExceptionCatch = EventKind(30)
	// MethodEntry is the kind of event raised when a method has been entered.
	MethodEntry = EventKind(40)
	// MethodExit is the kind of event raised when a method has been exited.
	MethodExit = EventKind(41)
	// VMStart is the kind of event raised when the virtual machine is initialized.
	VMStart = EventKind(90)
	// VMDeath is the kind of event raised when the virtual machine is shutdown.
	VMDeath = EventKind(99)
)
View Source
const (
	// InvokeSingleThreaded prevents the resume of all other threads when
	// performing the invoke. Once the invoke has finished, the single thread will
	// suspended again.
	InvokeSingleThreaded = InvokeOptions(1)

	// InvokeNonvirtual invokes the method without using regular, virtual
	// invocation.
	InvokeNonvirtual = InvokeOptions(2)
)
View Source
const (
	ModPublic       = ModBits(1)
	ModPrivate      = ModBits(2)
	ModProtected    = ModBits(4)
	ModStatic       = ModBits(8)
	ModFinal        = ModBits(16)
	ModSynchronized = ModBits(32)
	ModVolatile     = ModBits(64)
	ModTransient    = ModBits(128)
	ModInterface    = ModBits(512)
	ModNative       = ModBits(256)
	ModAbstract     = ModBits(1024)
	ModStrict       = ModBits(2048)
)
View Source
const (
	// SuspendNone suspends no threads when a event is raised.
	SuspendNone = SuspendPolicy(0)
	// SuspendEventThread suspends only the event's thread when a event is raised.
	SuspendEventThread = SuspendPolicy(1)
	// SuspendAll suspends all threads when a event is raised.
	SuspendAll = SuspendPolicy(2)
)
View Source
const (
	TagArray       = Tag(91)  // '[' - an array object (objectID size).
	TagByte        = Tag(66)  // 'B' - a byte value (1 byte).
	TagChar        = Tag(67)  // 'C' - a character value (2 bytes).
	TagObject      = Tag(76)  // 'L' - an object (objectID size).
	TagFloat       = Tag(70)  // 'F' - a float value (4 bytes).
	TagDouble      = Tag(68)  // 'D' - a double value (8 bytes).
	TagInt         = Tag(73)  // 'I' - an int value (4 bytes).
	TagLong        = Tag(74)  // 'J' - a long value (8 bytes).
	TagShort       = Tag(83)  // 'S' - a short value (2 bytes).
	TagVoid        = Tag(86)  // 'V' - a void value (no bytes).
	TagBoolean     = Tag(90)  // 'Z' - a boolean value (1 byte).
	TagString      = Tag(115) // 's' - a String object (objectID size).
	TagThread      = Tag(116) // 't' - a Thread object (objectID size).
	TagThreadGroup = Tag(103) // 'g' - a ThreadGroup object (objectID size).
	TagClassLoader = Tag(108) // 'l' - a ClassLoader object (objectID size).
	TagClassObject = Tag(99)  // 'c' - a class object object (objectID size).
)
View Source
const (
	Class     = TypeTag(1) // Type is a class.
	Interface = TypeTag(2) // Type is an interface.
	Array     = TypeTag(3) // Type is an array.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayID

type ArrayID uint64

ArrayID is an array instance identifier. ArrayID can always be safely cast to the less specific ObjectID.

func (ArrayID) ID

func (i ArrayID) ID() ObjectID

ID returns the ArrayID as an ObjectID

func (ArrayID) String

func (i ArrayID) String() string

type ArrayTypeID

type ArrayTypeID uint64

ArrayTypeID is an array reference type identifier. ArrayTypeID can always be safely cast to the less specific ReferenceTypeID.

func (ArrayTypeID) String

func (i ArrayTypeID) String() string

type Char

type Char int16

Char is a 16-bit character type.

type ClassExcludeEventModifier

type ClassExcludeEventModifier string

ClassExcludeEventModifier is an EventModifier that filters the events to those that are not associated with class names that match the pattern. See ClassMatchEventModifier for the permitted patterns.

type ClassID

type ClassID uint64

ClassID is a class reference type identifier. ClassID can always be safely cast to the less specific ReferenceTypeID.

func (ClassID) String

func (i ClassID) String() string

type ClassInfo

type ClassInfo struct {
	Kind      TypeTag         // Kind of reference type
	TypeID    ReferenceTypeID // Matching loaded reference type
	Signature string          // The class signature
	Status    ClassStatus     // The class status
}

ClassInfo describes a loaded classes matching the requested signature.

func (ClassInfo) ClassID

func (c ClassInfo) ClassID() ClassID

ClassID returns the class identifier for the ClassBySignature.

type ClassLoaderID

type ClassLoaderID uint64

ClassLoaderID is class loader identifier. ClassLoaderID can always be safely cast to the less specific ObjectID.

func (ClassLoaderID) ID

func (i ClassLoaderID) ID() ObjectID

ID returns the ClassLoaderID as an ObjectID

func (ClassLoaderID) String

func (i ClassLoaderID) String() string

type ClassMatchEventModifier

type ClassMatchEventModifier string

ClassMatchEventModifier is an EventModifier that filters the events to those that are associated with class names that match the pattern. The pattern can be an exact class name match, for use a '*' wildcard at the start or end of the string. Examples: • "java.lang.String" • "*.String" • "java.lang.*"

type ClassObjectID

type ClassObjectID uint64

ClassObjectID is a class object instance identifier. ClassObjectID can always be safely cast to the less specific ObjectID.

func (ClassObjectID) ID

func (i ClassObjectID) ID() ObjectID

ID returns the ClassObjectID as an ObjectID

func (ClassObjectID) String

func (i ClassObjectID) String() string

type ClassOnlyEventModifier

type ClassOnlyEventModifier ClassID

ClassOnlyEventModifier is an EventModifier that filters the events to those that are associated with the specified class.

type ClassStatus

type ClassStatus int

ClassStatus is an enumerator of class loading state. See https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-5.html#jvms-5.3 for detailed descriptions of the loading states.

func (ClassStatus) String

func (c ClassStatus) String() string

type Connection

type Connection struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Connection represents a JDWP connection.

func Open

func Open(ctx context.Context, conn io.ReadWriteCloser) (*Connection, error)

Open creates a Connection using conn for I/O.

func (*Connection) ClearEvent

func (c *Connection) ClearEvent(kind EventKind, id EventRequestID) error

ClearEvent cancels an event request.

func (*Connection) CreateString

func (c *Connection) CreateString(str string) (StringID, error)

CreateString returns the StringID for the given string.

func (*Connection) DisableGC

func (c *Connection) DisableGC(object ObjectID) error

DisableGC disables garbage collection for the specified object.

func (*Connection) EnableGC

func (c *Connection) EnableGC(object ObjectID) error

EnableGC enables garbage collection for the specified object.

func (*Connection) GetAllClasses

func (c *Connection) GetAllClasses() ([]ClassInfo, error)

GetAllClasses returns all the active threads by ID.

func (*Connection) GetAllThreads

func (c *Connection) GetAllThreads() ([]ThreadID, error)

GetAllThreads returns all the active threads by ID.

func (*Connection) GetArrayLength

func (c *Connection) GetArrayLength(id ArrayID) (int, error)

GetArrayLength returns the length of the specified array.

func (*Connection) GetArrayValues

func (c *Connection) GetArrayValues(id ArrayID, first, length int) ([]Value, error)

GetArrayValues the values of the specified array.

func (*Connection) GetClassBySignature

func (c *Connection) GetClassBySignature(signature string) (ClassInfo, error)

GetClassBySignature returns the single loaded class matching the requested signature from the server. If there are no, or more than one class found, then an error is returned.

func (*Connection) GetClassMethod

func (c *Connection) GetClassMethod(class ClassID, name, signature string) (Method, error)

GetClassMethod looks up the method with the specified signature on class.

func (*Connection) GetClassesBySignature

func (c *Connection) GetClassesBySignature(signature string) ([]ClassInfo, error)

GetClassesBySignature returns all the loaded classes matching the requested signature from the server.

func (*Connection) GetFieldValues added in v0.5.0

func (c *Connection) GetFieldValues(obj ObjectID, fields ...FieldID) ([]Value, error)

GetFieldValues returns the values of all the instance fields.

func (*Connection) GetFields

func (c *Connection) GetFields(ty ReferenceTypeID) (Fields, error)

GetFields returns all the fields for the specified type.

func (*Connection) GetFrames

func (c *Connection) GetFrames(thread ThreadID, start, count int) ([]FrameInfo, error)

GetFrames returns a number of stack frames.

func (*Connection) GetIDSizes

func (c *Connection) GetIDSizes() (IDSizes, error)

GetIDSizes returns the sizes of all the variably sized data types.

func (*Connection) GetImplemented

func (c *Connection) GetImplemented(ty ReferenceTypeID) ([]InterfaceID, error)

GetImplemented returns all the direct interfaces implemented by the specified type.

func (*Connection) GetLocationMethodName

func (c *Connection) GetLocationMethodName(l Location) (string, error)

GetLocationMethodName returns the name of the method from the location.

func (*Connection) GetMethods

func (c *Connection) GetMethods(ty ReferenceTypeID) (Methods, error)

GetMethods returns all the methods for the specified type.

func (*Connection) GetObjectType

func (c *Connection) GetObjectType(object ObjectID) (ObjectType, error)

GetObjectType returns the type of the specified object.

func (*Connection) GetStaticFieldValues

func (c *Connection) GetStaticFieldValues(ty ReferenceTypeID, fields ...FieldID) ([]Value, error)

GetStaticFieldValues returns the values of all the requests static fields.

func (*Connection) GetString

func (c *Connection) GetString(id StringID) (string, error)

GetString returns the string text for the given StringID.

func (*Connection) GetSuperClass

func (c *Connection) GetSuperClass(class ClassID) (ClassID, error)

GetSuperClass returns the immediate super class of the specified class.

func (*Connection) GetThisObject

func (c *Connection) GetThisObject(thread ThreadID, frame FrameID) (TaggedObjectID, error)

GetThisObject returns the this object for the specified thread and stack frame.

func (*Connection) GetTypeSignature

func (c *Connection) GetTypeSignature(ty ReferenceTypeID) (string, error)

GetTypeSignature returns the Java type signature for the specified type.

func (*Connection) GetValues

func (c *Connection) GetValues(thread ThreadID, frame FrameID, slots []VariableRequest) ([]Value, error)

GetValues returns the set of objects for the specified thread and frame, based on their slots.

func (*Connection) GetVersion

func (c *Connection) GetVersion() (Version, error)

GetVersion returns the JDWP version from the server.

func (*Connection) InvokeMethod

func (c *Connection) InvokeMethod(object ObjectID, class ClassID, method MethodID, thread ThreadID, options InvokeOptions, args ...Value) (InvokeResult, error)

InvokeMethod invokes the specified static method.

func (*Connection) InvokeStaticMethod

func (c *Connection) InvokeStaticMethod(class ClassID, method MethodID, thread ThreadID, options InvokeOptions, args ...Value) (InvokeResult, error)

InvokeStaticMethod invokes the specified static method.

func (*Connection) NewArray

func (c *Connection) NewArray(ty ArrayTypeID, length int) (TaggedObjectID, error)

NewArray constructs a new array of the specified type and length.

func (*Connection) NewInstance

func (c *Connection) NewInstance(class ClassID, constructor MethodID, thread ThreadID, options InvokeOptions, args ...Value) (NewInstanceResult, error)

NewInstance invokes the specified constructor.

func (*Connection) ReflectedType added in v0.6.1

func (c *Connection) ReflectedType(id ClassObjectID) (ReferenceTypeID, error)

ReflectedType returns the reference type reflected by the class object.

func (*Connection) Resume

func (c *Connection) Resume(id ThreadID) error

Resume resumes the specified thread.

func (*Connection) ResumeAll

func (c *Connection) ResumeAll() error

ResumeAll resumes all threads.

func (*Connection) SetArrayValues

func (c *Connection) SetArrayValues(id ArrayID, first int, values interface{}) error

SetArrayValues the values of the specified array.

func (*Connection) SetEvent

func (c *Connection) SetEvent(kind EventKind, suspendPolity SuspendPolicy, modifiers ...EventModifier) (EventRequestID, error)

SetEvent sets an event request.

func (*Connection) SetValues

func (c *Connection) SetValues(thread ThreadID, frame FrameID, slots []VariableAssignmentRequest) error

SetValues sets the values for the local variables given thread and frame

func (*Connection) Suspend

func (c *Connection) Suspend(id ThreadID) error

Suspend suspends the specified thread.

func (*Connection) SuspendAll

func (c *Connection) SuspendAll() error

SuspendAll suspends all threads.

func (*Connection) VariableTable

func (c *Connection) VariableTable(classTy ReferenceTypeID, method MethodID) (VariableTable, error)

VariableTable returns all of the variables that are present in the given Method.

func (*Connection) WaitForClassPrepare

func (c *Connection) WaitForClassPrepare(ctx context.Context, pattern string) (ThreadID, error)

WaitForClassPrepare blocks until a class with a name that matches the pattern is prepared, and then returns the thread that prepared the class.

func (*Connection) WaitForMethodEntry

func (c *Connection) WaitForMethodEntry(ctx context.Context, class ClassID, method MethodID, wakeup ThreadID) (*EventMethodEntry, error)

WaitForMethodEntry blocks until the method on class is entered, and then returns the method entry event. The thread is suspended when the method returns. If wakeup is not 0, then the given thread is resumed before we wait for the method.

func (*Connection) WaitForMethodExit added in v0.9.0

func (c *Connection) WaitForMethodExit(ctx context.Context, class ClassID, method MethodID, wakeup ThreadID) (*EventMethodExit, error)

WaitForMethodExit blocks until the method on class is exited, and then returns the method exit event. The thread is suspended when the method returns. If wakeup is not 0, then the given thread is resumed before we wait for the method.

func (*Connection) WatchEvents

func (c *Connection) WatchEvents(ctx context.Context, wakeup ThreadID, cb OnEvent)

WatchEvents calls cb each time a new event arrives. WatchEvents will block until cb returns false, or the ctx is cancelled. If wakeup is not 0, then the given thread is resumed before we wait for the method.

type CountEventModifier

type CountEventModifier int

CountEventModifier is an EventModifier that limits the number of times an event is fired. For example, using a CountEventModifier of 2 will only let two events fire.

type Error

type Error uint16

Error is an enumerator of error codes returned by JDWP.

func (Error) Error

func (e Error) Error() string

type Event

type Event interface {
	Kind() EventKind
}

Event is the interface implemented by all events raised by the VM.

type EventBreakpoint

type EventBreakpoint struct {
	Request  EventRequestID
	Thread   ThreadID
	Location Location
}

EventBreakpoint represents an event raised when a breakpoint has been hit.

func (EventBreakpoint) Kind

func (EventBreakpoint) Kind() EventKind

Kind returns Breakpoint

type EventClassPrepare

type EventClassPrepare struct {
	Request   EventRequestID
	Thread    ThreadID
	ClassKind TypeTag
	ClassType ReferenceTypeID
	Signature string
	Status    ClassStatus
}

EventClassPrepare represents an event raised when a class enters the prepared state.

func (EventClassPrepare) Kind

Kind returns ClassPrepare

type EventClassUnload

type EventClassUnload struct {
	Request   EventRequestID
	Signature string
}

EventClassUnload represents an event raised when a class is unloaded.

func (EventClassUnload) Kind

func (EventClassUnload) Kind() EventKind

Kind returns ClassUnload

type EventException

type EventException struct {
	Request       EventRequestID
	Thread        ThreadID
	Location      Location
	Exception     TaggedObjectID
	CatchLocation Location
}

EventException represents an event raised when an exception is thrown.

func (EventException) Kind

func (EventException) Kind() EventKind

Kind returns Exception

type EventFieldAccess

type EventFieldAccess struct {
	Request   EventRequestID
	Thread    ThreadID
	Location  Location
	FieldKind TypeTag
	FieldType ReferenceTypeID
	Field     FieldID
	Object    TaggedObjectID
}

EventFieldAccess represents an event raised when a field is accessed.

func (EventFieldAccess) Kind

func (EventFieldAccess) Kind() EventKind

Kind returns FieldAccess

type EventFieldModification

type EventFieldModification struct {
	Request   EventRequestID
	Thread    ThreadID
	Location  Location
	FieldKind TypeTag
	FieldType ReferenceTypeID
	Field     FieldID
	Object    TaggedObjectID
	NewValue  Value
}

EventFieldModification represents an event raised when a field is modified.

func (EventFieldModification) Kind

Kind returns FieldModification

type EventKind

type EventKind uint8

EventKind represents the type of event to set, or being raised.

func (EventKind) String

func (k EventKind) String() string

type EventMethodEntry

type EventMethodEntry struct {
	Request  EventRequestID
	Thread   ThreadID
	Location Location
}

EventMethodEntry represents an event raised when a method has been entered.

func (EventMethodEntry) Kind

func (EventMethodEntry) Kind() EventKind

Kind returns MethodEntry

type EventMethodExit

type EventMethodExit struct {
	Request  EventRequestID
	Thread   ThreadID
	Location Location
}

EventMethodExit represents an event raised when a method has been exited.

func (EventMethodExit) Kind

func (EventMethodExit) Kind() EventKind

Kind returns MethodExit

type EventModifier

type EventModifier interface {
	// contains filtered or unexported methods
}

EventModifier is the interface implemented by all event modifier types. These are filters on the events that are raised. See http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_EventRequest_Set for detailed descriptions and rules for each of the EventModifiers.

type EventRequestID

type EventRequestID int

EventRequestID is an identifier of an event request.

type EventSingleStep

type EventSingleStep struct {
	Request  EventRequestID
	Thread   ThreadID
	Location Location
}

EventSingleStep represents an event raised when a single-step has been completed.

func (EventSingleStep) Kind

func (EventSingleStep) Kind() EventKind

Kind returns SingleStep

type EventThreadDeath

type EventThreadDeath struct {
	Request EventRequestID
	Thread  ThreadID
}

EventThreadDeath represents an event raised when a thread is stopped.

func (EventThreadDeath) Kind

func (EventThreadDeath) Kind() EventKind

Kind returns ThreadDeath

type EventThreadStart

type EventThreadStart struct {
	Request EventRequestID
	Thread  ThreadID
}

EventThreadStart represents an event raised when a new thread is started.

func (EventThreadStart) Kind

func (EventThreadStart) Kind() EventKind

Kind returns ThreadStart

type EventVMDeath

type EventVMDeath struct {
	Request EventRequestID
}

EventVMDeath represents an event raised when the virtual machine is stopped.

func (EventVMDeath) Kind

func (EventVMDeath) Kind() EventKind

Kind returns VMDeath

type EventVMStart

type EventVMStart struct {
	Request EventRequestID
	Thread  ThreadID
}

EventVMStart represents an event raised when the virtual machine is started.

func (EventVMStart) Kind

func (EventVMStart) Kind() EventKind

Kind returns VMStart

type Events

type Events struct {
	SuspendPolicy SuspendPolicy
	Events        []Event
}

Events is a collection of events.

type ExceptionOnlyEventModifier

type ExceptionOnlyEventModifier struct {
	ExceptionOrNull ReferenceTypeID // If not nil, only permit exceptions of this type.
	Caught          bool            // Report caught exceptions
	Uncaught        bool            // Report uncaught exceptions
}

ExceptionOnlyEventModifier is an EventModifier that filters exception events. Can only be used for exception events.

type Field

type Field struct {
	ID        FieldID
	Name      string
	Signature string
	ModBits   ModBits
}

Field describes a single field

type FieldID

type FieldID uint64

FieldID is the identifier for a single method for a class or interface.

func (FieldID) String

func (i FieldID) String() string

type FieldOnlyEventModifier

type FieldOnlyEventModifier struct {
	Type  ReferenceTypeID
	Field FieldID
}

FieldOnlyEventModifier is an EventModifier that filters events to those relating to the specified field. Can only be used for field access or field modified events.

type Fields

type Fields []Field

Fields is a collection of fields

func (Fields) FindByID

func (l Fields) FindByID(id FieldID) *Field

FindByID returns the field with the matching identifier in l, or nil if no field with a matching identifier is found in l.

func (Fields) FindByName

func (l Fields) FindByName(name string) *Field

FindByName returns the field with the matching name, or nil if no field with a matching name is found in l.

func (Fields) FindBySignature

func (l Fields) FindBySignature(name, sig string) *Field

FindBySignature returns the field with the matching signature in l, or nil if no field with a matching signature is found in l.

func (Fields) String

func (l Fields) String() string

type FrameID

type FrameID uint64

FrameID is the identifier for a stack frame.

func (FrameID) String

func (i FrameID) String() string

type FrameInfo

type FrameInfo struct {
	Frame    FrameID
	Location Location
}

FrameInfo describes a single stack frame.

type FrameVariable

type FrameVariable struct {
	CodeIndex uint64
	Name      string
	Signature string
	Length    int
	Slot      int
}

FrameVariable contains all of the information a single variable.

type IDSizes

type IDSizes struct {
	FieldIDSize         int32 // FieldID size in bytes
	MethodIDSize        int32 // MethodID size in bytes
	ObjectIDSize        int32 // ObjectID size in bytes
	ReferenceTypeIDSize int32 // ReferenceTypeID size in bytes
	FrameIDSize         int32 // FrameID size in bytes
}

IDSizes describes the sizes of all the variably sized data types.

type InstanceOnlyEventModifier

type InstanceOnlyEventModifier ObjectID

InstanceOnlyEventModifier is an EventModifier that filters events to those which have the specified 'this' object.

type InterfaceID

type InterfaceID uint64

InterfaceID is an interface reference type identifier. InterfaceID can always be safely cast to the less specific ReferenceTypeID.

func (InterfaceID) String

func (i InterfaceID) String() string

type InvokeOptions

type InvokeOptions int

InvokeOptions is a collection of bit flags controlling an invoke.

func (InvokeOptions) String

func (i InvokeOptions) String() string

type InvokeResult

type InvokeResult struct {
	Result    Value
	Exception TaggedObjectID
}

InvokeResult holds the return values for a method invokation.

type Location

type Location struct {
	Type     TypeTag
	Class    ClassID
	Method   MethodID
	Location uint64
}

Location describes a code location.

type LocationOnlyEventModifier

type LocationOnlyEventModifier Location

LocationOnlyEventModifier is an EventModifier that filters the events to those that only originate at the specified location.

type Method

type Method struct {
	ID        MethodID
	Name      string
	Signature string
	ModBits   ModBits
}

Method describes a single method

type MethodID

type MethodID uint64

MethodID is the identifier for a single method for a class or interface.

func (MethodID) String

func (i MethodID) String() string

type Methods

type Methods []Method

Methods is a collection of methods

func (Methods) FindByID

func (l Methods) FindByID(id MethodID) *Method

FindByID returns the method with the matching identifier in l, or nil if no method with a matching identifier is found in l.

func (Methods) FindBySignature

func (l Methods) FindBySignature(name, sig string) *Method

FindBySignature returns the method with the matching signature in l, or nil if no method with a matching signature is found in l.

func (Methods) String

func (l Methods) String() string

type ModBits

type ModBits int

ModBits represents the modifier bitflags for a class, method or field.

func (ModBits) Abstract

func (m ModBits) Abstract() bool

func (ModBits) Final

func (m ModBits) Final() bool

func (ModBits) Interface

func (m ModBits) Interface() bool

func (ModBits) Native

func (m ModBits) Native() bool

func (ModBits) Private

func (m ModBits) Private() bool

func (ModBits) Protected

func (m ModBits) Protected() bool

func (ModBits) Public

func (m ModBits) Public() bool

func (ModBits) Static

func (m ModBits) Static() bool

func (ModBits) Strict

func (m ModBits) Strict() bool

func (ModBits) String

func (m ModBits) String() string

func (ModBits) Synchronized

func (m ModBits) Synchronized() bool

func (ModBits) Transient

func (m ModBits) Transient() bool

func (ModBits) Volatile

func (m ModBits) Volatile() bool

type NewInstanceResult

type NewInstanceResult struct {
	Result    TaggedObjectID
	Exception TaggedObjectID
}

NewInstanceResult holds the return values for a constructor invokation.

type Object

type Object interface {
	ID() ObjectID
}

Object is the interface implemented by all types that are a variant of ObjectID.

type ObjectID

type ObjectID uint64

ObjectID is an object instance identifier. If the specific object type is known, then ObjectID can be cast to ThreadID, ThreadGroupID, StringID, ClassLoaderID, ClassObjectID or ArrayID.

func (ObjectID) ID

func (i ObjectID) ID() ObjectID

ID returns the ObjectID

func (ObjectID) String

func (i ObjectID) String() string

type ObjectType

type ObjectType struct {
	Kind TypeTag
	Type ReferenceTypeID
}

ObjectType describes a Java type.

type OnEvent

type OnEvent func(Event, SuspendPolicy) bool

OnEvent is the callback passed to WatchEvents. If no more events need to be handled, return false.

type ReferenceTypeID

type ReferenceTypeID uint64

ReferenceTypeID is a reference type identifier. If the specific reference type is known, then ReferenceTypeID can be cast to ClassID, InterfaceID or ArrayTypeID.

func (ReferenceTypeID) String

func (i ReferenceTypeID) String() string

type StepEventModifier

type StepEventModifier struct {
	Thread ThreadID
	Size   int
	Depth  int
}

StepEventModifier is an EventModifier that filters step events to those which satisfy depth and size constraints. Can only be used with step events.

type StringID

type StringID uint64

StringID is a string instance identifier. StringID can always be safely cast to the less specific ObjectID.

func (StringID) ID

func (i StringID) ID() ObjectID

ID returns the StringID as an ObjectID

func (StringID) String

func (i StringID) String() string

type SuspendPolicy

type SuspendPolicy byte

SuspendPolicy describes what threads should be suspended on an event being raised.

type Tag

type Tag uint8

Tag is a type kind enumerator.

func (Tag) String

func (t Tag) String() string

type TaggedObjectID

type TaggedObjectID struct {
	Type   Tag
	Object ObjectID
}

TaggedObjectID is a type and object identifier pair.

func (TaggedObjectID) ID

func (i TaggedObjectID) ID() ObjectID

ID returns the ObjectID of the TaggedObjectID

type ThreadGroupID

type ThreadGroupID uint64

ThreadGroupID is an thread group identifier. ThreadGroupID can always be safely cast to the less specific ObjectID.

func (ThreadGroupID) ID

func (i ThreadGroupID) ID() ObjectID

ID returns the ThreadGroupID as an ObjectID

func (ThreadGroupID) String

func (i ThreadGroupID) String() string

type ThreadID

type ThreadID uint64

ThreadID is an thread instance identifier. ThreadID can always be safely cast to the less specific ObjectID.

func (ThreadID) ID

func (i ThreadID) ID() ObjectID

ID returns the ThreadID as an ObjectID

func (ThreadID) String

func (i ThreadID) String() string

type ThreadOnlyEventModifier

type ThreadOnlyEventModifier ThreadID

ThreadOnlyEventModifier is an EventModifier that filters the events to those that are raised on the specified thread.

type TypeTag

type TypeTag uint8

TypeTag is an enumerator of class, interface or array.

func (TypeTag) String

func (t TypeTag) String() string

type Value

type Value interface{}

Value is a generic value that can be one of the following types: • bool • Char • int • int8 • int16 • int32 • int64 • float32 • float64 • ArrayID • ClassLoaderID • ClassObjectID • ObjectID • StringID • ThreadGroupID • ThreadID • nil

type ValueSlice

type ValueSlice []Value

ValueSlice contains a set of values

type VariableAssignmentRequest

type VariableAssignmentRequest struct {
	Index int
	Value Value
}

type VariableRequest

type VariableRequest struct {
	Index int
	Tag   uint8
}

type VariableTable

type VariableTable struct {
	ArgCount int
	Slots    []FrameVariable
}

VariableTable contains all of the variables for a stack frame.

type Version

type Version struct {
	Description string //		Text information on the VM version
	JDWPMajor   int    //		Major JDWP Version number
	JDWPMinor   int    //		Minor JDWP Version number
	Version     string //		Target VM JRE version, as in the java.version property
	Name        string //		Target VM name, as in the java.vm.name property
}

Version describes the JDWP version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL