You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: target_exec.go
    path of file: ./repos/delve/pkg/proc
    
    the code of the file until where you have to start completion: package proc

import (
	"bytes"
	"debug/dwarf"
	"errors"
	"fmt"
	"go/ast"
	"go/token"
	"path/filepath"
	"strings"

	"golang.org/x/arch/ppc64/ppc64asm"

	"github.com/go-delve/delve/pkg/astutil"
	"github.com/go-delve/delve/pkg/dwarf/reader"
	"github.com/go-delve/delve/pkg/logflags"
)

const maxSkipAutogeneratedWrappers = 5 // maximum recursion depth for skipAutogeneratedWrappers

// ErrNoSourceForPC is returned when the given address
// does not correspond with a source file location.
type ErrNoSourceForPC struct {
	pc uint64
}

func (err *ErrNoSourceForPC) Error() string {
	return fmt.Sprintf("no source for PC %#x", err.pc)
}

// Next resumes the processes in the group, continuing the selected target
// until the next source line.
func (grp *TargetGroup) Next() (err error) {
	if _, err := grp.Valid(); err != nil {
		return err
	}
	if grp.HasSteppingBreakpoints() {
		return fmt.Errorf("next while nexting")
	}

	if err = next(grp.Selected, false, false); err != nil {
		grp.Selected.ClearSteppingBreakpoints()
		return
	}

	return grp.Continue()
}

// Continue continues execution of the debugged
// processes. It will continue until it hits a breakpoint
// or is otherwise stopped.
func (grp *TargetGroup) Continue() error {
	if grp.numValid() == 0 {
		_, err := grp.targets[0].Valid()
		return err
	}
	for _, dbp := range grp.targets {
		if isvalid, _ := dbp.Valid(); !isvalid {
			continue
		}
		for _, thread := range dbp.ThreadList() {
			thread.Common().CallReturn = false
			thread.Common().returnValues = nil
		}
		dbp.Breakpoints().WatchOutOfScope = nil
		dbp.clearHardcodedBreakpoints()
	}
	grp.cctx.CheckAndClearManualStopRequest()
	defer func() {
		// Make sure we clear internal breakpoints if we simultaneously receive a
		// manual stop request and hit a breakpoint.
		if grp.cctx.CheckAndClearManualStopRequest() {
			grp.finishManualStop()
		}
	}()
	for {
		if grp.cctx.CheckAndClearManualStopRequest() {
			grp.finishManualStop()
			return nil
		}
		for _, dbp := range grp.targets {
			dbp.ClearCaches()
		}
		logflags.DebuggerLogger().Debugf("ContinueOnce")
		trapthread, stopReason, contOnceErr := grp.procgrp.ContinueOnce(grp.cctx)
		var traptgt *Target
		if trapthread != nil {
			traptgt = grp.TargetForThread(trapthread.ThreadID())
			if traptgt == nil {
				return fmt.Errorf("could not find target for thread %d", trapthread.ThreadID())
			}
		} else {
			traptgt = grp.targets[0]
		}
		traptgt.StopReason = stopReason

		it := ValidTargets{Group: grp}
		for it.Next() {
			// Both selectedGoroutine and current thread are stale here, since we can
			// only set their definitive value *after* evaluating breakpoint
			// conditions here we give them temporary non-stale values.
			it.selectedGoroutine = nil
			curthread := it.currentThread
			for _, thread := range it.ThreadList() {
				if thread.Breakpoint().Breakpoint != nil {
					it.currentThread = thread
					thread.Breakpoint().Breakpoint.checkCondition(it.Target, thread, thread.Breakpoint())
				}
			}
			it.currentThread = curthread
		}

		if contOnceErr != nil {
			// Attempt to refresh status of current thread/current goroutine, see
			// Issue #2078.
			// Errors are ignored because dep
    
func (grp *TargetGroup) Continue() error {
	if grp.numValid() == 0 {
		_, err := grp.targets[0].Valid()
		return err
	}
	for _, dbp := range grp.targets {
		if isvalid, _ := dbp.Valid(); !isvalid {
			continue
		}
		for _, thread := range dbp.ThreadList() {
			thread.Common().CallReturn = false
			thread.Common().returnValues = nil
		}
		dbp.Breakpoints().WatchOutOfScope = nil
		dbp.clearHardcodedBreakpoints()
	}
	grp.cctx.CheckAndClearManualStopRequest()
	defer func() {
		// Make sure we clear internal breakpoints if we simultaneously receive a
		// manual stop request and hit a breakpoint.
		if grp.cctx.CheckAndClearManualStopRequest() {
			grp.finishManualStop()
		}
	}()
	for {
		if grp.cctx.CheckAndClearManualStopRequest() {
			grp.finishManualStop()
			return nil
		}
		for _, dbp := range grp.targets {
			dbp.ClearCaches()
		}
		logflags.DebuggerLogger().Debugf("ContinueOnce")
		trapthread, stopReason, contOnceErr := grp.procgrp.ContinueOnce(grp.cctx)
		var traptgt *Target
		if trapthread != nil {
			traptgt = grp.TargetForThread(trapthread.ThreadID())
			if traptgt == nil {
				return fmt.Errorf("could not find target for thread %d", trapthread.ThreadID())
			}
		} else {
			traptgt = grp.targets[0]
		}
		traptgt.StopReason = stopReason

		it := ValidTargets{Group: grp}
		for it.Next() {
			// Both selectedGoroutine and current thread are stale here, since we can
			// only set their definitive value *after* evaluating breakpoint
			// conditions here we give them temporary non-stale values.
			it.selectedGoroutine = nil
			curthread := it.currentThread
			for _, thread := range it.ThreadList() {
				if thread.Breakpoint().Breakpoint != nil {
					it.currentThread = thread
					thread.Breakpoint().Breakpoint.checkCondition(it.Target, thread, thread.Breakpoint())
				}
			}
			it.currentThread = curthread
		}

		if contOnceErr != nil {
			// Attempt to refresh status of current thread/current goroutine, see
			// Issue #2078.
			// Errors are ignored because depending on why ContinueOnce failed this
			// might very well not work.
			_ = grp.setCurrentThreads(traptgt, trapthread)
			if pe, ok := contOnceErr.(ErrProcessExited); ok {
				traptgt.exitStatus = pe.Status
			}
			return contOnceErr
		}
		if stopReason == StopLaunched {
			it.Reset()
			for it.Next() {
				it.Target.ClearSteppingBreakpoints()
			}
		}

		var callInjectionDone bool
		var callErr error
		var hcbpErr error
		it.Reset()
		for it.Next() {
			dbp := it.Target
			threads := dbp.ThreadList()
			if logflags.Debugger() {
				log := logflags.DebuggerLogger()
				log.Debugf("callInjection protocol on:")
				for _, th := range threads {
					regs, _ := th.Registers()
					log.Debugf("\t%d PC=%#x", th.ThreadID(), regs.PC())
				}
			}
			callInjectionDoneThis, callErrThis := callInjectionProtocol(dbp, threads)
			callInjectionDone = callInjectionDone || callInjectionDoneThis
			if callInjectionDoneThis {
				dbp.StopReason = StopCallReturned
			}
			if callErrThis != nil && callErr == nil {
				callErr = callErrThis
			}
			hcbpErrThis := dbp.handleHardcodedBreakpoints(grp, trapthread, threads)
			if hcbpErrThis != nil && hcbpErr == nil {
				hcbpErr = hcbpErrThis
			}
		}
		// callErr and hcbpErr check delayed until after pickCurrentThread, which
		// must always happen, otherwise the debugger could be left in an
		// inconsistent state.

		it = ValidTargets{Group: grp}
		for it.Next() {
			var th Thread = nil
			if it.Target == traptgt {
				th = trapthread
			}
			err := pickCurrentThread(it.Target, th)
			if err != nil {
				return err
			}
		}
		grp.pickCurrentTarget(traptgt)
		dbp := grp.Selected

		if callErr != nil {
			return callErr
		}
		if hcbpErr != nil {
			return hcbpErr
		}

		curthread := dbp.CurrentThread()
		curbp := curthread.Breakpoint()

		switch {
		case curbp.Active && curbp.Stepping:
			if curbp.SteppingInto {
				// See description of proc.(*Process).next for the meaning of StepBreakpoints
				if err := conditionErrors(grp); err != nil {
					return err
				}
				if grp.GetDirection() == Backward {
					if err := dbp.ClearSteppingBreakpoints(); err != nil {
						return err
					}
					return grp.StepInstruction(false)
				}
			} else {
				curthread.Common().returnValues = curbp.Breakpoint.returnInfo.Collect(dbp, curthread)
				if err := dbp.ClearSteppingBreakpoints(); err != nil {
					return err
				}
				dbp.StopReason = StopNextFinished
				return conditionErrors(grp)
			}
		case curbp.Active:
			onNextGoroutine, err := onNextGoroutine(dbp, curthread, dbp.Breakpoints())
			if err != nil {
				return err
			}
			if onNextGoroutine &&
				(!isTraceOrTraceReturn(curbp.Breakpoint) || grp.KeepSteppingBreakpoints&TracepointKeepsSteppingBreakpoints == 0) {
				err := dbp.ClearSteppingBreakpoints()
				if err != nil {
					return err
				}
			}
			if curbp.LogicalID() == unrecoveredPanicID {
				dbp.ClearSteppingBreakpoints()
			}
			if curbp.LogicalID() != hardcodedBreakpointID {
				dbp.StopReason = StopBreakpoint
			}
			if curbp.Breakpoint.WatchType != 0 {
				dbp.StopReason = StopWatchpoint
			}
			return conditionErrors(grp)
		case stopReason == StopLaunched:
			return nil
		default:
			// not a manual stop, not on runtime.Breakpoint, not on a breakpoint, just repeat
		}
		if callInjectionDone {
			// a call injection was finished, don't let a breakpoint with a failed
			// condition or a step breakpoint shadow this.
			return conditionErrors(grp)
		}
	}
}