rtda

package
v0.0.0-...-eb536d9 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccPublic       = 0x0001 //class field method b9771-01836
	AccPrivate      = 0x0002 //field method 09007-2d0b2
	AccProtected    = 0x0004 //field method 5907c-32c79
	AccStatic       = 0x0008 //field method 9acab-5eeb8
	AccFinal        = 0x0010 //class filed method 0457b-892cd
	AccSuper        = 0x0020 //class 0dfec-1842b
	AccSynchronized = 0x0020 //method 89dbc-8afb8
	AccVolatile     = 0x0040 //field 0aaba-c95ad
	AccBridge       = 0x0040 //method 6d434-022a0
	AccTransient    = 0x0080 //field 699ee-84ef2
	AccVarArgs      = 0x0080 //method ba30a-6d0a1
	AccNative       = 0x0100 //method fad2f-42967
	AccInterface    = 0x0200 //class fe79d-16928
	AccAbstract     = 0x0400 //class method reverse top
	AccStrict       = 0x0800 //method 248db-8f175
	AccSynthetic    = 0x1000 //class field method ec34f-206b4
	AccAnnotation   = 0x2000 //class 98f34-5ca7a
	AccEnum         = 0x4000 //class field
)

Variables

This section is empty.

Functions

func ArrayCopy

func ArrayCopy(src, dest *Object, srcPos, destPos, length int32)

func GetGoString

func GetGoString(jString *Object) string

func ToMethodDescriptor

func ToMethodDescriptor(args *Object) string

Types

type ArrayBoolean

type ArrayBoolean []int8

type ArrayByte

type ArrayByte []int8

type ArrayChar

type ArrayChar []uint16

type ArrayDouble

type ArrayDouble []float64

type ArrayFloat

type ArrayFloat []float32

type ArrayInt

type ArrayInt []int32

type ArrayLong

type ArrayLong []int64

type ArrayRef

type ArrayRef []*Object

type ArrayShort

type ArrayShort []int16

type Class

type Class struct {
	AccessFlags uint16

	SourceFile     string
	Signature      string
	AnnotationData []byte
	// contains filtered or unexported fields
}

func (*Class) ArrayClass

func (class *Class) ArrayClass() *Class

func (*Class) ClassLoader

func (class *Class) ClassLoader() *ClassLoader

func (*Class) ComponentClass

func (class *Class) ComponentClass() *Class

func (*Class) ConstantPool

func (class *Class) ConstantPool() *ConstantPool

func (*Class) GetAllDeclaredConstructors

func (class *Class) GetAllDeclaredConstructors() []*Method

func (*Class) GetClinitMethod

func (class *Class) GetClinitMethod() *Method

func (*Class) GetConstructor

func (class *Class) GetConstructor(descriptor string) *Method

func (*Class) GetDeclaredConstructors

func (class *Class) GetDeclaredConstructors(publicOnly bool) []*Method

func (*Class) GetDeclaredFields

func (class *Class) GetDeclaredFields(publicOnly bool) []*Field

func (*Class) GetField

func (class *Class) GetField(filter func(*Field) bool) *Field

func (*Class) GetInstanceMethod

func (class *Class) GetInstanceMethod(name string, descriptor string) *Method

func (*Class) GetMainMethod

func (class *Class) GetMainMethod() *Method

func (*Class) GetPackageName

func (class *Class) GetPackageName() string

func (*Class) GetStaticField

func (class *Class) GetStaticField(name, descriptor string) *Field

func (*Class) GetStaticMethod

func (class *Class) GetStaticMethod(name string, descriptor string) *Method

func (*Class) InitStarted

func (class *Class) InitStarted() bool

func (*Class) IsAbstract

func (class *Class) IsAbstract() bool

func (*Class) IsAccessibleTo

func (class *Class) IsAccessibleTo(other *Class) bool

func (*Class) IsAnnotation

func (class *Class) IsAnnotation() bool

func (*Class) IsArray

func (class *Class) IsArray() bool

func (*Class) IsAssignableFrom

func (class *Class) IsAssignableFrom(targetClass *Class) bool

func (*Class) IsEnum

func (class *Class) IsEnum() bool

func (*Class) IsFinal

func (class *Class) IsFinal() bool

func (*Class) IsInterface

func (class *Class) IsInterface() bool

func (*Class) IsPrimitiveType

func (class *Class) IsPrimitiveType() bool

func (*Class) IsPublic

func (class *Class) IsPublic() bool

func (*Class) IsSuper

func (class *Class) IsSuper() bool

func (*Class) IsSuperClassOf

func (class *Class) IsSuperClassOf(targetClass *Class) bool

func (*Class) IsSynthetic

func (class *Class) IsSynthetic() bool

func (*Class) JClass

func (class *Class) JClass() *Object

func (*Class) JavaName

func (class *Class) JavaName() string

func (*Class) LookupInterfaceMethod

func (class *Class) LookupInterfaceMethod(name, descriptor string) *Method

func (*Class) LookupMethod

func (class *Class) LookupMethod(name, descriptor string) *Method

func (*Class) Name

func (class *Class) Name() string

func (*Class) NewArray

func (class *Class) NewArray(length uint) *Object

func (*Class) NewInstance

func (class *Class) NewInstance() *Object

func (*Class) StartInit

func (class *Class) StartInit()

func (*Class) StaticFields

func (class *Class) StaticFields() Slots

func (*Class) SuperClass

func (class *Class) SuperClass() *Class

type ClassLoader

type ClassLoader struct {
	// contains filtered or unexported fields
}

func NewClassLoader

func NewClassLoader(classpath *classpath2.Classpath, verbose bool) *ClassLoader

func (*ClassLoader) FindLoadedClass

func (cl *ClassLoader) FindLoadedClass(name string) *Class

func (*ClassLoader) LoadClass

func (cl *ClassLoader) LoadClass(name string) *Class

type ClassRef

type ClassRef struct {
	SymbolicRef
}

type Constant

type Constant interface{}

type ConstantPool

type ConstantPool struct {
	// contains filtered or unexported fields
}

func (*ConstantPool) GetConstant

func (cp *ConstantPool) GetConstant(index uint16) Constant

type ExceptionHandler

type ExceptionHandler struct {
	StartPc   uint16
	EndPc     uint16
	HandlerPc uint16
	CatchType *ClassRef
}

type ExceptionTable

type ExceptionTable []*ExceptionHandler

func (ExceptionTable) FindExceptionHandler

func (table ExceptionTable) FindExceptionHandler(exceptionClass *Class, pc uint32) *ExceptionHandler

type Field

type Field struct {
	Member
	// contains filtered or unexported fields
}

func (*Field) IsEnum

func (f *Field) IsEnum() bool

func (*Field) IsLongOrDouble

func (f *Field) IsLongOrDouble() bool

func (*Field) IsTransient

func (f *Field) IsTransient() bool

func (*Field) IsVolatile

func (f *Field) IsVolatile() bool

func (*Field) Match

func (f *Field) Match(name string, descriptor string) bool

func (*Field) SetStaticValue

func (f *Field) SetStaticValue(value interface{})

func (*Field) SlotIndex

func (f *Field) SlotIndex() uint

func (*Field) Type

func (f *Field) Type() *Class

type FieldRef

type FieldRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*FieldRef) ResolvedField

func (ref *FieldRef) ResolvedField() *Field

type Frame

type Frame struct {
	LocalVars    Slots
	OperandStack *OperandStack
	// contains filtered or unexported fields
}

func NewMockFrame

func NewMockFrame(thread *Thread, stack *OperandStack) *Frame

func (*Frame) Method

func (f *Frame) Method() *Method

func (*Frame) NextPc

func (f *Frame) NextPc() uint32

func (*Frame) RevertNextPc

func (f *Frame) RevertNextPc()

func (*Frame) SetNextPc

func (f *Frame) SetNextPc(nextPc uint32)

func (*Frame) Thread

func (f *Frame) Thread() *Thread

type InterfaceMethodRef

type InterfaceMethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*InterfaceMethodRef) ResolvedInterfaceMethod

func (ref *InterfaceMethodRef) ResolvedInterfaceMethod() *Method

type Member

type Member struct {
	AccessFlags uint16

	Signature      string
	AnnotationData []byte
	// contains filtered or unexported fields
}

func (*Member) Class

func (m *Member) Class() *Class

func (*Member) Descriptor

func (m *Member) Descriptor() string

func (*Member) IsAccessibleTo

func (m *Member) IsAccessibleTo(class *Class) bool

func (*Member) IsFinal

func (m *Member) IsFinal() bool

func (*Member) IsPrivate

func (m *Member) IsPrivate() bool

func (*Member) IsProtected

func (m *Member) IsProtected() bool

func (*Member) IsPublic

func (m *Member) IsPublic() bool

func (*Member) IsStatic

func (m *Member) IsStatic() bool

func (*Member) IsSynthetic

func (m *Member) IsSynthetic() bool

func (*Member) Name

func (m *Member) Name() string

type MemberRef

type MemberRef struct {
	SymbolicRef
	// contains filtered or unexported fields
}

func (*MemberRef) Descriptor

func (m *MemberRef) Descriptor() string

func (*MemberRef) Name

func (m *MemberRef) Name() string

type Method

type Method struct {
	Member

	MethodDescriptor        *MethodDescriptor
	Exceptions              []string
	ParameterAnnotationData []byte
	// contains filtered or unexported fields
}

func (*Method) ArgSlotCount

func (m *Method) ArgSlotCount() uint

func (*Method) Code

func (m *Method) Code() []byte

func (*Method) FindExceptionHandlerPc

func (m *Method) FindExceptionHandlerPc(exceptionClass *Class, pc uint32) uint32

func (*Method) GetLineNumber

func (m *Method) GetLineNumber(pc uint32) int

func (*Method) IsAbstract

func (m *Method) IsAbstract() bool

func (*Method) IsBridged

func (m *Method) IsBridged() bool

func (*Method) IsNative

func (m *Method) IsNative() bool

func (*Method) IsStrict

func (m *Method) IsStrict() bool

func (*Method) IsSynchronized

func (m *Method) IsSynchronized() bool

func (*Method) IsVarArgs

func (m *Method) IsVarArgs() bool

type MethodDescriptor

type MethodDescriptor struct {
	ParameterTypes []string
	ReturnType     string
}

func ParseMethodDescriptor

func ParseMethodDescriptor(method *Method) *MethodDescriptor

ParseMethodDescriptor (IDLjava/lang/String;[J)V

type MethodHandleInfo

type MethodHandleInfo struct {
}

type MethodRef

type MethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*MethodRef) ResolvedMethod

func (m *MethodRef) ResolvedMethod() *Method

type NameAndTypeInfo

type NameAndTypeInfo struct {
	Name       string
	Descriptor string
}

type Object

type Object struct {
	Data               interface{}
	Extra              interface{}
	StackTraceElements interface{}
	// contains filtered or unexported fields
}

func GetJString

func GetJString(loader *ClassLoader, goStr string) *Object

func InternString

func InternString(jString *Object) *Object

func NewByteArray

func NewByteArray(loader *ClassLoader, bytes []int8) *Object

func ToJavaClasses

func ToJavaClasses(classloader *ClassLoader, classNames []string, isDescriptor bool) *Object

func (*Object) ArrayLength

func (obj *Object) ArrayLength() int32

func (*Object) Booleans

func (obj *Object) Booleans() ArrayBoolean

func (*Object) Bytes

func (obj *Object) Bytes() ArrayByte

func (*Object) Chars

func (obj *Object) Chars() ArrayChar

func (*Object) Class

func (obj *Object) Class() *Class

func (*Object) Clone

func (obj *Object) Clone() *Object

func (*Object) Doubles

func (obj *Object) Doubles() ArrayDouble

func (*Object) Fields

func (obj *Object) Fields() Slots

func (*Object) Floats

func (obj *Object) Floats() ArrayFloat

func (*Object) GetField

func (obj *Object) GetField(name, descriptor string) *Field

func (*Object) GetFieldValue

func (obj *Object) GetFieldValue(name, descriptor string) interface{}

func (*Object) Ints

func (obj *Object) Ints() ArrayInt

func (*Object) IsInstanceOf

func (obj *Object) IsInstanceOf(class *Class) bool

func (*Object) Longs

func (obj *Object) Longs() ArrayLong

func (*Object) Refs

func (obj *Object) Refs() ArrayRef

func (*Object) SetFieldValue

func (obj *Object) SetFieldValue(name, descriptor string, value interface{})

func (*Object) Shorts

func (obj *Object) Shorts() ArrayShort

type OperandStack

type OperandStack struct {
	// contains filtered or unexported fields
}

func NewOperandStack

func NewOperandStack(maxStack uint16) *OperandStack

func (*OperandStack) Clear

func (s *OperandStack) Clear()

func (*OperandStack) GetRefFromTop

func (s *OperandStack) GetRefFromTop(index uint16) *Object

func (*OperandStack) PeekSlot

func (s *OperandStack) PeekSlot() Slot

func (*OperandStack) PopBoolean

func (s *OperandStack) PopBoolean() bool

func (*OperandStack) PopDouble

func (s *OperandStack) PopDouble() float64

func (*OperandStack) PopFloat

func (s *OperandStack) PopFloat() float32

func (*OperandStack) PopInt

func (s *OperandStack) PopInt() int32

func (*OperandStack) PopLong

func (s *OperandStack) PopLong() int64

func (*OperandStack) PopRef

func (s *OperandStack) PopRef() *Object

func (*OperandStack) PopSlot

func (s *OperandStack) PopSlot() Slot

func (*OperandStack) PushBoolean

func (s *OperandStack) PushBoolean(val bool)

func (*OperandStack) PushDouble

func (s *OperandStack) PushDouble(val float64)

func (*OperandStack) PushFloat

func (s *OperandStack) PushFloat(val float32)

func (*OperandStack) PushInt

func (s *OperandStack) PushInt(val int32)

func (*OperandStack) PushLong

func (s *OperandStack) PushLong(val int64)

func (*OperandStack) PushRef

func (s *OperandStack) PushRef(ref *Object)

func (*OperandStack) PushSlot

func (s *OperandStack) PushSlot(slot Slot)

type Slot

type Slot struct {
	// contains filtered or unexported fields
}

type Slots

type Slots []Slot

func (Slots) GetBoolean

func (slots Slots) GetBoolean(index uint) bool

func (Slots) GetDouble

func (slots Slots) GetDouble(index uint) float64

func (Slots) GetFloat

func (slots Slots) GetFloat(index uint) float32

func (Slots) GetInt

func (slots Slots) GetInt(index uint) int32

func (Slots) GetLong

func (slots Slots) GetLong(index uint) int64

func (Slots) GetRef

func (slots Slots) GetRef(index uint) *Object

func (Slots) GetThis

func (slots Slots) GetThis() *Object

func (Slots) SetBoolean

func (slots Slots) SetBoolean(index uint, val bool)

func (Slots) SetDouble

func (slots Slots) SetDouble(index uint, val float64)

func (Slots) SetFloat

func (slots Slots) SetFloat(index uint, val float32)

func (Slots) SetInt

func (slots Slots) SetInt(index uint, val int32)

func (Slots) SetLong

func (slots Slots) SetLong(index uint, val int64)

func (Slots) SetRef

func (slots Slots) SetRef(index uint, ref *Object)

func (Slots) SetSlot

func (slots Slots) SetSlot(index uint, slot Slot)

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func (*Stack) Clear

func (stack *Stack) Clear()

func (*Stack) GetFrames

func (stack *Stack) GetFrames() []*Frame

func (*Stack) Size

func (stack *Stack) Size() uint

type SymbolicRef

type SymbolicRef struct {
	// contains filtered or unexported fields
}

func (*SymbolicRef) ResolvedClass

func (ref *SymbolicRef) ResolvedClass() *Class

type Thread

type Thread struct {
	ExitCode int
	// contains filtered or unexported fields
}

func NewThread

func NewThread() *Thread

func (*Thread) ClearStack

func (t *Thread) ClearStack()

func (*Thread) CurrentFrame

func (t *Thread) CurrentFrame() *Frame

func (*Thread) GetFrames

func (t *Thread) GetFrames() []*Frame

func (*Thread) IsStackEmpty

func (t *Thread) IsStackEmpty() bool

func (*Thread) NewFrame

func (t *Thread) NewFrame(method *Method) *Frame

func (*Thread) Pc

func (t *Thread) Pc() uint32

func (*Thread) PopFrame

func (t *Thread) PopFrame() *Frame

func (*Thread) PushFrame

func (t *Thread) PushFrame(frame *Frame)

func (*Thread) SetPc

func (t *Thread) SetPc(pc uint32)

func (*Thread) StackSize

func (t *Thread) StackSize() uint

type Utf8Info

type Utf8Info struct {
	Val string
}

Jump to

Keyboard shortcuts

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