Documentation
¶
Index ¶
- Constants
- Variables
- func AllPrograms(db *gorm.DB) []string
- func DeleteProgram(db *gorm.DB, program string)
- func ExactSearchVariable(DB *gorm.DB, mod int, value string) chan int64
- func GetDB() *gorm.DB
- func GetIrSourceFromHash(hash string) (*memedit.MemEditor, error)
- func GetType(id int) (int, string, string, error)
- func GlobSearchVariable(DB *gorm.DB, mod int, value string) chan int64
- func RegexpSearchVariable(DB *gorm.DB, mod int, value string) chan int64
- func SaveClassInstance(db *gorm.DB, program, class string, instIDs []int64) error
- func SaveIrSource(editor *memedit.MemEditor, hash string) error
- func SaveType(kind int, str string, extra string) int
- func SaveVariable(db *gorm.DB, program, variable string, insts []SSAValue) error
- func YieldIrCodesProgramName(db *gorm.DB, ctx context.Context, program string) chan *IrCode
- type Int64Map
- type Int64Slice
- type IrCode
- func (r *IrCode) GetExtraInfo() map[string]any
- func (r *IrCode) GetIdInt() int
- func (r *IrCode) GetIdInt64() int64
- func (r *IrCode) GetSourceCode(db *gorm.DB) string
- func (r *IrCode) GetSourceCodeContext(db *gorm.DB, n int) string
- func (r *IrCode) GetStartAndEndPositions(db *gorm.DB) (*memedit.MemEditor, memedit.PositionIf, memedit.PositionIf, error)
- func (r *IrCode) IsEmptySourceCodeHash() bool
- func (r *IrCode) SetExtraInfo(params map[string]any)
- func (i *IrCode) Show()
- func (i *IrCode) VerboseString() string
- type IrScopeNode
- type IrSource
- type IrType
- type IrVariable
- type SSAValue
- type StringSlice
Constants ¶
View Source
const ( NameMatch int = 1 KeyMatch = 1 << 1 BothMatch = NameMatch | KeyMatch )
type MatchMode int
Variables ¶
View Source
var SSAProjectTables = []any{ &IrCode{}, &IrVariable{}, &IrScopeNode{}, &IrSource{}, &IrType{}, }
Functions ¶
func AllPrograms ¶
func DeleteProgram ¶
func ExactSearchVariable ¶ added in v1.3.3
func GetIrSourceFromHash ¶ added in v1.3.3
GetIrSourceFromHash fetch editor from cache by hash(md5)
func GlobSearchVariable ¶ added in v1.3.3
func RegexpSearchVariable ¶ added in v1.3.3
func SaveClassInstance ¶
func SaveVariable ¶
Types ¶
type Int64Slice ¶
type Int64Slice []int64
Int64Slice 是一个自定义类型,用于处理 []int64 的序列化和反序列化
func (*Int64Slice) Scan ¶
func (us *Int64Slice) Scan(value interface{}) error
Scan 实现了 sql.Scanner 接口,允许从数据库读取值时将其转换回 Int64Slice 类型
type IrCode ¶
type IrCode struct { gorm.Model ProgramName string `json:"program_name" gorm:"index"` PackageName string `json:"package_name" gorm:"index"` // source code SourceCodeStartOffset int64 `json:"source_code_start_offset"` SourceCodeEndOffset int64 `json:"source_code_end_offset"` SourceCodeHash string `json:"source_code_hash"` // default md5 // opcode Opcode int64 `json:"opcode"` OpcodeName string `json:"opcode_name"` // just for binary and unary operator OpcodeOperator string `json:"opcode_operator"` // basic info Name string `json:"name"` VerboseName string `json:"verbose_name"` ShortVerboseName string `json:"short_verbose_name"` String string `json:"string"` // any IrCode in one block inner one function CurrentBlock int64 `json:"current_block"` CurrentFunction int64 `json:"current_function"` // FunctionDefs IsFunction bool `json:"is_function"` FormalArgs Int64Slice `json:"formal_args" gorm:"type:text"` FreeValues Int64Slice `json:"free_values" gorm:"type:text"` MemberCallArgs Int64Slice `json:"formal_member_call_args" gorm:"type:text"` SideEffects Int64Slice `json:"side_effects" gorm:"type:text"` IsVariadic bool `json:"is_variadic"` ReturnCodes Int64Slice `json:"return_codes" gorm:"type:text"` IsExternal bool `json:"is_external"` CodeBlocks Int64Slice `json:"code_blocks" gorm:"type:text"` EnterBlock int64 `json:"enter_block"` ExitBlock int64 `json:"exit_block"` DeferBlock int64 `json:"defer_block"` ChildrenFunction Int64Slice `json:"children_function" gorm:"type:text"` ParentFunction int64 `json:"parent_function"` // block IsBlock bool `json:"is_block"` PredBlock Int64Slice `json:"pred_block" gorm:"type:text"` SuccBlock Int64Slice `json:"succ_block" gorm:"type:text"` Phis Int64Slice `json:"phis_in_block" gorm:"type:text"` // Use-Def Chains Relation Defs Int64Slice `json:"defs" gorm:"type:text"` Users Int64Slice `json:"users" gorm:"type:text"` // this is user is call and method is this IR self CalledBy Int64Slice `json:"is_called_by" gorm:"type:text"` // OOP Supporting IsObject bool ObjectMembers Int64Map `json:"object_members" gorm:"type:text"` IsObjectMember bool ObjectParent int64 `json:"object_parent"` ObjectKey int64 `json:"object_key"` // Maskable MaskedCodes Int64Slice `json:"masked_codes" gorm:"type:text"` IsMasked bool `json:"is_masked"` // Variable Variable StringSlice `json:"variable" gorm:"type:text"` // compile hash means: hash[ (file-content)+(program-name)+(package-name)+(program-index) ] ProgramCompileHash string `json:"program_compile_hash" gorm:"index"` // type TypeId int `json:"type_id"` // reference Reference Int64Slice `json:"reference" gorm:"type:text"` // not important information ExtraInformation string `json:"extra_information"` }
func (*IrCode) GetExtraInfo ¶ added in v1.3.3
func (*IrCode) GetIdInt64 ¶ added in v1.3.3
func (*IrCode) GetSourceCodeContext ¶ added in v1.3.3
func (*IrCode) GetStartAndEndPositions ¶ added in v1.3.3
func (r *IrCode) GetStartAndEndPositions(db *gorm.DB) (*memedit.MemEditor, memedit.PositionIf, memedit.PositionIf, error)
func (*IrCode) IsEmptySourceCodeHash ¶ added in v1.3.3
func (*IrCode) SetExtraInfo ¶ added in v1.3.3
func (*IrCode) VerboseString ¶ added in v1.3.3
type IrScopeNode ¶ added in v1.3.3
type IrScopeNode struct { gorm.Model ProgramName string `json:"program_name" gorm:"index"` ParentNodeId int64 `json:"parent_node_id" gorm:"index"` ChildrenNodes Int64Slice `json:"children" gorm:"type:text"` ExtraInfo string `json:"extraInfo"` }
func GetIrScope ¶ added in v1.3.3
func GetIrScope(id int64) (*IrScopeNode, error)
func RequireScopeNode ¶ added in v1.3.3
func RequireScopeNode() (int64, *IrScopeNode)
type IrType ¶
type IrType struct { gorm.Model Kind int `json:"kind"` String string `json:"string"` ExtraInformation string `json:"extra_information"` Hash string `json:"hash" gorm:"unique_index"` }
func (*IrType) BeforeCreate ¶
func (*IrType) BeforeSave ¶
func (*IrType) BeforeUpdate ¶
type IrVariable ¶
type IrVariable struct { gorm.Model ProgramName string `json:"program_name" gorm:"index"` VariableName string `json:"variable_name" gorm:"index"` IsClassInstance bool `json:"is_class_instance"` IsAnnotationInstance bool `json:"is_annotation_instance"` // OOP Index ObjectID int64 `json:"object_id" gorm:"index"` SliceMemberName string `json:"slice_member_name" gorm:"index"` FieldMemberName string `json:"field_member_name" gorm:"index"` InstructionID Int64Slice `json:"instruction_id" gorm:"type:text"` }
func GetVariable ¶ added in v1.3.3
func GetVariable(db *gorm.DB, program, variable string) (*IrVariable, error)
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Scan ¶
func (ss *StringSlice) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.