// NewProgram returns a new running program created from the given elf binary
// file and instantiation command 'target args...'. The list of regions
// specifies which regions in the target to track. When Wait is called, it will
// block until the target process or one of its threads/children begins or
// finishes executing a region.
NewProgram returns a new running program created from the given elf binary
file and instantiation command 'target args...'. The list of regions
specifies which regions in the target to track. When Wait is called, it will
block until the target process or one of its threads/children begins or
finishes executing a region.
// NewProgram returns a new running program created from the given elf binary // file and instantiation command ' target args ... ' . The list of regions // specifies which regions in the target to track . When Wait is called it will // block until the target process or one of its threads / children begins or // finishes executing a region .
func NewProgram(pie PieOffsetter, target string, args []string, regions []Region) (*Program, int, error) {
	proc, err := startProc(pie, target, args, regions)
	if err != nil {
		return nil, 0, err
	}
	prog := new(Program)
	prog.procs = map[int]*Proc{
		proc.Pid(): proc,
	}
	prog.regions = regions
	prog.pie = pie
	prog.breakpoints = make(map[uintptr][]byte)
	for k, v := range proc.breakpoints {
		prog.breakpoints[k] = make([]byte, len(v))
		copy(prog.breakpoints[k], v)
	}
	return prog, proc.Pid(), err
}
func NewProgram ( pie PieOffsetter , target string , args [ ] string , regions [ ] Region ) ( * Program , int , error ) { proc , err := startProc ( pie , target , args , regions ) if err != nil { return nil , 0 , err } prog := new ( Program ) prog . procs = map [ int ] * Proc { proc . Pid ( ) : proc , } prog . regions = regions prog . pie = pie prog . breakpoints = make ( map [ uintptr ] [ ] byte ) for k , v := range proc . breakpoints { prog . breakpoints [ k ] = make ( [ ] byte , len ( v ) ) copy ( prog . breakpoints [ k ] , v ) } return prog , proc . Pid ( ) , err }
NewProgram returns a new running program created from the given elf binary
file and instantiation command 'target args...'.
NewProgram returns a new running program created from the given elf binary file and instantiation command ' target args ... ' .