├── .cirrus.yml ├── .gitattributes ├── .gitignore ├── .teamcity ├── pom.xml └── settings.kts ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Documentation ├── EditorIntegration.md ├── KnownBugs.md ├── README.md ├── api │ ├── ClientHowto.md │ ├── README.md │ ├── dap │ │ └── README.md │ └── json-rpc │ │ └── README.md ├── backend_test_health.md ├── cli │ ├── README.md │ ├── cond.md │ ├── expr.md │ ├── getting_started.md │ ├── locspec.md │ ├── starlark.md │ └── substitutepath.md ├── faq.md ├── installation │ ├── README.md │ ├── freebsd │ │ └── install.md │ ├── linux │ │ └── install.md │ ├── osx │ │ └── install.md │ └── windows │ │ └── install.md ├── internal │ ├── README.md │ └── portnotes.md └── usage │ ├── README.md │ ├── dlv.md │ ├── dlv_attach.md │ ├── dlv_backend.md │ ├── dlv_connect.md │ ├── dlv_core.md │ ├── dlv_dap.md │ ├── dlv_debug.md │ ├── dlv_exec.md │ ├── dlv_log.md │ ├── dlv_redirect.md │ ├── dlv_replay.md │ ├── dlv_run.md │ ├── dlv_test.md │ ├── dlv_trace.md │ └── dlv_version.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── Makefile ├── README.md ├── _fixtures ├── amend_breakpoint.star ├── asmnilptr │ ├── main.go │ ├── main_386.s │ ├── main_amd64.s │ ├── main_arm64.s │ ├── main_loong64.s │ ├── main_ppc64le.s │ └── main_riscv64.s ├── backwardsiter.go ├── badflags.go ├── binarytrees.go ├── bpcountstest.go ├── bpfile ├── bphitcountchain.go ├── break.go ├── break │ ├── break_amd64.s │ └── main.go ├── buildflagtest.go ├── buildtest │ ├── main.go │ └── main_test.go ├── callme.go ├── cat.go ├── cgodisass.go ├── cgosigsegvstack.go ├── cgostacktest │ ├── hello.c │ ├── hello.h │ └── main.go ├── cgotest.go ├── chain_breakpoints.star ├── changoroutines.go ├── clientdo.go ├── closurecontents.go ├── condframe.go ├── condperghitcount.go ├── consts.go ├── continuetestprog.go ├── coreemptystring.go ├── create_breakpoint_main.star ├── databpcountstest.go ├── databpeasy.go ├── databpstack.go ├── debug_line_benchmark_data ├── debug_line_c_data ├── decllinetest.go ├── defercall.go ├── deferstack.go ├── dotpackagesiface.go ├── doubleinline.go ├── dwzcompression.go ├── ebpf_trace.go ├── ebpf_trace2.go ├── ebpf_trace3.go ├── echo_expr.star ├── examinememory.go ├── exit.init ├── fatalerror.go ├── find_array.star ├── fncall.go ├── fputest │ ├── fputest.go │ └── fputest_amd64.s ├── genericbp.go ├── genericintoiface.go ├── goroutineLabels.go ├── goroutine_start_line.star ├── goroutinebreak.go ├── goroutinegroup.go ├── goroutines-trace.go ├── goroutinestackprog.go ├── hcbpcountstest.go ├── http_server.go ├── ifaceembcall.go ├── increment.go ├── inlinestripped.go ├── integrationprog.go ├── internal │ ├── dir.io │ │ ├── dir.go │ │ └── io.io │ │ │ └── io.go │ ├── dir0 │ │ ├── pkg │ │ │ └── main.go │ │ └── renamedpackage │ │ │ └── main.go │ ├── dir1 │ │ └── pkg │ │ │ └── main.go │ └── pluginsupport │ │ └── pluginsupport.go ├── is sue239.go ├── issue1101.go ├── issue1264.go ├── issue1374.go ├── issue1432.go ├── issue1469.go ├── issue1531.go ├── issue1549.go ├── issue1598.go ├── issue1601.go ├── issue1615.go ├── issue1656 │ ├── main.go │ └── main.s ├── issue1795.go ├── issue1817.go ├── issue2023.go ├── issue2078.go ├── issue2086.go ├── issue2113.go ├── issue2138.go ├── issue2162.go ├── issue2319 │ ├── README.txt │ ├── asm-linux-amd64.s │ ├── cfile-linux-amd64.syso │ └── main.go ├── issue262.go ├── issue2896.go ├── issue305.go ├── issue3194.go ├── issue3310.go ├── issue332.go ├── issue3548.go ├── issue384.go ├── issue387.go ├── issue406.go ├── issue419.go ├── issue528.go ├── issue561.go ├── issue573.go ├── issue594.go ├── issue664.go ├── issue683.go ├── issue871.go ├── issue877.go ├── issue951.go ├── leaf4.go ├── leafcommon.go ├── leafindrec.go ├── leafrec.go ├── leafregex.go ├── linked_list.star ├── livetestprog.go ├── locationsUpperCase.go ├── locationsprog.go ├── locationsprog2.go ├── locationsprog3.go ├── locationsprog_generic.go ├── longstrings.go ├── loopprog.go ├── math.go ├── morestringarg.go ├── nextcond.go ├── nilptr.go ├── nodisasm │ ├── main.go │ └── nodisasm_amd64.s ├── nomaindir │ └── file.go ├── nopbreakpoint │ ├── main.go │ └── main.s ├── notify-v2.go ├── out_redirect.go ├── panic.go ├── panicex.go ├── panicline.go ├── parallel_next.go ├── pkgrenames.go ├── plugin1 │ └── plugin1.go ├── plugin2 │ └── plugin2.go ├── plugintest.go ├── plugintest2.go ├── pr1055.go ├── rangeoverfunc.go ├── redirect-input.txt ├── redirect.go ├── reflecttypefncall.go ├── restartargs.go ├── retstack.go ├── scopeescapevareval.go ├── scopetest.go ├── setiterator.go ├── setymmreg │ ├── main.go │ └── setymmreg_amd64.s ├── sigchldprog.go ├── sleep.go ├── spawn.go ├── spawnchild.go ├── stacktraceprog.go ├── stackwatchbug.go ├── starlark_map_iteration.star ├── stepintobug.go ├── stepoutret.go ├── stepshadow.go ├── switch_to_main_goroutine.star ├── test if path │ └── main.go ├── test.c ├── testargs.go ├── testdeadlock.go ├── testenv.go ├── testfnpos1.go ├── testfnpos2.go ├── testinline.go ├── testnextdefer.go ├── testnextnethttp.go ├── testnextprog.go ├── testprog.go ├── testrerecord.go ├── testreturnaddress.go ├── testruntimebreakpoint.go ├── testshadow.go ├── teststep.go ├── teststepconcurrent.go ├── teststepprog.go ├── testthreads.go ├── testtoggle.go ├── testtracefns.go ├── testunsafepointers.go ├── testvariables.go ├── testvariables2.go ├── testvariables_generic.go ├── testvariables_pointers_not_loaded.go ├── testvariablescgo │ ├── test.c │ └── testvariablescgo.go ├── traceperf.go ├── traceprog.go ├── watchpointInterface.go ├── watchpointInterfaceNil.go ├── workdir.go ├── xmm0print │ ├── main.go │ └── main.s └── zdebug_line_dwarf4 ├── _scripts ├── gen-backend_test_health.go ├── gen-cli-docs.go ├── gen-faq-toc.go ├── gen-opcodes.go ├── gen-starlark-bindings.go ├── gen-suitablemethods.go ├── gen-travis.go ├── gen-usage-docs.go ├── gencert.sh ├── latestver.py ├── make.go ├── rtype-out.txt ├── rtype.go ├── staticcheck-out.txt ├── test_linux.sh ├── test_mac.sh ├── test_windows.ps1 └── testsign ├── assets ├── delve_horizontal.png ├── delve_horizontal_2x.png ├── delve_icon.png └── delve_icon_2x.png ├── cmd └── dlv │ ├── cmds │ ├── cmds_test.go │ ├── commands.go │ └── helphelpers │ │ └── help.go │ ├── dlv_test.go │ ├── main.go │ └── tools.go ├── go.mod ├── go.sum ├── pkg ├── astutil │ └── astutil.go ├── config │ ├── config.go │ ├── split.go │ └── split_test.go ├── dwarf │ ├── dwarfbuilder │ │ ├── builder.go │ │ ├── info.go │ │ └── loc.go │ ├── frame │ │ ├── entries.go │ │ ├── entries_test.go │ │ ├── parser.go │ │ ├── parser_test.go │ │ ├── table.go │ │ └── testdata │ │ │ └── frame │ ├── godwarf │ │ ├── addr.go │ │ ├── buf.go │ │ ├── fakes.go │ │ ├── sections.go │ │ ├── tree.go │ │ ├── tree_test.go │ │ └── type.go │ ├── leb128 │ │ ├── decode.go │ │ ├── decode_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ └── encode_test.go │ ├── line │ │ ├── _testdata │ │ │ └── debug.grafana.debug.gz │ │ ├── line_parser.go │ │ ├── line_parser_test.go │ │ ├── parse_util.go │ │ ├── state_machine.go │ │ └── state_machine_test.go │ ├── loclist │ │ ├── dwarf2_loclist.go │ │ ├── dwarf5_loclist.go │ │ └── loclist5_test.go │ ├── op │ │ ├── op.go │ │ ├── op_test.go │ │ ├── opcodes.go │ │ ├── opcodes.table │ │ └── regs.go │ ├── parseutil.go │ ├── parseutil_test.go │ ├── reader │ │ ├── reader.go │ │ └── variables.go │ └── regnum │ │ ├── amd64.go │ │ ├── arm64.go │ │ ├── i386.go │ │ ├── loong64.go │ │ ├── ppc64le.go │ │ └── riscv64.go ├── elfwriter │ ├── delve_core_notes.go │ └── writer.go ├── gobuild │ ├── defaultexe.go │ ├── gobuild.go │ └── gobuild_test.go ├── goversion │ ├── compat.go │ ├── go_version.go │ └── version_test.go ├── internal │ └── gosym │ │ ├── additions.go │ │ ├── pclntab.go │ │ └── symtab.go ├── locspec │ ├── doc.go │ ├── locations.go │ └── locations_test.go ├── logflags │ ├── logflags.go │ ├── logflags_test.go │ └── logger.go ├── proc │ ├── amd64_arch.go │ ├── amd64_disasm.go │ ├── amd64util │ │ ├── debugregs.go │ │ └── xsave.go │ ├── arch.go │ ├── arm64_arch.go │ ├── arm64_disasm.go │ ├── bininfo.go │ ├── breakpoints.go │ ├── core │ │ ├── core.go │ │ ├── core_test.go │ │ ├── delve_core.go │ │ ├── linux_core.go │ │ ├── minidump │ │ │ ├── fileflags_string.go │ │ │ └── minidump.go │ │ └── windows_amd64_minidump.go │ ├── debuginfod │ │ └── debuginfod.go │ ├── disasm.go │ ├── doc.go │ ├── dump.go │ ├── dwarf_export_test.go │ ├── dwarf_expr_test.go │ ├── eval.go │ ├── evalop │ │ ├── evalcompile.go │ │ ├── evalop_test.go │ │ └── ops.go │ ├── fbsdutil │ │ └── regs.go │ ├── fncall.go │ ├── gdbserial │ │ ├── gdbserver.go │ │ ├── gdbserver_conn.go │ │ ├── gdbserver_unix.go │ │ ├── gdbserver_windows.go │ │ ├── rr.go │ │ └── rr_test.go │ ├── goroutine_cache.go │ ├── i386_arch.go │ ├── i386_disasm.go │ ├── interface.go │ ├── internal │ │ └── ebpf │ │ │ ├── bpf │ │ │ ├── dummy.go │ │ │ ├── include │ │ │ │ ├── dummy.go │ │ │ │ ├── function_vals.bpf.h │ │ │ │ ├── trace.bpf.h │ │ │ │ └── vmlinux.h │ │ │ └── trace.bpf.c │ │ │ ├── build │ │ │ ├── build-ebpf-builder-img.sh │ │ │ ├── build-ebpf-objects.sh │ │ │ └── ebpf-Dockerfile │ │ │ ├── context.go │ │ │ ├── dummy.go │ │ │ ├── helpers.go │ │ │ ├── helpers_disabled.go │ │ │ ├── helpers_test.go │ │ │ ├── testhelper │ │ │ └── testhelper.go │ │ │ ├── trace_bpfel_x86.go │ │ │ └── trace_bpfel_x86.o │ ├── linutil │ │ ├── auxv.go │ │ ├── doc.go │ │ ├── dynamic.go │ │ ├── regs_amd64_arch.go │ │ ├── regs_arm64_arch.go │ │ ├── regs_i386_arch.go │ │ ├── regs_loong64_arch.go │ │ ├── regs_ppc64le_arch.go │ │ └── regs_riscv64_arch.go │ ├── loong64_arch.go │ ├── loong64_disasm.go │ ├── macutil │ │ ├── rosetta_darwin.go │ │ └── rosetta_other.go │ ├── mapiter.go │ ├── mem.go │ ├── moduledata.go │ ├── native │ │ ├── cpuid │ │ │ ├── xsave_x86.go │ │ │ └── xsave_x86.s │ │ ├── dump_freebsd.go │ │ ├── dump_linux.go │ │ ├── dump_linux_amd64.go │ │ ├── dump_linux_other.go │ │ ├── dump_other.go │ │ ├── dump_windows_amd64.go │ │ ├── exc.h │ │ ├── exc_user_darwin.c │ │ ├── exec_darwin.c │ │ ├── exec_darwin.h │ │ ├── followexec_other.go │ │ ├── hwbreak_amd64.go │ │ ├── hwbreak_other.go │ │ ├── mach_exc.h │ │ ├── mach_exc_user_darwin.c │ │ ├── nonative_darwin.go │ │ ├── proc.go │ │ ├── proc_darwin.c │ │ ├── proc_darwin.go │ │ ├── proc_darwin.h │ │ ├── proc_ebpf_linux.go │ │ ├── proc_freebsd.go │ │ ├── proc_linux.go │ │ ├── proc_no_ebpf_linux.go │ │ ├── proc_unix.go │ │ ├── proc_windows.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_freebsd.go │ │ ├── ptrace_freebsd_amd64.go │ │ ├── ptrace_linux.go │ │ ├── ptrace_linux_386.go │ │ ├── ptrace_linux_64bit.go │ │ ├── ptrace_linux_amd64.go │ │ ├── register_linux_386.go │ │ ├── registers_darwin_amd64.go │ │ ├── registers_freebsd_amd64.go │ │ ├── registers_linux_amd64.go │ │ ├── registers_linux_arm64.go │ │ ├── registers_linux_loong64.go │ │ ├── registers_linux_ppc64le.go │ │ ├── registers_linux_riscv64.go │ │ ├── registers_windows.go │ │ ├── support_sentinel.go │ │ ├── support_sentinel_cgo_freebsd.go │ │ ├── support_sentinel_darwin.go │ │ ├── support_sentinel_freebsd.go │ │ ├── support_sentinel_linux.go │ │ ├── support_sentinel_windows.go │ │ ├── syscall_windows.go │ │ ├── syscall_windows_amd64.go │ │ ├── syscall_windows_arm64.go │ │ ├── threads.go │ │ ├── threads_darwin.c │ │ ├── threads_darwin.go │ │ ├── threads_darwin.h │ │ ├── threads_freebsd.go │ │ ├── threads_hardware_singlestep_linux.go │ │ ├── threads_linux.go │ │ ├── threads_linux_386.go │ │ ├── threads_linux_amd64.go │ │ ├── threads_linux_arm64.go │ │ ├── threads_linux_loong64.go │ │ ├── threads_linux_ppc64le.go │ │ ├── threads_linux_riscv64.go │ │ ├── threads_windows.go │ │ ├── threads_windows_amd64.go │ │ ├── threads_windows_arm64.go │ │ └── zsyscall_windows.go │ ├── pclntab.go │ ├── pe.go │ ├── ppc64le_arch.go │ ├── ppc64le_disasm.go │ ├── proc_amd64_test.go │ ├── proc_darwin_amd64_test.go │ ├── proc_darwin_test.go │ ├── proc_general_test.go │ ├── proc_linux_test.go │ ├── proc_test.go │ ├── proc_unexported_test.go │ ├── proc_unix_test.go │ ├── redirect.go │ ├── redirector_other.go │ ├── redirector_windows.go │ ├── registers.go │ ├── riscv64_arch.go │ ├── riscv64_disasm.go │ ├── scope_test.go │ ├── stack.go │ ├── stack_sigtramp.go │ ├── stackwatch.go │ ├── stepping_test.go │ ├── target.go │ ├── target_exec.go │ ├── target_group.go │ ├── test │ │ └── support.go │ ├── threads.go │ ├── types.go │ ├── variable_test.go │ ├── variables.go │ ├── variables_fuzz_test.go │ ├── variables_test.go │ ├── winutil │ │ ├── regs_amd64_arch.go │ │ └── regs_arm64_arch.go │ └── x86_disasm.go ├── terminal │ ├── colorize │ │ ├── colorize.go │ │ └── colorize_test.go │ ├── command.go │ ├── command_test.go │ ├── config.go │ ├── disasmprint.go │ ├── docgen.go │ ├── groups.go │ ├── out.go │ ├── out_unix.go │ ├── out_windows.go │ ├── starbind │ │ ├── conv.go │ │ ├── conv_test.go │ │ ├── repl.go │ │ ├── starlark.go │ │ └── starlark_mapping.go │ ├── starlark.go │ ├── starlark_test.go │ ├── terminal.go │ ├── terminal_other.go │ ├── terminal_test.go │ └── terminal_windows.go └── version │ ├── buildinfo.go │ └── version.go ├── service ├── api │ ├── command.go │ ├── conversions.go │ ├── prettyprint.go │ ├── prettyprint_test.go │ ├── shorten_type.go │ ├── shorten_type_test.go │ └── types.go ├── client.go ├── config.go ├── dap │ ├── command.go │ ├── config.go │ ├── config_test.go │ ├── daptest │ │ ├── client.go │ │ ├── gen │ │ │ └── main.go │ │ └── resp.go │ ├── error_ids.go │ ├── handles.go │ ├── server.go │ ├── server_test.go │ └── types.go ├── debugger │ ├── debugger.go │ ├── debugger_linux.go │ ├── debugger_test.go │ └── debugger_unix_test.go ├── internal │ └── sameuser │ │ ├── doc.go │ │ ├── sameuser.go │ │ ├── sameuser_linux.go │ │ └── sameuser_linux_test.go ├── listenerpipe.go ├── rpc2 │ ├── client.go │ └── server.go ├── rpccallback.go ├── rpccommon │ ├── server.go │ └── suitablemethods.go ├── server.go └── test │ ├── common_test.go │ └── integration2_test.go └── vendor ├── github.com ├── cilium │ └── ebpf │ │ ├── .clang-format │ │ ├── .gitignore │ │ ├── .golangci.yaml │ │ ├── ARCHITECTURE.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── MAINTAINERS.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── asm │ │ ├── alu.go │ │ ├── alu_string.go │ │ ├── doc.go │ │ ├── func.go │ │ ├── func_string.go │ │ ├── instruction.go │ │ ├── jump.go │ │ ├── jump_string.go │ │ ├── load_store.go │ │ ├── load_store_string.go │ │ ├── metadata.go │ │ ├── opcode.go │ │ ├── opcode_string.go │ │ └── register.go │ │ ├── attachtype_string.go │ │ ├── btf │ │ ├── btf.go │ │ ├── btf_types.go │ │ ├── btf_types_string.go │ │ ├── core.go │ │ ├── doc.go │ │ ├── ext_info.go │ │ ├── format.go │ │ ├── handle.go │ │ ├── marshal.go │ │ ├── strings.go │ │ ├── traversal.go │ │ ├── types.go │ │ └── workarounds.go │ │ ├── collection.go │ │ ├── doc.go │ │ ├── elf_reader.go │ │ ├── info.go │ │ ├── internal │ │ ├── align.go │ │ ├── buffer.go │ │ ├── cpu.go │ │ ├── deque.go │ │ ├── elf.go │ │ ├── endian_be.go │ │ ├── endian_le.go │ │ ├── epoll │ │ │ └── poller.go │ │ ├── errors.go │ │ ├── feature.go │ │ ├── io.go │ │ ├── kconfig │ │ │ └── kconfig.go │ │ ├── memoize.go │ │ ├── output.go │ │ ├── pinning.go │ │ ├── platform.go │ │ ├── prog.go │ │ ├── statfs.go │ │ ├── sys │ │ │ ├── doc.go │ │ │ ├── fd.go │ │ │ ├── fd_trace.go │ │ │ ├── mapflags_string.go │ │ │ ├── ptr.go │ │ │ ├── ptr_32_be.go │ │ │ ├── ptr_32_le.go │ │ │ ├── ptr_64.go │ │ │ ├── signals.go │ │ │ ├── syscall.go │ │ │ └── types.go │ │ ├── tracefs │ │ │ ├── kprobe.go │ │ │ ├── probetype_string.go │ │ │ └── uprobe.go │ │ ├── unix │ │ │ ├── doc.go │ │ │ ├── types_linux.go │ │ │ └── types_other.go │ │ ├── vdso.go │ │ └── version.go │ │ ├── link │ │ ├── cgroup.go │ │ ├── doc.go │ │ ├── iter.go │ │ ├── kprobe.go │ │ ├── kprobe_multi.go │ │ ├── link.go │ │ ├── netns.go │ │ ├── perf_event.go │ │ ├── program.go │ │ ├── query.go │ │ ├── raw_tracepoint.go │ │ ├── socket_filter.go │ │ ├── syscalls.go │ │ ├── tracepoint.go │ │ ├── tracing.go │ │ ├── uprobe.go │ │ └── xdp.go │ │ ├── linker.go │ │ ├── map.go │ │ ├── marshalers.go │ │ ├── prog.go │ │ ├── ringbuf │ │ ├── doc.go │ │ ├── reader.go │ │ └── ring.go │ │ ├── rlimit │ │ └── rlimit.go │ │ ├── run-tests.sh │ │ ├── syscalls.go │ │ ├── types.go │ │ └── types_string.go ├── cosiner │ └── argv │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── argv.go │ │ ├── cmd.go │ │ ├── parser.go │ │ └── scanner.go ├── cpuguy83 │ └── go-md2man │ │ └── v2 │ │ ├── LICENSE.md │ │ └── md2man │ │ ├── debug.go │ │ ├── md2man.go │ │ └── roff.go ├── creack │ └── pty │ │ ├── .gitignore │ │ ├── Dockerfile.golang │ │ ├── Dockerfile.riscv │ │ ├── LICENSE │ │ ├── README.md │ │ ├── asm_solaris_amd64.s │ │ ├── doc.go │ │ ├── ioctl.go │ │ ├── ioctl_bsd.go │ │ ├── ioctl_inner.go │ │ ├── ioctl_legacy.go │ │ ├── ioctl_solaris.go │ │ ├── ioctl_unsupported.go │ │ ├── mktypes.bash │ │ ├── pty_darwin.go │ │ ├── pty_dragonfly.go │ │ ├── pty_freebsd.go │ │ ├── pty_linux.go │ │ ├── pty_netbsd.go │ │ ├── pty_openbsd.go │ │ ├── pty_solaris.go │ │ ├── pty_unsupported.go │ │ ├── run.go │ │ ├── start.go │ │ ├── start_windows.go │ │ ├── test_crosscompile.sh │ │ ├── winsize.go │ │ ├── winsize_unix.go │ │ ├── winsize_unsupported.go │ │ ├── ztypes_386.go │ │ ├── ztypes_amd64.go │ │ ├── ztypes_arm.go │ │ ├── ztypes_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_ppc64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_loong64.go │ │ ├── ztypes_mipsx.go │ │ ├── ztypes_netbsd_32bit_int.go │ │ ├── ztypes_openbsd_32bit_int.go │ │ ├── ztypes_ppc.go │ │ ├── ztypes_ppc64.go │ │ ├── ztypes_ppc64le.go │ │ ├── ztypes_riscvx.go │ │ ├── ztypes_s390x.go │ │ └── ztypes_sparcx.go ├── derekparker │ └── trie │ │ ├── .deepsource.toml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ └── trie.go ├── go-delve │ └── liner │ │ ├── COPYING │ │ ├── README.md │ │ ├── bsdinput.go │ │ ├── common.go │ │ ├── fallbackinput.go │ │ ├── input.go │ │ ├── input_darwin.go │ │ ├── input_linux.go │ │ ├── input_solaris.go │ │ ├── input_windows.go │ │ ├── line.go │ │ ├── output.go │ │ ├── output_solaris.go │ │ ├── output_unix.go │ │ ├── output_windows.go │ │ ├── signal_unix.go │ │ ├── signal_windows.go │ │ ├── unixmode.go │ │ ├── unixmode_solaris.go │ │ └── width.go ├── google │ └── go-dap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── codec.go │ │ ├── doc.go │ │ ├── io.go │ │ └── schematypes.go ├── hashicorp │ └── golang-lru │ │ ├── LICENSE │ │ └── simplelru │ │ ├── lru.go │ │ └── lru_interface.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ └── trap_windows.go ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_appengine.go │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ ├── go.test.sh │ │ └── noncolorable.go │ ├── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ └── go-runewidth │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.test.sh │ │ ├── runewidth.go │ │ ├── runewidth_appengine.go │ │ ├── runewidth_js.go │ │ ├── runewidth_posix.go │ │ ├── runewidth_table.go │ │ └── runewidth_windows.go ├── rivo │ └── uniseg │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── doc.go │ │ ├── grapheme.go │ │ └── properties.go ├── russross │ └── blackfriday │ │ └── v2 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── block.go │ │ ├── doc.go │ │ ├── entities.go │ │ ├── esc.go │ │ ├── html.go │ │ ├── inline.go │ │ ├── markdown.go │ │ ├── node.go │ │ └── smartypants.go └── spf13 │ ├── cobra │ ├── .gitignore │ ├── .golangci.yml │ ├── .mailmap │ ├── CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE.txt │ ├── MAINTAINERS │ ├── Makefile │ ├── README.md │ ├── active_help.go │ ├── args.go │ ├── bash_completions.go │ ├── bash_completionsV2.go │ ├── cobra.go │ ├── command.go │ ├── command_notwin.go │ ├── command_win.go │ ├── completions.go │ ├── doc │ │ ├── man_docs.go │ │ ├── md_docs.go │ │ ├── rest_docs.go │ │ ├── util.go │ │ └── yaml_docs.go │ ├── fish_completions.go │ ├── flag_groups.go │ ├── powershell_completions.go │ ├── shell_completions.go │ └── zsh_completions.go │ └── pflag │ ├── .editorconfig │ ├── .gitignore │ ├── .golangci.yaml │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bool.go │ ├── bool_slice.go │ ├── bytes.go │ ├── count.go │ ├── duration.go │ ├── duration_slice.go │ ├── flag.go │ ├── float32.go │ ├── float32_slice.go │ ├── float64.go │ ├── float64_slice.go │ ├── golangflag.go │ ├── int.go │ ├── int16.go │ ├── int32.go │ ├── int32_slice.go │ ├── int64.go │ ├── int64_slice.go │ ├── int8.go │ ├── int_slice.go │ ├── ip.go │ ├── ip_slice.go │ ├── ipmask.go │ ├── ipnet.go │ ├── ipnet_slice.go │ ├── string.go │ ├── string_array.go │ ├── string_slice.go │ ├── string_to_int.go │ ├── string_to_int64.go │ ├── string_to_string.go │ ├── uint.go │ ├── uint16.go │ ├── uint32.go │ ├── uint64.go │ ├── uint8.go │ └── uint_slice.go ├── go.starlark.net ├── LICENSE ├── internal │ ├── compile │ │ ├── compile.go │ │ └── serial.go │ └── spell │ │ └── spell.go ├── lib │ └── time │ │ └── time.go ├── resolve │ ├── binding.go │ └── resolve.go ├── starlark │ ├── debug.go │ ├── empty.s │ ├── eval.go │ ├── hashtable.go │ ├── int.go │ ├── int_generic.go │ ├── int_posix64.go │ ├── interp.go │ ├── library.go │ ├── profile.go │ ├── unpack.go │ └── value.go ├── starlarkstruct │ ├── module.go │ └── struct.go └── syntax │ ├── grammar.txt │ ├── options.go │ ├── parse.go │ ├── quote.go │ ├── scan.go │ ├── syntax.go │ └── walk.go ├── golang.org └── x │ ├── arch │ ├── LICENSE │ ├── PATENTS │ ├── arm64 │ │ └── arm64asm │ │ │ ├── arg.go │ │ │ ├── condition.go │ │ │ ├── condition_util.go │ │ │ ├── decode.go │ │ │ ├── gnu.go │ │ │ ├── inst.go │ │ │ ├── inst.json │ │ │ ├── plan9x.go │ │ │ └── tables.go │ ├── loong64 │ │ └── loong64asm │ │ │ ├── arg.go │ │ │ ├── decode.go │ │ │ ├── gnu.go │ │ │ ├── inst.go │ │ │ ├── plan9x.go │ │ │ └── tables.go │ ├── ppc64 │ │ └── ppc64asm │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ ├── field.go │ │ │ ├── gnu.go │ │ │ ├── inst.go │ │ │ ├── plan9.go │ │ │ └── tables.go │ ├── riscv64 │ │ └── riscv64asm │ │ │ ├── arg.go │ │ │ ├── csr_string.go │ │ │ ├── decode.go │ │ │ ├── gnu.go │ │ │ ├── inst.go │ │ │ ├── plan9x.go │ │ │ └── tables.go │ └── x86 │ │ └── x86asm │ │ ├── Makefile │ │ ├── decode.go │ │ ├── gnu.go │ │ ├── inst.go │ │ ├── intel.go │ │ ├── plan9x.go │ │ └── tables.go │ ├── exp │ ├── LICENSE │ ├── PATENTS │ ├── constraints │ │ └── constraints.go │ ├── maps │ │ └── maps.go │ └── slices │ │ ├── slices.go │ │ ├── sort.go │ │ ├── zsortfunc.go │ │ └── zsortordered.go │ ├── mod │ ├── LICENSE │ ├── PATENTS │ └── semver │ │ └── semver.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ ├── errgroup.go │ │ ├── go120.go │ │ └── pre_go120.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ ├── execabs │ │ ├── execabs.go │ │ ├── execabs_go118.go │ │ └── execabs_go119.go │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── vgetrandom_linux.go │ │ ├── vgetrandom_unsupported.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkknownfolderids.bash │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── setupapi_windows.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ ├── types_windows_arm64.go │ │ ├── zerrors_windows.go │ │ ├── zknownfolderids_windows.go │ │ └── zsyscall_windows.go │ ├── telemetry │ ├── .dockerignore │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierrc.json │ ├── .stylelintrc.json │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── counter │ │ ├── counter.go │ │ └── doc.go │ ├── dir.go │ ├── doc.go │ ├── internal │ │ ├── config │ │ │ └── config.go │ │ ├── configstore │ │ │ ├── download.go │ │ │ └── download_windows.go │ │ ├── counter │ │ │ ├── counter.go │ │ │ ├── file.go │ │ │ ├── parse.go │ │ │ └── stackcounter.go │ │ ├── crashmonitor │ │ │ ├── crash_go123.go │ │ │ └── monitor.go │ │ ├── mmap │ │ │ ├── mmap.go │ │ │ ├── mmap_other.go │ │ │ ├── mmap_unix.go │ │ │ └── mmap_windows.go │ │ ├── telemetry │ │ │ ├── dateonly.go │ │ │ ├── dir.go │ │ │ ├── proginfo.go │ │ │ └── types.go │ │ └── upload │ │ │ ├── Doc.txt │ │ │ ├── date.go │ │ │ ├── findwork.go │ │ │ ├── reports.go │ │ │ ├── run.go │ │ │ └── upload.go │ ├── mode.go │ ├── npm │ ├── npx │ ├── package-lock.json │ ├── package.json │ ├── start.go │ ├── start_posix.go │ ├── start_windows.go │ ├── tsconfig.json │ └── types_alias.go │ └── tools │ ├── LICENSE │ ├── PATENTS │ ├── go │ ├── gcexportdata │ │ ├── gcexportdata.go │ │ └── importer.go │ ├── internal │ │ └── packagesdriver │ │ │ └── sizes.go │ ├── packages │ │ ├── doc.go │ │ ├── external.go │ │ ├── golist.go │ │ ├── golist_overlay.go │ │ ├── loadmode_string.go │ │ ├── packages.go │ │ └── visit.go │ └── types │ │ └── objectpath │ │ └── objectpath.go │ └── internal │ ├── event │ ├── core │ │ ├── event.go │ │ ├── export.go │ │ └── fast.go │ ├── doc.go │ ├── event.go │ ├── keys │ │ ├── keys.go │ │ └── standard.go │ ├── label │ │ └── label.go │ └── tag │ │ └── tag.go │ ├── gcimporter │ ├── bimport.go │ ├── exportdata.go │ ├── gcimporter.go │ ├── iexport.go │ ├── iimport.go │ ├── newInterface10.go │ ├── newInterface11.go │ ├── support_go117.go │ ├── support_go118.go │ ├── unified_no.go │ ├── unified_yes.go │ ├── ureader_no.go │ └── ureader_yes.go │ ├── gocommand │ ├── invoke.go │ ├── vendor.go │ └── version.go │ ├── packagesinternal │ └── packages.go │ ├── pkgbits │ ├── codes.go │ ├── decoder.go │ ├── doc.go │ ├── encoder.go │ ├── flags.go │ ├── frames_go1.go │ ├── frames_go17.go │ ├── reloc.go │ ├── support.go │ ├── sync.go │ └── syncmarker_string.go │ ├── tokeninternal │ └── tokeninternal.go │ ├── typeparams │ ├── common.go │ ├── coretype.go │ ├── enabled_go117.go │ ├── enabled_go118.go │ ├── normalize.go │ ├── termlist.go │ ├── typeparams_go117.go │ ├── typeparams_go118.go │ └── typeterm.go │ └── typesinternal │ ├── errorcode.go │ ├── errorcode_string.go │ ├── objectpath.go │ ├── types.go │ └── types_118.go ├── gopkg.in └── yaml.v3 │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── modules.txt /.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | GOFLAGS: -mod=vendor 3 | 4 | freebsd_instance: 5 | image_family: freebsd-14-2 6 | 7 | test_task: 8 | install_script: pkg install -y go gcc git 9 | test_script: make test 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | pkg/version/version.go ident 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.test 2 | .tags* 3 | tags 4 | .dbg_history 5 | **/**/dlv 6 | !cmd/dlv/ 7 | .vagrant 8 | **/*.swp 9 | localtests 10 | .idea 11 | *.iml 12 | .teamcity/target 13 | .vscode 14 | -------------------------------------------------------------------------------- /Documentation/KnownBugs.md: -------------------------------------------------------------------------------- 1 | # Known Bugs 2 | 3 | - When Delve is compiled with versions of go prior to 1.7.0 it is not possible to set a breakpoint on a function in a remote package using the `Receiver.MethodName` syntax. See [Issue #528](https://github.com/go-delve/delve/issues/528). 4 | - When running Delve on binaries compiled with a version of go prior to 1.9.0 `locals` will print all local variables, including ones that are out of scope, the shadowed flag will be applied arbitrarily. If there are multiple variables defined with the same name in the current function `print` will not be able to select the correct one for the current line. 5 | - `reverse step` will not reverse step into functions called by deferred calls. 6 | -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | # Delve Documentation 2 | 3 | Documentation for the project will reside in this directory. 4 | 5 | - [Installation](installation) 6 | - [Usage](usage) 7 | - [Command Line Interface](cli) 8 | - [API](api) 9 | - [Internal](internal) 10 | - [Editor Integration and Alternative UI](EditorIntegration.md) 11 | - [Known Bugs](KnownBugs.md) 12 | -------------------------------------------------------------------------------- /Documentation/installation/freebsd/install.md: -------------------------------------------------------------------------------- 1 | See [general install instructions](../README.md). -------------------------------------------------------------------------------- /Documentation/installation/linux/install.md: -------------------------------------------------------------------------------- 1 | See [general install instructions](../README.md). 2 | -------------------------------------------------------------------------------- /Documentation/installation/osx/install.md: -------------------------------------------------------------------------------- 1 | ## Homebrew 2 | 3 | You can install Delve via HomeBrew with the following command: 4 | 5 | ```shell 6 | $ brew install delve 7 | ``` 8 | 9 | ## Other installation methods 10 | 11 | See [general install instructions](../README.md). 12 | -------------------------------------------------------------------------------- /Documentation/installation/windows/install.md: -------------------------------------------------------------------------------- 1 | See [general install instructions](../README.md). -------------------------------------------------------------------------------- /Documentation/internal/README.md: -------------------------------------------------------------------------------- 1 | # Internal Documentation 2 | 3 | * [Architecture of Delve slides](https://speakerdeck.com/aarzilli/internal-architecture-of-delve). 4 | * [Notes on porting Delve to other architectures](portnotes.md) 5 | 6 | TODO(derekparker) 7 | 8 | This directory will hold documentation around the internals of the debugger and how it works. 9 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please answer the following before submitting your issue: 2 | 3 | Note: Please include any substantial examples (debug session output, 4 | stacktraces, etc) as linked gists. 5 | 6 | If this is about source listing not showing up (or breakpoints not being 7 | accepted) while running in a container please read our 8 | [FAQ](https://github.com/go-delve/delve/blob/master/Documentation/faq.md#substpath) 9 | first. 10 | 11 | 1. What version of Delve are you using (`dlv version`)? 12 | 2. What version of Go are you using? (`go version`)? 13 | 3. What operating system and processor architecture are you using? 14 | 4. What did you do? 15 | 5. What did you expect to see? 16 | 6. What did you see instead? 17 | -------------------------------------------------------------------------------- /_fixtures/amend_breakpoint.star: -------------------------------------------------------------------------------- 1 | bp = get_breakpoint(0, "afuncbreak").Breakpoint 2 | bp.Stacktrace = 2 3 | bp.HitCond = "== 2" 4 | amend_breakpoint(bp) 5 | bp2 = get_breakpoint(0, "afuncbreak").Breakpoint 6 | print(bp) 7 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func asmFunc(*int) int 6 | 7 | func main() { 8 | fmt.Printf("%d\n", asmFunc(nil)) 9 | } 10 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_386.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOVL arg+0(FP), AX 5 | MOVL (AX), AX 6 | MOVL AX, ret+4(FP) 7 | RET 8 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_amd64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOVQ arg+0(FP), AX 5 | MOVQ (AX), AX 6 | MOVQ AX, ret+8(FP) 7 | RET 8 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_arm64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOVD arg+0(FP), R5 5 | MOVD (R5), R5 6 | MOVD R5, ret+8(FP) 7 | RET 8 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_loong64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOVV arg+0(FP), R5 5 | MOVV (R5), R5 6 | MOVV R5, ret+8(FP) 7 | RET 8 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_ppc64le.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOVD arg+0(FP), R5 5 | MOVD (R5), R5 6 | MOVD R5, ret+8(FP) 7 | RET 8 | -------------------------------------------------------------------------------- /_fixtures/asmnilptr/main_riscv64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-16 4 | MOV arg+0(FP), R5 5 | MOV (R5), R5 6 | MOV R5, ret+8(FP) 7 | RET -------------------------------------------------------------------------------- /_fixtures/backwardsiter.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "iter" 6 | ) 7 | 8 | func backwards(s []int) func(func(int) bool) { 9 | return func(yield func(int) bool) { 10 | for i := len(s) - 1; i >= 0; i-- { 11 | if !yield(s[i]) { 12 | break 13 | } 14 | } 15 | } 16 | } 17 | 18 | func main() { 19 | next, stop := iter.Pull(backwards([]int{10, 20, 30, 40})) 20 | fmt.Println(next()) 21 | fmt.Println(next()) 22 | fmt.Println(next()) 23 | stop() 24 | } 25 | -------------------------------------------------------------------------------- /_fixtures/badflags.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func g() { 9 | } 10 | 11 | func main() { 12 | g() 13 | a := os.Args[1] == "1" 14 | if a { 15 | fmt.Printf("true branch %v\n", a) 16 | } else { 17 | fmt.Printf("false branch %v\n", a) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/bpcountstest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "sync" 7 | "time" 8 | ) 9 | 10 | func demo(id int, wait *sync.WaitGroup) { 11 | for i := 0; i < 100; i++ { 12 | sleep := rand.Intn(10) + 1 13 | fmt.Printf("id: %d step: %d sleeping %d\n", id, i, sleep) 14 | time.Sleep(time.Duration(sleep) * time.Millisecond) 15 | } 16 | 17 | wait.Done() 18 | } 19 | 20 | func main() { 21 | wait := new(sync.WaitGroup) 22 | wait.Add(1) 23 | wait.Add(1) 24 | go demo(1, wait) 25 | go demo(2, wait) 26 | 27 | wait.Wait() 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/bpfile: -------------------------------------------------------------------------------- 1 | # comment line 2 | trace main.main 3 | 4 | break main.sayhi 5 | 6 | # 7 | # comment line 8 | # 9 | -------------------------------------------------------------------------------- /_fixtures/bphitcountchain.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func breakfunc1() { 6 | fmt.Println("breakfunc1") 7 | } 8 | 9 | func breakfunc2() { 10 | fmt.Println("breakfunc2") 11 | } 12 | 13 | func breakfunc3() { 14 | fmt.Println("breakfunc3") 15 | } 16 | 17 | func main() { 18 | breakfunc2() 19 | breakfunc3() 20 | 21 | breakfunc1() // hit 22 | breakfunc3() 23 | breakfunc1() 24 | 25 | breakfunc2() // hit 26 | breakfunc1() 27 | 28 | breakfunc3() // hit 29 | breakfunc1() 30 | breakfunc2() 31 | } 32 | -------------------------------------------------------------------------------- /_fixtures/break.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | i := 0 5 | for { 6 | i++ 7 | if i > 10 { 8 | break 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/break/break_amd64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmBrk(SB),0,$0-0 4 | BYTE $0xcc 5 | RET 6 | -------------------------------------------------------------------------------- /_fixtures/break/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func asmBrk() 4 | 5 | func main() { 6 | asmBrk() 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/buildflagtest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | // To be set via 6 | // go build -ldflags '-X main.Hello=World' 7 | var Hello string 8 | 9 | func main() { 10 | if len(Hello) < 1 { 11 | panic("global main.Hello not set via build flags") 12 | } 13 | fmt.Printf("Hello %s!\n", Hello) 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/buildtest/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("hello world!") 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/buildtest/main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | ) 7 | 8 | func TestMain(m *testing.M) { 9 | os.Exit(m.Run()) 10 | } 11 | 12 | func TestCurrentDirectory(t *testing.T) { 13 | wd, _ := os.Getwd() 14 | t.Logf("current directory: %s", wd) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/callme.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callme(i int) { 6 | fmt.Println("got:", i) 7 | } 8 | 9 | const nBytes = 10 10 | var zeroarr [nBytes]byte 11 | 12 | func callme2() { 13 | for i := 0; i < nBytes; i++ { 14 | zeroarr[i] = '0' 15 | } 16 | fmt.Println("callme2") 17 | } 18 | 19 | func callme3() { 20 | callme2() 21 | } 22 | 23 | func main() { 24 | for i := 0; i < 5; i++ { 25 | callme(i) 26 | } 27 | callme3() 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/cat.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | s := bufio.NewScanner(os.Stdin) 11 | for s.Scan() { 12 | fmt.Printf("read %q\n", s.Text()) 13 | } 14 | os.Stdout.Close() 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/cgodisass.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | int a(int v) { 5 | return 0xff + v; 6 | } 7 | */ 8 | import "C" 9 | import "fmt" 10 | 11 | func main() { 12 | fmt.Println("aaa") 13 | print(C.a(11)) 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/cgosigsegvstack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // #cgo CFLAGS: -g -Wall -O0 4 | /* 5 | void sigsegv(int x) { 6 | int *p = NULL; 7 | *p = x; 8 | } 9 | void testfn(int x) { 10 | sigsegv(x); 11 | } 12 | */ 13 | import "C" 14 | 15 | func main() { 16 | C.testfn(C.int(10)) 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/cgostacktest/hello.h: -------------------------------------------------------------------------------- 1 | #ifndef __HELLO_H__ 2 | #define __HELLO_H__ 3 | 4 | void helloworld(int); 5 | void helloworld_pt3(int); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /_fixtures/cgostacktest/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // #include "hello.h" 4 | import "C" 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | ) 10 | 11 | func main() { 12 | runtime.Breakpoint() 13 | C.helloworld(2) 14 | } 15 | 16 | //export helloWorld 17 | func helloWorld(x C.int) { 18 | helloWorldS(x) 19 | } 20 | 21 | func helloWorldS(x C.int) { 22 | runtime.Breakpoint() 23 | C.helloworld_pt3(x - 1) 24 | } 25 | 26 | //export helloWorld2 27 | func helloWorld2(x C.int) { 28 | runtime.Breakpoint() 29 | fmt.Printf("hello world %d\n", x) 30 | } 31 | -------------------------------------------------------------------------------- /_fixtures/cgotest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | #include 5 | char* foo(void) { return "hello, world!"; } 6 | */ 7 | import "C" 8 | 9 | import "fmt" 10 | import "runtime" 11 | 12 | func main() { 13 | runtime.GOMAXPROCS(runtime.NumCPU()) 14 | fmt.Println(C.GoString(C.foo())) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/chain_breakpoints.star: -------------------------------------------------------------------------------- 1 | def command_chain(args): 2 | v = args.split(" ") 3 | 4 | bp = get_breakpoint(int(v[0]), "").Breakpoint 5 | bp.HitCond = "== 1" 6 | amend_breakpoint(bp) 7 | 8 | for i in range(1, len(v)): 9 | bp = get_breakpoint(int(v[i]), "").Breakpoint 10 | if i != len(v)-1: 11 | bp.HitCond = "== 1" 12 | bp.Cond = "delve.bphitcount[" + v[i-1] + "] > 0" 13 | amend_breakpoint(bp) 14 | -------------------------------------------------------------------------------- /_fixtures/changoroutines.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | blockingchan1 := make(chan int) 10 | blockingchan2 := make(chan int) 11 | 12 | go sendToChan("one", blockingchan1) 13 | go sendToChan("two", blockingchan1) 14 | go recvFromChan(blockingchan2) 15 | time.Sleep(time.Second) 16 | 17 | runtime.Breakpoint() 18 | } 19 | 20 | func sendToChan(name string, ch chan<- int) { 21 | ch <- 1 22 | } 23 | 24 | func recvFromChan(ch <-chan int) { 25 | <-ch 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/clientdo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | "net/url" 6 | ) 7 | 8 | func main() { 9 | http.DefaultClient.Do(&http.Request{URL: &url.URL{}}) 10 | } 11 | -------------------------------------------------------------------------------- /_fixtures/closurecontents.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func makeAcc(scale int) func(x int) int { 9 | a := 0 10 | return func(x int) int { 11 | a += x * scale 12 | return a 13 | } 14 | } 15 | 16 | func main() { 17 | acc := makeAcc(3) 18 | runtime.Breakpoint() 19 | fmt.Println(acc(1)) 20 | runtime.Breakpoint() 21 | fmt.Println(acc(2)) 22 | runtime.Breakpoint() 23 | fmt.Println(acc(6)) 24 | runtime.Breakpoint() 25 | } 26 | -------------------------------------------------------------------------------- /_fixtures/condframe.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callme() { 6 | for i := 0; i < 10; i++ { 7 | callme2() 8 | } 9 | } 10 | 11 | func callme2() { 12 | fmt.Println("called again!!") 13 | } 14 | 15 | func main() { 16 | callme() 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/condperghitcount.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "sync" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | var wg sync.WaitGroup 10 | wg.Add(2) 11 | for i := 0; i < 2; i++ { 12 | go func() { 13 | j := 0 14 | for { 15 | j++ 16 | if j > 10 { 17 | break 18 | } 19 | } 20 | wg.Done() 21 | }() 22 | time.Sleep(time.Second) 23 | } 24 | wg.Wait() 25 | } 26 | -------------------------------------------------------------------------------- /_fixtures/consts.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/go-delve/delve/_fixtures/internal/dir0/pkg" 6 | "runtime" 7 | ) 8 | 9 | type ConstType uint8 10 | 11 | const ( 12 | constZero ConstType = iota 13 | constOne 14 | constTwo 15 | constThree 16 | ) 17 | 18 | type BitFieldType uint8 19 | 20 | const ( 21 | bitZero BitFieldType = 1 << iota 22 | bitOne 23 | bitTwo 24 | bitThree 25 | bitFour 26 | ) 27 | 28 | func main() { 29 | a := constTwo 30 | b := constThree 31 | c := bitZero | bitOne 32 | d := BitFieldType(33) 33 | e := ConstType(10) 34 | f := BitFieldType(0) 35 | runtime.Breakpoint() 36 | pkg.SomeVar.AnotherMethod(2) 37 | fmt.Println(a, b, c, d, e, f, pkg.SomeConst) 38 | } 39 | -------------------------------------------------------------------------------- /_fixtures/continuetestprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func sleepytime() { 9 | time.Sleep(time.Millisecond) 10 | } 11 | 12 | func sayhi() { 13 | fmt.Println("Hello, World!") 14 | } 15 | 16 | func main() { 17 | sleepytime() 18 | sayhi() 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/coreemptystring.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | s := "" 5 | t := "test" 6 | panic("panic!!!") 7 | println(s, t) 8 | } 9 | -------------------------------------------------------------------------------- /_fixtures/create_breakpoint_main.star: -------------------------------------------------------------------------------- 1 | def main(): 2 | for f in functions().Funcs: 3 | v = f.split('.') 4 | if len(v) != 2: 5 | continue 6 | if v[0] != "main": 7 | continue 8 | if v[1][0] >= 'a' and v[1][0] <= 'z': 9 | create_breakpoint({ "FunctionName": f, "Line": -1 }) # see documentation of RPCServer.CreateBreakpoint 10 | -------------------------------------------------------------------------------- /_fixtures/databpcountstest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | var globalvar1 int 10 | 11 | func demo(id int, wait *sync.WaitGroup) { 12 | for i := 0; i < 100; i++ { 13 | sleep := rand.Intn(10) + 1 14 | globalvar1 = globalvar1 + 1 15 | time.Sleep(time.Duration(sleep) * time.Millisecond) 16 | } 17 | 18 | wait.Done() 19 | } 20 | 21 | func main() { 22 | wait := new(sync.WaitGroup) 23 | wait.Add(1) 24 | wait.Add(1) 25 | go demo(1, wait) 26 | go demo(2, wait) 27 | 28 | wait.Wait() 29 | } 30 | -------------------------------------------------------------------------------- /_fixtures/databpstack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | // 6 | ) 7 | 8 | func f() { 9 | w := 0 10 | 11 | g(1000, &w) // Position 0 12 | } 13 | 14 | func g(cnt int, p *int) { 15 | if cnt == 0 { 16 | *p = 10 17 | return // Position 1 18 | } 19 | g(cnt-1, p) 20 | } 21 | 22 | func main() { 23 | f() 24 | fmt.Printf("done\n") // Position 2 25 | } 26 | -------------------------------------------------------------------------------- /_fixtures/debug_line_benchmark_data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/_fixtures/debug_line_benchmark_data -------------------------------------------------------------------------------- /_fixtures/debug_line_c_data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/_fixtures/debug_line_c_data -------------------------------------------------------------------------------- /_fixtures/decllinetest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | a := 0 9 | a++ 10 | b := 0 11 | f1(a, b) 12 | } 13 | 14 | func f1( 15 | a int, 16 | b int, 17 | ) { 18 | fmt.Printf("%d %d\n", a, b) 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/defercall.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var n = 0 4 | 5 | func sampleFunction() { 6 | n++ 7 | } 8 | 9 | func callAndDeferReturn() { 10 | defer sampleFunction() 11 | sampleFunction() 12 | n++ 13 | } 14 | 15 | func callAndPanic2() { 16 | defer sampleFunction() 17 | sampleFunction() 18 | panic("panicking") 19 | } 20 | 21 | func callAndPanic() { 22 | defer recover() 23 | callAndPanic2() 24 | } 25 | 26 | func main() { 27 | callAndDeferReturn() 28 | callAndPanic() 29 | } 30 | -------------------------------------------------------------------------------- /_fixtures/deferstack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "runtime" 4 | 5 | func f1() { 6 | } 7 | 8 | func f2(a int8, b int32) { 9 | } 10 | 11 | func f3() { 12 | } 13 | 14 | func call1() { 15 | defer f2(1, -1) 16 | defer f1() 17 | call2() 18 | } 19 | 20 | func call2() { 21 | defer f3() 22 | defer f2(42, 61) 23 | call3() 24 | } 25 | 26 | func call3() { 27 | runtime.Breakpoint() 28 | } 29 | 30 | func main() { 31 | call1() 32 | } 33 | -------------------------------------------------------------------------------- /_fixtures/dotpackagesiface.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/go-delve/delve/_fixtures/internal/dir.io" 6 | "github.com/go-delve/delve/_fixtures/internal/dir.io/io.io" 7 | "runtime" 8 | ) 9 | 10 | func main() { 11 | var iface interface{} = &dirio.SomeType{} 12 | var iface2 interface{} = &ioio.SomeOtherType{} 13 | runtime.Breakpoint() 14 | fmt.Println(iface, iface2) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/doubleinline.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "strconv" 7 | ) 8 | 9 | type Rectangle struct{} 10 | 11 | func (r *Rectangle) Height() int { 12 | h, _ := strconv.ParseInt("7", 10, 0) 13 | return int(h) 14 | } 15 | 16 | func (r *Rectangle) Width() int { 17 | return 6 18 | } 19 | 20 | func (r *Rectangle) Area() int { return r.Height() * r.Width() } 21 | 22 | func main() { 23 | var r Rectangle 24 | runtime.Breakpoint() 25 | fmt.Println(r.Area()) 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/dwzcompression.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // #include 4 | // void fortytwo() 5 | // { 6 | // fprintf(stdin, "42"); 7 | // } 8 | import "C" 9 | import "runtime" 10 | 11 | func main() { 12 | C.fortytwo() 13 | runtime.Breakpoint() 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/ebpf_trace.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callme(i int) int { 6 | if i == 0 { 7 | return 100 8 | } 9 | return callme(i - 1) 10 | } 11 | 12 | func main() { 13 | fmt.Println(callme(10)) 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/ebpf_trace2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | i := int64(0) 10 | for i = 0; i < 5; i++ { 11 | tracedFunction(i) 12 | } 13 | for i = 5; i < 10; i++ { 14 | tracedFunction(i) 15 | time.Sleep(time.Second) 16 | } 17 | } 18 | 19 | //go:noinline 20 | func tracedFunction(x int64) { 21 | fmt.Println(x) 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/ebpf_trace3.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | str := "abcdefghijklmnopqrstuvqxyz" 10 | i := int64(0) 11 | for i = 0; i < 5; i++ { 12 | tracedFunction(i, i%5 == 0, str[i]) 13 | } 14 | for i = 5; i < 10; i++ { 15 | tracedFunction(i, i%5 == 0, str[i]) 16 | time.Sleep(time.Millisecond) 17 | } 18 | } 19 | 20 | //go:noinline 21 | func tracedFunction(x int64, b bool, r byte) { 22 | fmt.Println(x, b, r) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/echo_expr.star: -------------------------------------------------------------------------------- 1 | def command_echo_expr(a, b, c): 2 | print("a", a, "b", b, "c", c) 3 | -------------------------------------------------------------------------------- /_fixtures/examinememory.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "unsafe" 6 | ) 7 | 8 | func main() { 9 | l := int(51) 10 | bs := make([]byte, l) 11 | for i := 0; i < l; i++ { 12 | bs[i] = byte(i + int(10)) 13 | } 14 | 15 | bsp := (*byte)(unsafe.Pointer(&bs[0])) 16 | 17 | bspUintptr := uintptr(unsafe.Pointer(bsp)) 18 | 19 | fmt.Printf("%#x\n", bspUintptr) 20 | _ = *bsp 21 | 22 | bs[0] = 255 23 | 24 | _ = *bsp 25 | } 26 | -------------------------------------------------------------------------------- /_fixtures/exit.init: -------------------------------------------------------------------------------- 1 | exit 2 | -------------------------------------------------------------------------------- /_fixtures/fatalerror.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | var f func() 5 | go f() 6 | } 7 | -------------------------------------------------------------------------------- /_fixtures/find_array.star: -------------------------------------------------------------------------------- 1 | def command_find_array(arr, pred): 2 | """Calls pred for each element of the array or slice 'arr' returns the index of the first element for which pred returns true. 3 | 4 | find_arr , 5 | 6 | Example use: 7 | 8 | find_arr "s2", lambda x: x.A == 5 9 | """ 10 | arrv = eval(None, arr).Variable 11 | for i in range(0, arrv.Len): 12 | v = arrv.Value[i] 13 | if pred(v): 14 | print("found", i) 15 | return 16 | 17 | print("not found") 18 | -------------------------------------------------------------------------------- /_fixtures/genericbp.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func testfn[T any](arg T) { 6 | fmt.Println(arg) 7 | } 8 | 9 | func main() { 10 | testfn[uint16](1) 11 | testfn[float64](2.1) 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/genericintoiface.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | type Blah[T any] struct { 6 | x T 7 | } 8 | 9 | func (b *Blah[T]) F(y T) { 10 | b.x = y 11 | } 12 | 13 | type BlahInt interface { 14 | F(int) 15 | } 16 | 17 | func callf(b BlahInt) { 18 | b.F(2) 19 | fmt.Println(b) 20 | } 21 | 22 | func main() { 23 | b := &Blah[int]{10} 24 | callf(b) 25 | } 26 | -------------------------------------------------------------------------------- /_fixtures/goroutineLabels.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "runtime" 6 | "runtime/pprof" 7 | ) 8 | 9 | func main() { 10 | ctx := context.Background() 11 | labels := pprof.Labels("k1", "v1", "k2", "v2") 12 | runtime.Breakpoint() 13 | pprof.Do(ctx, labels, f) 14 | } 15 | 16 | var dummy int 17 | 18 | func f(ctx context.Context) { 19 | a := dummy 20 | runtime.Breakpoint() 21 | dummy++ 22 | dummy = a 23 | } -------------------------------------------------------------------------------- /_fixtures/goroutine_start_line.star: -------------------------------------------------------------------------------- 1 | def command_goroutine_start_line(args): 2 | "prints the line of source code that started each currently running goroutine" 3 | gs = goroutines().Goroutines 4 | for g in gs: 5 | line = read_file(g.StartLoc.File).splitlines()[g.StartLoc.Line-1].strip() 6 | print(g.ID, "\t", g.StartLoc.File + ":" + str(g.StartLoc.Line), "\t", line) 7 | 8 | def main(): 9 | dlv_command("config alias goroutine_start_line gsl") 10 | -------------------------------------------------------------------------------- /_fixtures/goroutinebreak.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "runtime" 4 | 5 | const N = 10 6 | 7 | func agoroutine(started chan<- struct{}, done chan<- struct{}, i int) { 8 | started <- struct{}{} 9 | done <- struct{}{} 10 | } 11 | 12 | func main() { 13 | done := make(chan struct{}) 14 | started := make(chan struct{}) 15 | for i := 0; i < N; i++ { 16 | runtime.Breakpoint() 17 | go agoroutine(started, done, i) 18 | } 19 | for i := 0; i < N; i++ { 20 | <-started 21 | } 22 | runtime.Gosched() 23 | for i := 0; i < N; i++ { 24 | <-done 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/goroutines-trace.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | func callme(i int, s string) int { 9 | fmt.Println(s) 10 | return i * i 11 | } 12 | 13 | func dostuff(wg *sync.WaitGroup, lbl string) { 14 | defer wg.Done() 15 | var j int 16 | for i := 0; i < 10; i++ { 17 | j += callme(i, lbl) 18 | } 19 | println(lbl, j) 20 | } 21 | 22 | func main() { 23 | var wg sync.WaitGroup 24 | 25 | for _, lbl := range []string{"one", "two", "three", "four", "five"} { 26 | for i := 0; i < 10; i++ { 27 | wg.Add(1) 28 | go dostuff(&wg, lbl) 29 | } 30 | } 31 | wg.Wait() 32 | } 33 | -------------------------------------------------------------------------------- /_fixtures/hcbpcountstest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "runtime" 7 | "sync" 8 | "time" 9 | ) 10 | 11 | func demo(id int, wait *sync.WaitGroup) { 12 | for i := 0; i < 100; i++ { 13 | sleep := rand.Intn(10) + 1 14 | runtime.Breakpoint() 15 | fmt.Printf("id: %d step: %d sleeping %d\n", id, i, sleep) 16 | time.Sleep(time.Duration(sleep) * time.Millisecond) 17 | } 18 | 19 | wait.Done() 20 | } 21 | 22 | func main() { 23 | wait := new(sync.WaitGroup) 24 | wait.Add(1) 25 | wait.Add(1) 26 | go demo(1, wait) 27 | go demo(2, wait) 28 | 29 | wait.Wait() 30 | } 31 | -------------------------------------------------------------------------------- /_fixtures/http_server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func main() { 9 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 10 | fmt.Fprintf(w, "hello world") 11 | }) 12 | http.ListenAndServe(":0", nil) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/ifaceembcall.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | type A struct { 6 | a int 7 | } 8 | 9 | type B struct { 10 | *A 11 | } 12 | 13 | type Iface interface { 14 | PtrReceiver() string 15 | NonPtrReceiver() string 16 | } 17 | 18 | func (*A) PtrReceiver() string { 19 | return "blah" 20 | } 21 | 22 | func (A) NonPtrReceiver() string { 23 | return "blah" 24 | } 25 | 26 | func main() { 27 | var iface Iface = &B{&A{1}} 28 | s := iface.PtrReceiver() 29 | s = iface.NonPtrReceiver() 30 | fmt.Printf("%s\n", s) 31 | } 32 | -------------------------------------------------------------------------------- /_fixtures/increment.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | // Increment Natural number y 6 | func Increment(y uint) uint { 7 | if y == 0 { 8 | return 1 9 | } 10 | if y%2 == 1 { 11 | return (2 * Increment(y/2)) 12 | } 13 | return y + 1 14 | } 15 | 16 | func main() { 17 | fmt.Printf("%d\n", Increment(3)) 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/inlinestripped.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callme(i int) int { 6 | return i * i 7 | } 8 | 9 | func main() { 10 | j := 0 11 | j += callme(2) 12 | fmt.Println(j) 13 | fmt.Println(j + 1) 14 | fmt.Println(j + 2) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/integrationprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func sayhi() { 9 | fmt.Println("hi") 10 | } 11 | 12 | func main() { 13 | time.Sleep(1 * time.Second) 14 | for i := 0; i < 3; i++ { 15 | sayhi() 16 | time.Sleep(1 * time.Second) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/internal/dir.io/dir.go: -------------------------------------------------------------------------------- 1 | package dirio 2 | 3 | type SomeType struct { 4 | X int 5 | } 6 | 7 | var A string = "something" 8 | 9 | func SomeFunction() { 10 | println("hello world") 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/internal/dir.io/io.io/io.go: -------------------------------------------------------------------------------- 1 | package ioio 2 | 3 | type SomeOtherType struct { 4 | Y int 5 | } 6 | -------------------------------------------------------------------------------- /_fixtures/internal/dir0/pkg/main.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | var A = 0 4 | 5 | type SomeType struct { 6 | X float64 7 | } 8 | 9 | func (s *SomeType) AMethod(x int) int { 10 | return x + 3 11 | } 12 | 13 | func (s *SomeType) AnotherMethod(x int) int { 14 | return x + 4 15 | } 16 | 17 | var SomeVar SomeType 18 | 19 | const ( 20 | SomeConst int = 2 21 | ) 22 | -------------------------------------------------------------------------------- /_fixtures/internal/dir0/renamedpackage/main.go: -------------------------------------------------------------------------------- 1 | package realname 2 | 3 | type SomeType struct { 4 | A bool 5 | } 6 | -------------------------------------------------------------------------------- /_fixtures/internal/dir1/pkg/main.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | var A = 1 4 | 5 | type SomeType struct { 6 | X int 7 | Y int 8 | } 9 | -------------------------------------------------------------------------------- /_fixtures/internal/pluginsupport/pluginsupport.go: -------------------------------------------------------------------------------- 1 | package pluginsupport 2 | 3 | type Something interface { 4 | Callback(int) int 5 | } 6 | 7 | type SomethingElse interface { 8 | Callback2(int, int) float64 9 | } 10 | -------------------------------------------------------------------------------- /_fixtures/is sue239.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func fibonacci(n int, c chan int) { 8 | x, y := 0, 1 9 | for i := 0; i < n; i++ { 10 | c <- x 11 | x, y = y, x+y 12 | } 13 | close(c) 14 | } 15 | 16 | func main() { 17 | a := struct { // set breakpoint here 18 | A string 19 | B int 20 | }{A: "demo", B: 10} 21 | fmt.Printf("%#v\n", a) 22 | 23 | c := make(chan int, 10) 24 | go fibonacci(cap(c), c) 25 | for i := range c { 26 | fmt.Println(i) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/issue1101.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "sync" 6 | ) 7 | 8 | var wg sync.WaitGroup 9 | 10 | func f(from string) { 11 | defer wg.Done() 12 | return 13 | } 14 | 15 | func main() { 16 | wg.Add(1) 17 | go f("goroutine") 18 | wg.Wait() 19 | os.Exit(2) 20 | } 21 | -------------------------------------------------------------------------------- /_fixtures/issue1264.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | for i := 0; i < 4; i++ { 7 | equalsTwo := i == 2 8 | fmt.Printf("i: %d -> equalsTwo: %t \n", i, equalsTwo) // :8 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_fixtures/issue1374.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | i := getNum() 7 | fmt.Println(i) 8 | } 9 | 10 | func getNum() int { 11 | return 0 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/issue1432.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "runtime" 4 | 5 | type s struct { 6 | i int64 7 | } 8 | 9 | func main() { 10 | i := 1 11 | p := &i 12 | s := s{i: 1} 13 | _ = s 14 | runtime.Breakpoint() 15 | println(i, p) 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/issue1469.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "time" 4 | 5 | func main() { 6 | for i := 0; i < 5; i++ { 7 | go func() { 8 | time.Sleep(11 * time.Millisecond) 9 | }() 10 | } 11 | 12 | x := 255 13 | println(x) //break 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/issue1531.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | type W struct { 9 | x int 10 | y int 11 | } 12 | 13 | func main() { 14 | testMaps() 15 | } 16 | 17 | func testMaps() { 18 | 19 | m := make(map[string]W) 20 | 21 | m["t"] = W{} 22 | m["s"] = W{} 23 | m["r"] = W{} 24 | m["v"] = W{} 25 | 26 | mm := map[string]W{ 27 | "r": {}, 28 | "s": {}, 29 | "t": {}, 30 | "v": {}, 31 | } 32 | 33 | delete(mm, "s") 34 | delete(m, "t") 35 | runtime.Breakpoint() 36 | fmt.Println(m, mm) 37 | } 38 | -------------------------------------------------------------------------------- /_fixtures/issue1549.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | sum := int64(0) 10 | start := time.Now() 11 | for value := int64(0); value < 10000; value++ { 12 | sum += value 13 | } 14 | elapsed := time.Since(start) 15 | fmt.Printf("Sum: %d\nTook %s\n", sum, elapsed) 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/issue1598.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | a := x() 5 | println(a) //break here 6 | } 7 | 8 | func x() string { 9 | return `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut 10 | labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut 11 | aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum 12 | dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui 13 | officia deserunt mollit anim id est laborum.` 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/issue1601.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | ) 6 | 7 | /* 8 | typedef struct Qst Q1; 9 | typedef const Q1 Q; 10 | struct Qst { 11 | Q *q; 12 | }; 13 | 14 | const Q1 globalq; 15 | */ 16 | import "C" 17 | 18 | func main() { 19 | runtime.Breakpoint() 20 | } 21 | -------------------------------------------------------------------------------- /_fixtures/issue1615.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var strings = []string{ 4 | "one", 5 | "two", 6 | "three", 7 | "four", 8 | "projects/my-gcp-project-id-string/locations/us-central1/queues/my-task-queue-name", 9 | "five", 10 | "six", 11 | } 12 | 13 | func f(s string) { 14 | // ... 15 | } 16 | 17 | func main() { 18 | for _, s := range strings { 19 | f(s) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/issue1656/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var g int = 0 8 | 9 | func compromised(n int64) 10 | 11 | //go:nosplit 12 | func skipped() { 13 | g++ 14 | } 15 | 16 | func main() { 17 | compromised(1) 18 | fmt.Printf("%d\n", g) 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/issue1656/main.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·compromised(SB),NOSPLIT,$0-8 4 | CMPQ n+0(FP), $0 5 | JNZ notzero 6 | RET 7 | notzero: 8 | MOVQ $0, AX 9 | MOVQ $1, AX 10 | CALL main·skipped(SB) 11 | RET 12 | -------------------------------------------------------------------------------- /_fixtures/issue1795.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "runtime" 7 | ) 8 | 9 | func main() { 10 | r := regexp.MustCompile("ab") 11 | runtime.Breakpoint() 12 | out := r.MatchString("blah") 13 | fmt.Printf("%v\n", out) 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/issue1817.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "unsafe" 7 | ) 8 | 9 | func main() { 10 | l := int(51) 11 | bs := make([]byte, l) 12 | for i := 0; i < l; i++ { 13 | bs[i] = byte(i + int(10)) 14 | } 15 | 16 | p := uintptr(unsafe.Pointer(&bs)) 17 | 18 | fmt.Println(p) 19 | 20 | bs[0] = 254 21 | 22 | runtime.KeepAlive(bs) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/issue2023.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func A() { 9 | fmt.Printf("hello delve\n") 10 | } 11 | 12 | func main() { 13 | count := 0 14 | for { 15 | A() 16 | time.Sleep(time.Millisecond * time.Duration(100)) 17 | if count >= 30 { 18 | break 19 | } 20 | count++ 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/issue2078.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | f(nil) //break 5 | println("ok") 6 | } 7 | 8 | func f(x *int) { 9 | println(*x) 10 | } 11 | -------------------------------------------------------------------------------- /_fixtures/issue2086.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | ) 6 | 7 | var i int 8 | 9 | type T struct{} 10 | 11 | func (t T) m() { stop() } 12 | 13 | func stop() { 14 | runtime.Breakpoint() 15 | i++ 16 | } 17 | 18 | func main() { T{}.m() } 19 | -------------------------------------------------------------------------------- /_fixtures/issue2113.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "sync" 7 | ) 8 | 9 | func coroutine(i int, start, finish *sync.WaitGroup) { 10 | defer finish.Done() 11 | 12 | j := i * 2 13 | 14 | if i == 99 { 15 | runtime.Breakpoint() 16 | start.Done() 17 | } else { 18 | start.Wait() 19 | } 20 | 21 | fmt.Println("hello ", i, j) 22 | fmt.Println("goodbye", i, j) 23 | } 24 | 25 | func main() { 26 | i := 0 27 | var start, finish sync.WaitGroup 28 | start.Add(1) 29 | for ; i < 100; i++ { 30 | finish.Add(1) 31 | go coroutine(i, &start, &finish) 32 | } 33 | finish.Wait() 34 | println(i) 35 | } 36 | -------------------------------------------------------------------------------- /_fixtures/issue2138.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | func main() { 8 | time.Sleep(time.Hour) 9 | println("ok") 10 | } 11 | -------------------------------------------------------------------------------- /_fixtures/issue2162.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("test dlv") 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/issue2319/asm-linux-amd64.s: -------------------------------------------------------------------------------- 1 | 2 | #include "textflag.h" 3 | 4 | TEXT ·cfunc(SB),$0 5 | JMP Cfunc(SB) 6 | -------------------------------------------------------------------------------- /_fixtures/issue2319/cfile-linux-amd64.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/_fixtures/issue2319/cfile-linux-amd64.syso -------------------------------------------------------------------------------- /_fixtures/issue2319/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func cfunc() 4 | 5 | func main() { 6 | cfunc() 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/issue262.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func typicalFunction() (res int) { 6 | defer func() { 7 | res = 2 8 | return 9 | }() 10 | res = 10 11 | return // setup breakpoint here 12 | } 13 | 14 | func main() { 15 | fmt.Println(typicalFunction()) 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/issue2896.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // Vehicle defines the vehicle behavior 4 | type Vehicle interface { 5 | // Run vehicle can run in a speed 6 | Run() 7 | } 8 | 9 | // BMWS1000RR defines the motorcycle bmw s1000rr 10 | type BMWS1000RR struct { 11 | } 12 | 13 | // Run bwm s1000rr run 14 | func (a *BMWS1000RR) Run() { 15 | println("I can run at 300km/h") 16 | } 17 | 18 | func main() { 19 | var vehicle Vehicle = &BMWS1000RR{} 20 | vehicle.Run() 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/issue305.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | for i := 0; i < 10; i++ { 5 | println(i) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/issue3194.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | #cgo LDFLAGS: -framework CoreFoundation 5 | #cgo LDFLAGS: -framework CFNetwork 6 | #include 7 | */ 8 | import "C" 9 | import "fmt" 10 | 11 | func main() { 12 | f() // break here 13 | } 14 | 15 | func f() { 16 | fmt.Println("ok") 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/issue3310.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | var i = 2 9 | var val = reflect.ValueOf(i) 10 | 11 | func reflectFunc(value reflect.Value) { 12 | fmt.Printf("%s\n", value.Type().Name()) 13 | } 14 | 15 | func main() { 16 | reflectFunc(val) 17 | fmt.Println(&i) 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/issue332.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | m := make([]string, 1, 25) 7 | fmt.Println(m) // [ ] 8 | changeMe(m) 9 | fmt.Println(m) // [Todd] 10 | } 11 | 12 | func changeMe(z []string) { 13 | z[0] = "Todd" 14 | fmt.Println(z) // [Todd] 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/issue3548.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Thing struct { 8 | str string 9 | } 10 | 11 | func (d *Thing) Test() bool { 12 | return d != nil 13 | } 14 | 15 | func callit(f func()) { 16 | f() 17 | } 18 | 19 | func main() { 20 | cases := []struct { 21 | name string 22 | thing Thing 23 | }{ 24 | { 25 | name: "Success", 26 | thing: Thing{str: "hello"}, 27 | }, 28 | } 29 | 30 | for _, c := range cases { 31 | callit(func() { 32 | fmt.Println("hello", c.thing.Test()) 33 | }) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /_fixtures/issue384.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | func main() { 9 | type S struct { 10 | F string `species:"gopher" color:"blue"` 11 | } 12 | 13 | s := S{} 14 | st := reflect.TypeOf(s) 15 | field := st.Field(0) 16 | fmt.Println(field.Tag.Get("color"), field.Tag.Get("species")) 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/issue387.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | func dostuff(id int, wg *sync.WaitGroup) { 9 | fmt.Println("goroutine:", id) 10 | fmt.Println("goroutine:", id) 11 | wg.Done() 12 | } 13 | 14 | func main() { 15 | var wg sync.WaitGroup 16 | wg.Add(10) 17 | for i := 0; i < 10; i++ { 18 | go dostuff(i, &wg) 19 | } 20 | wg.Wait() 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/issue419.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/signal" 7 | ) 8 | 9 | func main() { 10 | 11 | fmt.Println("Start") 12 | 13 | sc := make(chan os.Signal, 1) 14 | 15 | //os.Interrupt, os.Kill 16 | signal.Notify(sc, os.Interrupt, os.Kill) 17 | 18 | quit := <-sc 19 | 20 | fmt.Printf("Receive signal %s \n", quit.String()) 21 | 22 | fmt.Println("End") 23 | 24 | } 25 | -------------------------------------------------------------------------------- /_fixtures/issue528.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/go-delve/liner" 6 | ) 7 | 8 | func main() { 9 | line := liner.NewLiner() 10 | line.Close() 11 | fmt.Printf("test\n") 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/issue561.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func testfunction() { 6 | fmt.Printf("here!\n") 7 | } 8 | 9 | func main() { 10 | testfunction() 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/issue573.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // A debugger test. 4 | // dlv debug 5 | // b main.foo 6 | // c 7 | // s 8 | // s 9 | // Expect to be stopped in fmt.Printf or runtime.duffzero 10 | // In bug, s #2 runs to the process exit because the call 11 | // to duffzero enters duffzero well after the nominal entry 12 | // and skips the internal breakpoint placed by Step(). 13 | import "fmt" 14 | 15 | var v int = 99 16 | 17 | func foo(x, y int) (z int) { // c stops here 18 | fmt.Printf("x=%d, y=%d, z=%d\n", x, y, z) // s #1 stops here; s #2 is supposed to stop in Printf or duffzero. 19 | z = x + y 20 | return 21 | } 22 | 23 | func main() { 24 | x := v 25 | y := x * x 26 | z := foo(x, y) 27 | fmt.Printf("z=%d\n", z) 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/issue594.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func dontsegfault() { 9 | var p *int 10 | func() int { 11 | defer func() { 12 | recover() 13 | }() 14 | return *p 15 | }() 16 | } 17 | 18 | func main() { 19 | dontsegfault() 20 | runtime.Breakpoint() 21 | fmt.Println("should stop here") 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/issue664.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func asdfasdf() { 4 | for i := 0; i < 5; i++ { 5 | for i := 0; i < 5; i++ { 6 | //... 7 | } 8 | //... 9 | } 10 | } 11 | 12 | func main() { 13 | asdfasdf() 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/issue683.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("adssd") // put a breakpoint here 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/issue871.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | a := [3]int{1, 2, 3} 10 | b := &a 11 | runtime.Breakpoint() 12 | fmt.Println(b, *b) // set breakpoint here 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/issue877.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "runtime" 7 | ) 8 | 9 | func main() { 10 | dyldenv := os.Getenv("DYLD_LIBRARY_PATH") 11 | runtime.Breakpoint() 12 | fmt.Println(dyldenv) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/issue951.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | shadow(42) 10 | } 11 | 12 | func shadow(i int) { 13 | for i := 0; i < 5; i++ { 14 | for i := 20; i < 25; i++ { 15 | runtime.Breakpoint() 16 | fmt.Println("another shadow", i) 17 | } 18 | fmt.Println("shadow", i) 19 | } 20 | fmt.Println("arg", i) 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/leaf4.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func D(i int) int { 6 | return i * i * i 7 | } 8 | func C(i int) int { 9 | 10 | return i + 20 11 | } 12 | func B(i int) int { 13 | d := C(i) + 40 14 | return d + D(i) 15 | } 16 | func A(i int) int { 17 | return 10 + B(i) 18 | } 19 | func main() { 20 | j := 0 21 | j += A(2) 22 | fmt.Println(j) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/leafcommon.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func D(i int) int { 6 | return i * i * i 7 | } 8 | func C(i int) int { 9 | 10 | return D(i+10) + 20 11 | } 12 | func B(i int) int { 13 | return i * D(i) 14 | } 15 | func A(i int) int { 16 | d := 10 + B(i) 17 | return d + C(i) 18 | } 19 | func main() { 20 | j := 0 21 | j += A(2) 22 | fmt.Println(j) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/leafindrec.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func B(i int) int { 6 | if i > 0 { 7 | return A(i - 1) 8 | } else { 9 | return 0 10 | } 11 | } 12 | func A(n int) int { 13 | if n <= 1 { 14 | return n 15 | } else { 16 | return B(n - 3) 17 | } 18 | } 19 | func main() { 20 | j := 0 21 | j += B(12) 22 | fmt.Println(j) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/leafrec.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func A(i int, n int) int { 6 | if n == 1 { 7 | return i 8 | } else { 9 | n-- 10 | return (i * A(i-1, n)) 11 | } 12 | } 13 | func main() { 14 | j := 0 15 | j += A(5, 5) 16 | fmt.Println(j) 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/leafregex.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callmed(i int) int { 6 | return i * i * i 7 | } 8 | func callmee(i int) int { 9 | 10 | return i + 20 11 | } 12 | func callme2(i int) int { 13 | d := callmee(i) + 40 14 | return d + callmed(i) 15 | } 16 | func callme(i int) int { 17 | return 10 + callme2(i) 18 | } 19 | func main() { 20 | j := 0 21 | j += callme(2) 22 | fmt.Println(j) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/linked_list.star: -------------------------------------------------------------------------------- 1 | def command_linked_list(args): 2 | """Prints the contents of a linked list. 3 | 4 | linked_list 5 | 6 | Prints up to max_depth elements of the linked list variable 'var_name' using 'next_field_name' as the name of the link field. 7 | """ 8 | var_name, next_field_name, max_depth = args.split(" ") 9 | max_depth = int(max_depth) 10 | next_name = var_name 11 | v = eval(None, var_name).Variable.Value 12 | for i in range(0, max_depth): 13 | print(str(i)+":",v) 14 | if v[0] == None: 15 | break 16 | v = v[next_field_name] 17 | -------------------------------------------------------------------------------- /_fixtures/livetestprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "runtime" 7 | "time" 8 | ) 9 | 10 | func printPid(pid int) { 11 | fmt.Println(pid) 12 | } 13 | 14 | func sayhi() { 15 | fmt.Println("hi") 16 | } 17 | 18 | func main() { 19 | runtime.LockOSThread() 20 | pid := os.Getpid() 21 | printPid(pid) 22 | time.Sleep(10 * time.Second) 23 | 24 | for { 25 | printPid(pid) 26 | sayhi() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/locationsUpperCase.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("test") 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/locationsprog2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func afunction(s string) { 9 | fmt.Println(s) 10 | } 11 | 12 | type someStruct struct { 13 | s string 14 | } 15 | 16 | func (o *someStruct) structfunc(s2 string) { 17 | fmt.Println(o.s, s2) 18 | } 19 | 20 | func main() { 21 | fn1 := afunction 22 | var o someStruct 23 | fn2 := o.structfunc 24 | fn3 := func(s string) { 25 | fmt.Println("inline", s) 26 | } 27 | runtime.Breakpoint() 28 | fn1("test") 29 | afunction("test") 30 | fmt.Println(fn1, fn2, fn3, o) 31 | } 32 | -------------------------------------------------------------------------------- /_fixtures/locationsprog3.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "runtime" 7 | ) 8 | 9 | func main() { 10 | runtime.Breakpoint() 11 | fmt.Println(rand.Intn(10)) 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/locationsprog_generic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | type ParamReceiver[T any] struct { 6 | field T 7 | } 8 | 9 | func (r *ParamReceiver[T]) Amethod() { 10 | fmt.Printf("%v\n", r.field) 11 | } 12 | 13 | func ParamFunc[T any](arg T) { 14 | fmt.Printf("%v\n", arg) 15 | } 16 | 17 | func main() { 18 | var x ParamReceiver[int] 19 | var y ParamReceiver[float64] 20 | x.Amethod() 21 | y.Amethod() 22 | ParamFunc[int](2) 23 | ParamFunc[float32](2) 24 | } 25 | -------------------------------------------------------------------------------- /_fixtures/longstrings.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | ) 6 | 7 | func buildString(length int) string { 8 | s := "" 9 | for i := 0; i < length; i++ { 10 | s = s + "x" 11 | } 12 | return s 13 | } 14 | 15 | func main() { 16 | s513 := buildString(513) 17 | s1025 := buildString(1025) 18 | s4097 := buildString(4097) 19 | nested := map[int]string{513: s513, 1025: s1025, 4097: s4097} 20 | runtime.Breakpoint() 21 | _ = nested 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/loopprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func loop() { 6 | i := 0 7 | for { 8 | i++ 9 | if (i % 1000000) == 0 { 10 | fmt.Println(i) 11 | } 12 | } 13 | fmt.Println(i) 14 | } 15 | 16 | func main() { 17 | fmt.Println("past main") 18 | loop() 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/math.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "math" 4 | 5 | var f = 1.5 6 | 7 | func main() { 8 | floatvar1 := math.Floor(f) 9 | floatvar2 := float64(int(f)) 10 | _ = floatvar1 11 | _ = floatvar2 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/morestringarg.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func f(s, q string) { 6 | fmt.Println(s) 7 | } 8 | 9 | func main() { 10 | f("very long string 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789X", "very long string B 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789X2") 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/nextcond.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var n = 10 4 | 5 | func f1(x int) { 6 | } 7 | 8 | func main() { 9 | f1(n) 10 | f1(n) 11 | f1(n) 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/nilptr.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | var p_value *int = nil 5 | *p_value = 1 6 | } 7 | -------------------------------------------------------------------------------- /_fixtures/nodisasm/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func asmFunc() 4 | 5 | func main() { 6 | asmFunc() 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/nodisasm/nodisasm_amd64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-0 4 | MOVQ AX, AX 5 | MOVQ AX, AX 6 | MOVQ AX, AX 7 | MOVSS (AX), X2 8 | VBROADCASTSS X2, X2 9 | VMOVDQU (AX), X3 10 | MOVSS (AX), X1 11 | PUNPCKLBW X0, X1 12 | VPUNPCKLWD X0, X1, X1 13 | MOVQ AX, AX 14 | MOVQ AX, AX 15 | MOVQ AX, AX 16 | RET 17 | -------------------------------------------------------------------------------- /_fixtures/nomaindir/file.go: -------------------------------------------------------------------------------- 1 | package nomaindir 2 | 3 | func AFunction() { 4 | } 5 | -------------------------------------------------------------------------------- /_fixtures/nopbreakpoint/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var g int = 0 8 | 9 | func compromised() 10 | 11 | func skipped() { 12 | g++ 13 | } 14 | 15 | func main() { 16 | compromised() 17 | fmt.Printf("%d\n", g) 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/nopbreakpoint/main.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·compromised(SB),NOSPLIT,$0-0 4 | BYTE $0x90 // The assembler strips NOP, this is a hardcoded NOP instruction 5 | CALL main·skipped(SB) 6 | RET 7 | -------------------------------------------------------------------------------- /_fixtures/notify-v2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "net/http" 7 | "sync" 8 | ) 9 | 10 | func main() { 11 | http.HandleFunc("/test", func(w http.ResponseWriter, req *http.Request) { 12 | go func() { 13 | // I know this is wrong, it is just to simulate a deadlocked goroutine 14 | fmt.Println("locking...") 15 | mtx := &sync.Mutex{} 16 | mtx.Lock() 17 | mtx.Lock() 18 | fmt.Println("will never print this") 19 | }() 20 | }) 21 | 22 | log.Fatalln(http.ListenAndServe("127.0.0.1:8888", nil)) 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/out_redirect.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func main() { 9 | fmt.Println("hello world!") 10 | fmt.Fprintf(os.Stdout, "hello world!") 11 | fmt.Fprintf(os.Stderr, "hello world!\n") 12 | fmt.Fprintf(os.Stderr, "hello world! error!") 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/panic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | msg := "BOOM!" 5 | panic(msg) 6 | } 7 | -------------------------------------------------------------------------------- /_fixtures/panicex.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func F0() { 4 | defer func() { 5 | recover() 6 | }() 7 | F1() 8 | } 9 | 10 | func F1() { 11 | F2() 12 | } 13 | 14 | func F2() { 15 | F3() 16 | } 17 | 18 | func F3() { 19 | F4() 20 | } 21 | 22 | func F4() { 23 | panic("blah") 24 | } 25 | 26 | func main() { 27 | F0() 28 | } 29 | -------------------------------------------------------------------------------- /_fixtures/panicline.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "os" 4 | 5 | func main() { 6 | fi, _ := os.Lstat("/this/path/does/not/exist") 7 | fi.Size() 8 | } 9 | -------------------------------------------------------------------------------- /_fixtures/parallel_next.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | func sayhi(n int, wg *sync.WaitGroup) { 9 | fmt.Println("hi", n) 10 | fmt.Println("hi", n) 11 | wg.Done() 12 | } 13 | 14 | func main() { 15 | var wg sync.WaitGroup 16 | wg.Add(10) 17 | for i := 0; i < 10; i++ { 18 | go sayhi(i, &wg) 19 | } 20 | wg.Wait() 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/plugin1/plugin1.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func Fn1() string { 6 | return "hello" 7 | } 8 | 9 | func HelloFn(n int) string { 10 | n++ 11 | s := fmt.Sprintf("hello%d", n) 12 | return s 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/plugin2/plugin2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/go-delve/delve/_fixtures/internal/pluginsupport" 6 | ) 7 | 8 | func Fn2() string { 9 | return "world" 10 | } 11 | 12 | type asomethingelse struct { 13 | x, y float64 14 | } 15 | 16 | func (a *asomethingelse) Callback2(n, m int) float64 { 17 | r := a.x + 2*a.y 18 | r += float64(n) / float64(m) 19 | return r 20 | } 21 | 22 | func TypesTest(s pluginsupport.Something) pluginsupport.SomethingElse { 23 | if A != nil { 24 | aIsNotNil(fmt.Sprintf("%s", A)) 25 | } 26 | return &asomethingelse{1.0, float64(s.Callback(2))} 27 | } 28 | 29 | var A interface{} 30 | 31 | func aIsNotNil(str string) { 32 | // nothing here 33 | } 34 | -------------------------------------------------------------------------------- /_fixtures/plugintest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "plugin" 7 | "runtime" 8 | ) 9 | 10 | func must(err error) { 11 | if err != nil { 12 | panic(err) 13 | } 14 | } 15 | 16 | func main() { 17 | plug1, err := plugin.Open(os.Args[1]) 18 | must(err) 19 | 20 | runtime.Breakpoint() 21 | 22 | plug2, err := plugin.Open(os.Args[2]) 23 | must(err) 24 | 25 | runtime.Breakpoint() 26 | 27 | fn1, err := plug1.Lookup("Fn1") 28 | must(err) 29 | fn2, err := plug2.Lookup("Fn2") 30 | must(err) 31 | 32 | a := fn1.(func() string)() 33 | b := fn2.(func() string)() 34 | 35 | fmt.Println(plug1, plug2, fn1, fn2, a, b) 36 | } 37 | -------------------------------------------------------------------------------- /_fixtures/pr1055.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "go/ast" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | a := &ast.CompositeLit{} 11 | fmt.Println("demo", a) // set breakpoint here and use next twice 12 | os.Exit(2) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/redirect-input.txt: -------------------------------------------------------------------------------- 1 | Redirect test -------------------------------------------------------------------------------- /_fixtures/redirect.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "time" 8 | ) 9 | 10 | func main() { 11 | buf, _ := ioutil.ReadAll(os.Stdin) 12 | fmt.Fprintf(os.Stdout, "%s %v\n", buf, time.Now()) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/reflecttypefncall.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | func reflectFunc(value reflect.Value) { 9 | fmt.Printf("%s\n", value.Type().Name()) 10 | } 11 | 12 | func main() { 13 | i := 2 14 | val := reflect.ValueOf(i) 15 | reflectFunc(val) 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/restartargs.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | var args []string 9 | 10 | func printArgs(){ 11 | fmt.Printf("Args2: %#v\n", args) 12 | } 13 | 14 | func main() { 15 | args = os.Args[1:] 16 | printArgs() 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/retstack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "runtime" 4 | import "fmt" 5 | 6 | func f() { 7 | runtime.Breakpoint() 8 | } 9 | 10 | func g() int { 11 | runtime.Breakpoint() 12 | return 3 13 | } 14 | 15 | func main() { 16 | f() 17 | n := g() + 1 18 | fmt.Println(n) 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/scopeescapevareval.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | a := 2 10 | { 11 | a := 3 12 | p := &a 13 | runtime.Breakpoint() 14 | fmt.Println(a, p) 15 | } 16 | fmt.Println(a) 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/setymmreg/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func asmFunc() 4 | 5 | func main() { 6 | asmFunc() 7 | } 8 | -------------------------------------------------------------------------------- /_fixtures/setymmreg/setymmreg_amd64.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·asmFunc(SB),0,$0-0 4 | XORQ AX, AX 5 | XORQ AX, AX 6 | XORQ AX, AX 7 | XORQ AX, AX 8 | XORQ AX, AX 9 | RET 10 | -------------------------------------------------------------------------------- /_fixtures/sigchldprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "os/exec" 8 | ) 9 | 10 | func main() { 11 | cmd := exec.Command("date") 12 | reader, err := cmd.StdoutPipe() 13 | if err != nil { 14 | log.Fatalln(err) 15 | } 16 | defer reader.Close() 17 | 18 | scanner := bufio.NewScanner(reader) 19 | go func() { 20 | for scanner.Scan() { 21 | fmt.Println(scanner.Text()) 22 | } 23 | }() 24 | cmd.Start() 25 | cmd.Wait() 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/sleep.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "time" 6 | ) 7 | 8 | func f() { 9 | for { 10 | time.Sleep(10 * time.Second) 11 | if len(os.Args) > 1 { 12 | break 13 | } 14 | } 15 | } 16 | 17 | func main() { 18 | f() 19 | } 20 | -------------------------------------------------------------------------------- /_fixtures/spawnchild.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func traceme5() { 6 | fmt.Println("hello world") 7 | } 8 | 9 | func main() { 10 | for i := 0; i < 3; i++ { 11 | println(i) // b spawnchild.go:11 if i == 1 12 | } 13 | traceme5() 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/stacktraceprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func stacktraceme() { 4 | return 5 | } 6 | 7 | func func1() { 8 | stacktraceme() 9 | } 10 | 11 | func func2(f func()) { 12 | f() 13 | } 14 | 15 | func main() { 16 | func1() 17 | func2(func1) 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/stackwatchbug.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func multiRound() { 8 | vars := []int{0, 1, 2, 3, 4, 5} 9 | for i := range vars { // line 9: set watchpoints 10 | if i > 0 { 11 | vars[i] = vars[i-1] 12 | fmt.Println() // line 12: watchpoints hit 13 | } 14 | } 15 | } 16 | 17 | func main() { 18 | multiRound() // line 18: after restart, last watchpoint out of scope 19 | return // line 19: all watchpoints should go out of scope 20 | } 21 | -------------------------------------------------------------------------------- /_fixtures/starlark_map_iteration.star: -------------------------------------------------------------------------------- 1 | v = eval(None, "m1").Variable 2 | n = 0 3 | d = {} 4 | for k in v.Value: 5 | if not d.get(k): 6 | n = n + 1 7 | d[k] = True 8 | print("values=", n, sep="") 9 | -------------------------------------------------------------------------------- /_fixtures/stepintobug.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | type T struct { 4 | } 5 | 6 | func main() { 7 | t := T{} 8 | f1 := t.m1 9 | println(f1(1)) //break 10 | } 11 | 12 | func (t T) m1(x int) int { 13 | return x + 1 14 | } 15 | -------------------------------------------------------------------------------- /_fixtures/stepoutret.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func stepout(n int) (str string, num int) { 6 | return fmt.Sprintf("return %d", n), n + 1 7 | } 8 | 9 | func main() { 10 | stepout(47) 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/stepshadow.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | func main() { 9 | var wg sync.WaitGroup 10 | wg.Add(1) 11 | go goroutineA(&wg) 12 | f := stacktraceme1 13 | for i := 0; i < 100; i++ { 14 | fmt.Printf("main %d\n", i) 15 | f() 16 | } 17 | wg.Wait() 18 | } 19 | 20 | func goroutineA(wg *sync.WaitGroup) { 21 | defer wg.Done() 22 | for i := 0; i < 100; i++ { 23 | stacktraceme2() 24 | } 25 | } 26 | 27 | func stacktraceme1() { 28 | } 29 | 30 | func stacktraceme2() { 31 | } 32 | -------------------------------------------------------------------------------- /_fixtures/switch_to_main_goroutine.star: -------------------------------------------------------------------------------- 1 | def command_switch_to_main_goroutine(args): 2 | for g in goroutines().Goroutines: 3 | if g.CurrentLoc.Function != None and g.CurrentLoc.Function.Name_.startswith("main."): 4 | print("switching to:", g.ID) 5 | raw_command("switchGoroutine", GoroutineID=g.ID) 6 | break 7 | -------------------------------------------------------------------------------- /_fixtures/test if path/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | println("here") 5 | } 6 | -------------------------------------------------------------------------------- /_fixtures/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) { 4 | printf("hello world!"); 5 | } 6 | -------------------------------------------------------------------------------- /_fixtures/testargs.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func main() { 9 | // this test expects AT LEAST 1 argument, and the first one needs to be "test". 10 | // second one is optional but if given, it should be "-passFlag" 11 | fmt.Printf("received args %#v\n", os.Args) 12 | if len(os.Args) < 2 { 13 | panic("os.args too short!") 14 | } else if os.Args[1] != "test" { 15 | panic("os.args[1] is not test!") 16 | } 17 | if len(os.Args) >= 3 && os.Args[2] != "pass flag" { 18 | panic("os.args[2] is not \"pass flag\"!") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_fixtures/testdeadlock.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | ch1 := make(chan string) 5 | ch2 := make(chan string) 6 | go func() { 7 | <-ch1 8 | ch2 <- "done" 9 | }() 10 | <-ch2 11 | ch1 <- "done" 12 | } 13 | -------------------------------------------------------------------------------- /_fixtures/testenv.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "runtime" 7 | ) 8 | 9 | func main() { 10 | x, y := os.LookupEnv("SOMEVAR") 11 | runtime.Breakpoint() 12 | fmt.Printf("SOMEVAR=%s\n%v", x, y) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/testfnpos1.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func f1() { 6 | fmt.Printf("f1\n") 7 | } 8 | 9 | func f2() { 10 | fmt.Printf("f2\n") 11 | } 12 | 13 | func main() { 14 | f1() 15 | f2() 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/testfnpos2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func f2() { 6 | fmt.Printf("f2\n") 7 | } 8 | 9 | func f1() { 10 | fmt.Printf("f1\n") 11 | } 12 | 13 | func main() { 14 | f1() 15 | f2() 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/testinline.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func inlineThis(a int) int { 6 | z := a * a 7 | return f(z + a) 8 | } 9 | 10 | func initialize(a, b *int) { 11 | *a = 3 12 | *b = 4 13 | } 14 | 15 | func main() { 16 | var a, b int 17 | initialize(&a, &b) 18 | a = inlineThis(a) 19 | b = inlineThis(b) 20 | fmt.Printf("%d %d\n", a, b) 21 | } 22 | 23 | //go:noinline 24 | func f(x int) int { 25 | return x 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/testnextdefer.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | defer func() { 7 | fmt.Println("hi") 8 | }() 9 | fmt.Println("bye") 10 | } 11 | -------------------------------------------------------------------------------- /_fixtures/testnextnethttp.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { 10 | runtime.Breakpoint() 11 | msg := "hello, world!" 12 | header := w.Header().Get("Content-Type") 13 | w.Write([]byte(msg + header)) 14 | }) 15 | http.HandleFunc("/nobp", func(w http.ResponseWriter, req *http.Request) { 16 | msg := "hello, world!" 17 | header := w.Header().Get("Content-Type") 18 | w.Write([]byte(msg + header)) 19 | }) 20 | err := http.ListenAndServe(":9191", nil) 21 | if err != nil { 22 | panic(err) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /_fixtures/testprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "time" 7 | ) 8 | 9 | func helloworld() { 10 | fmt.Println("Hello, World!") 11 | } 12 | 13 | func sleepytime() { 14 | time.Sleep(time.Millisecond) 15 | } 16 | 17 | func main() { 18 | for i := 0; i < 500; i++ { 19 | sleepytime() 20 | helloworld() 21 | } 22 | } 23 | 24 | func init() { 25 | runtime.LockOSThread() 26 | } 27 | -------------------------------------------------------------------------------- /_fixtures/testrerecord.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func main() { 9 | t := time.Now().Unix() 10 | fmt.Println(t) 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/testreturnaddress.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "sync" 4 | 5 | func doSomething(wg *sync.WaitGroup) { 6 | wg.Done() 7 | } 8 | 9 | func main() { 10 | var wg sync.WaitGroup 11 | wg.Add(2) 12 | go doSomething(&wg) 13 | go doSomething(&wg) 14 | wg.Wait() 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/testruntimebreakpoint.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | runtime.Breakpoint() 10 | fmt.Println("broke") 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/testshadow.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func main() { 9 | a := 0 10 | { 11 | a := 1 12 | runtime.Breakpoint() 13 | fmt.Println(a) 14 | } 15 | fmt.Println(a) 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/teststep.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | func callme() { 9 | fmt.Println("hi") 10 | } 11 | 12 | func main() { 13 | runtime.Breakpoint() 14 | callme() 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/teststepconcurrent.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | "sync" 7 | ) 8 | 9 | var v int = 99 10 | var wg sync.WaitGroup 11 | var s string 12 | 13 | func Foo(x, y int) (z int) { 14 | //s = fmt.Sprintf("x=%d, y=%d, z=%d\n", x, y, z) 15 | z = x + y 16 | return 17 | } 18 | 19 | func Threads(fn func(x, y int) int) { 20 | for j := 0; j < 100; j++ { 21 | wg.Add(1) 22 | go func() { 23 | for k := 0; k < 100; k++ { 24 | fn(1, 2) 25 | time.Sleep(10 * time.Millisecond) 26 | } 27 | wg.Done() 28 | }() 29 | } 30 | } 31 | 32 | func main() { 33 | x := v 34 | y := x * x 35 | var z int 36 | Threads(Foo) 37 | for i := 0; i < 100; i++ { 38 | z = Foo(x, y) 39 | } 40 | fmt.Printf("z=%d\n", z) 41 | wg.Wait() 42 | } 43 | -------------------------------------------------------------------------------- /_fixtures/teststepprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var n = 0 4 | 5 | func CallFn2(x int) { 6 | n++ 7 | } 8 | 9 | func CallFn(x int, fn func(x int)) { 10 | fn(x + 1) 11 | } 12 | 13 | func CallEface(eface interface{}) { 14 | if eface != nil { 15 | n++ 16 | } 17 | } 18 | 19 | func main() { 20 | CallFn(0, CallFn2) 21 | CallEface(n) 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/testthreads.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | func anotherthread(wg *sync.WaitGroup) { 9 | i := 1 * 5 / 39020 10 | fmt.Println(i) 11 | wg.Done() 12 | } 13 | 14 | func main() { 15 | var wg sync.WaitGroup 16 | for i := 0; i < 10; i++ { 17 | wg.Add(1) 18 | go anotherthread(&wg) 19 | } 20 | wg.Wait() 21 | } 22 | -------------------------------------------------------------------------------- /_fixtures/testtoggle.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func lineOne() { 8 | fmt.Println("lineOne function") 9 | } 10 | 11 | func lineTwo() { 12 | fmt.Println("lineTwo function") 13 | } 14 | 15 | func lineThree() { 16 | fmt.Println("lineThree function") 17 | } 18 | 19 | func main() { 20 | lineOne() 21 | lineTwo() 22 | lineThree() 23 | } 24 | -------------------------------------------------------------------------------- /_fixtures/testunsafepointers.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | "unsafe" 6 | ) 7 | 8 | func main() { 9 | // We're going to produce a pointer with a bad address. 10 | badAddr := uintptr(0x42) 11 | unsafeDanglingPtrPtr := unsafe.Pointer(badAddr) 12 | // We produce a **int, instead of more simply a *int, in order for the test 13 | // program to test more complex Delve behavior. 14 | danglingPtrPtr := (**int)(unsafeDanglingPtrPtr) 15 | _ = danglingPtrPtr 16 | runtime.Breakpoint() 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/testvariables_generic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | type astruct struct { 9 | x, y int 10 | } 11 | 12 | func testfn[T any, K comparable](arg1 T, arg2 K) { 13 | m := make(map[K]T) 14 | m[arg2] = arg1 15 | runtime.Breakpoint() 16 | fmt.Println(arg1, arg2, m) 17 | } 18 | 19 | func main() { 20 | testfn[int, float32](3, 2.1) 21 | testfn(&astruct{0, 1}, astruct{2, 3}) 22 | } 23 | -------------------------------------------------------------------------------- /_fixtures/testvariables_pointers_not_loaded.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "runtime" 4 | 5 | func main() { 6 | type StructWithInterface struct { 7 | Val any 8 | } 9 | var i int 10 | var ba = StructWithInterface{} 11 | ba.Val = &i 12 | 13 | var ptrPtr **int 14 | _ = ptrPtr 15 | 16 | runtime.Breakpoint() 17 | } 18 | -------------------------------------------------------------------------------- /_fixtures/testvariablescgo/testvariablescgo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // #cgo CFLAGS: -g -Wall -O0 -std=gnu99 4 | /* 5 | extern void testfn(void); 6 | */ 7 | import "C" 8 | 9 | func main() { 10 | C.testfn() 11 | } 12 | -------------------------------------------------------------------------------- /_fixtures/traceperf.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func PerfCheck(i, a, b, c int) { 4 | x := a - b - c 5 | _ = x 6 | } 7 | 8 | func main() { 9 | a := 1 10 | b := 1 11 | c := 1 12 | for i := 0; true; i++ { 13 | a = a * 2 14 | b = -b + i 15 | c = i * b 16 | PerfCheck(i, a, b, c) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /_fixtures/traceprog.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func callme(i int) int { 6 | return i * i 7 | } 8 | 9 | func main() { 10 | j := 0 11 | j += callme(2) 12 | fmt.Println(j) 13 | } 14 | -------------------------------------------------------------------------------- /_fixtures/watchpointInterface.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "runtime" 7 | ) 8 | 9 | func main() { 10 | var err error = errors.New("test error") 11 | fmt.Println("Error created:", err) 12 | err = errors.New("modified error") 13 | fmt.Println("Error modified:", err) 14 | runtime.Breakpoint() 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/watchpointInterfaceNil.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | func main() { 9 | var err error 10 | fmt.Println("Error created:", err) 11 | err = errors.New("modified error") 12 | fmt.Println("Error modified:", err) 13 | err = errors.New("final modified error") 14 | fmt.Println("Error modified final:", err) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/workdir.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func main() { 9 | pwd, err := os.Getwd() 10 | if err != nil { 11 | fmt.Println(err) 12 | os.Exit(1) 13 | } 14 | fmt.Println(pwd) 15 | } 16 | -------------------------------------------------------------------------------- /_fixtures/xmm0print/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | //go:noescape 6 | func VPSLLQ36(src, dst *[4]uint64) 7 | 8 | func main() { 9 | src := [4]uint64{0: 0x38180a06, 1: 0x38180a06, 2: 0x18080200, 3: 0x18080200} 10 | dst := [4]uint64{} 11 | VPSLLQ36(&src, &dst) 12 | 13 | for _, qword := range dst { 14 | fmt.Printf("%064b\n", qword) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /_fixtures/xmm0print/main.s: -------------------------------------------------------------------------------- 1 | #include "textflag.h" 2 | 3 | TEXT ·VPSLLQ36(SB), NOSPLIT, $0-16 4 | MOVQ src+0(FP), AX 5 | MOVQ dst+8(FP), BX 6 | VMOVDQU (AX), Y0 7 | VPSLLQ $36, Y0, Y0 8 | VMOVDQU Y0, (BX) 9 | RET 10 | -------------------------------------------------------------------------------- /_fixtures/zdebug_line_dwarf4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/_fixtures/zdebug_line_dwarf4 -------------------------------------------------------------------------------- /_scripts/gen-cli-docs.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package main 4 | 5 | import ( 6 | "bufio" 7 | "log" 8 | "os" 9 | 10 | "github.com/go-delve/delve/pkg/terminal" 11 | ) 12 | 13 | func main() { 14 | fh, err := os.Create("./Documentation/cli/README.md") 15 | if err != nil { 16 | log.Fatalf("could not create README.md: %v", err) 17 | } 18 | defer fh.Close() 19 | 20 | w := bufio.NewWriter(fh) 21 | defer w.Flush() 22 | 23 | commands := terminal.DebugCommands(nil) 24 | commands.WriteMarkdown(w) 25 | } 26 | -------------------------------------------------------------------------------- /_scripts/latestver.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import json 3 | import urllib.request 4 | import sys 5 | import re 6 | 7 | def splitver(x): 8 | v = re.split(r'([^\d]+)', x) 9 | v[0] = int(v[0]) 10 | if len(v) > 2: 11 | v[2] = int(v[2]) 12 | if len(v) > 4: 13 | v[4] = int(v[4]) 14 | # make rc/beta versions sort before normal versions 15 | if len(v) > 3 and v[3] == '.': 16 | v[3] = '~' 17 | elif len(v) == 3: 18 | v.append('~') 19 | return v 20 | 21 | ver = sys.argv[1] 22 | d = json.loads(urllib.request.urlopen('https://go.dev/dl/?mode=json&include=all').read()) 23 | ds = sorted(d, reverse=True, key=lambda it: splitver(it['version'][2:])) 24 | for x in ds: 25 | if x['version'][:len(ver)] == ver: 26 | print(x['version']) 27 | exit(0) 28 | -------------------------------------------------------------------------------- /_scripts/staticcheck-out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/_scripts/staticcheck-out.txt -------------------------------------------------------------------------------- /_scripts/testsign: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | codesign -s $CERT $1 3 | exec "$@" 4 | -------------------------------------------------------------------------------- /assets/delve_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/assets/delve_horizontal.png -------------------------------------------------------------------------------- /assets/delve_horizontal_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/assets/delve_horizontal_2x.png -------------------------------------------------------------------------------- /assets/delve_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/assets/delve_icon.png -------------------------------------------------------------------------------- /assets/delve_icon_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/assets/delve_icon_2x.png -------------------------------------------------------------------------------- /cmd/dlv/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/go-delve/delve/cmd/dlv/cmds" 7 | "github.com/go-delve/delve/pkg/logflags" 8 | "github.com/go-delve/delve/pkg/version" 9 | "golang.org/x/telemetry" 10 | ) 11 | 12 | // Build is the git sha of this binaries build. 13 | var Build string 14 | 15 | func main() { 16 | telemetry.Start(telemetry.Config{ 17 | ReportCrashes: true, 18 | }) 19 | 20 | if Build != "" { 21 | version.DelveVersion.Build = Build 22 | } 23 | 24 | const cgoCflagsEnv = "CGO_CFLAGS" 25 | if os.Getenv(cgoCflagsEnv) == "" { 26 | os.Setenv(cgoCflagsEnv, "-O0 -g") 27 | } else { 28 | logflags.WriteCgoFlagsWarning() 29 | } 30 | 31 | cmds.New(false).Execute() 32 | } 33 | -------------------------------------------------------------------------------- /cmd/dlv/tools.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // List packages used by _scripts 4 | 5 | import ( 6 | _ "github.com/spf13/cobra/doc" 7 | ) 8 | -------------------------------------------------------------------------------- /pkg/dwarf/frame/testdata/frame: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/pkg/dwarf/frame/testdata/frame -------------------------------------------------------------------------------- /pkg/dwarf/leb128/decode_test.go: -------------------------------------------------------------------------------- 1 | package leb128 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | ) 7 | 8 | func TestDecodeUnsigned(t *testing.T) { 9 | leb128 := bytes.NewBuffer([]byte{0xE5, 0x8E, 0x26}) 10 | 11 | n, c := DecodeUnsigned(leb128) 12 | if n != 624485 { 13 | t.Fatal("Number was not decoded properly, got: ", n, c) 14 | } 15 | 16 | if c != 3 { 17 | t.Fatal("Count not returned correctly") 18 | } 19 | } 20 | 21 | func TestDecodeSigned(t *testing.T) { 22 | sleb128 := bytes.NewBuffer([]byte{0x9b, 0xf1, 0x59}) 23 | 24 | n, c := DecodeSigned(sleb128) 25 | if n != -624485 { 26 | t.Fatal("Number was not decoded properly, got: ", n, c) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /pkg/dwarf/leb128/doc.go: -------------------------------------------------------------------------------- 1 | // Package leb128 provides encoders and decoders for The Little Endian Base 128 format. 2 | // The Little Endian Base 128 format is defined in the DWARF v4 standard, 3 | // section 7.6, page 161 and following. 4 | package leb128 5 | -------------------------------------------------------------------------------- /pkg/dwarf/line/_testdata/debug.grafana.debug.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/pkg/dwarf/line/_testdata/debug.grafana.debug.gz -------------------------------------------------------------------------------- /pkg/dwarf/parseutil_test.go: -------------------------------------------------------------------------------- 1 | package dwarf_test 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | 7 | "github.com/go-delve/delve/pkg/dwarf" 8 | ) 9 | 10 | func TestReadString(t *testing.T) { 11 | bstr := bytes.NewBuffer([]byte{'h', 'i', 0x0, 0xFF, 0xCC}) 12 | str, _ := dwarf.ReadString(bstr) 13 | 14 | if str != "hi" { 15 | t.Fatalf("String was not parsed correctly %#v", str) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pkg/elfwriter/delve_core_notes.go: -------------------------------------------------------------------------------- 1 | package elfwriter 2 | 3 | const ( 4 | DelveHeaderNoteType = 0x444C5645 // DLVE 5 | DelveThreadNodeType = 0x444C5654 // DLVT 6 | 7 | DelveHeaderTargetPidPrefix = "Target Pid: " 8 | DelveHeaderEntryPointPrefix = "Entry Point: " 9 | ) 10 | 11 | //TODO(aarzilli): these constants probably need to be in a better place. 12 | -------------------------------------------------------------------------------- /pkg/gobuild/defaultexe.go: -------------------------------------------------------------------------------- 1 | package gobuild 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/go-delve/delve/pkg/logflags" 8 | ) 9 | 10 | // DefaultDebugBinaryPath returns an unused file path in the current 11 | // directory named 'name' followed by a random string 12 | func DefaultDebugBinaryPath(name string) string { 13 | pattern := name 14 | if runtime.GOOS == "windows" { 15 | pattern += "*.exe" 16 | } 17 | f, err := os.CreateTemp(".", pattern) 18 | if err != nil { 19 | logflags.DebuggerLogger().Errorf("could not create temporary file for build output: %v", err) 20 | if runtime.GOOS == "windows" { 21 | return name + ".exe" 22 | } 23 | return name 24 | } 25 | r := f.Name() 26 | f.Close() 27 | return r 28 | } 29 | -------------------------------------------------------------------------------- /pkg/proc/debuginfod/debuginfod.go: -------------------------------------------------------------------------------- 1 | package debuginfod 2 | 3 | import ( 4 | "os/exec" 5 | "strings" 6 | ) 7 | 8 | const debuginfodFind = "debuginfod-find" 9 | 10 | func execFind(args ...string) (string, error) { 11 | if _, err := exec.LookPath(debuginfodFind); err != nil { 12 | return "", err 13 | } 14 | cmd := exec.Command(debuginfodFind, args...) 15 | out, err := cmd.Output() // ignore stderr 16 | if err != nil { 17 | return "", err 18 | } 19 | return strings.TrimSpace(string(out)), err 20 | } 21 | 22 | func GetSource(buildid, filename string) (string, error) { 23 | return execFind("source", buildid, filename) 24 | } 25 | 26 | func GetDebuginfo(buildid string) (string, error) { 27 | return execFind("debuginfo", buildid) 28 | } 29 | -------------------------------------------------------------------------------- /pkg/proc/doc.go: -------------------------------------------------------------------------------- 1 | // Package proc is a low-level package that provides methods to manipulate 2 | // the process we are debugging. 3 | // 4 | // proc implements all core functionality including: 5 | // 6 | // - creating / attaching to a process 7 | // - process manipulation (step, next, continue, halt) 8 | // - methods to explore the memory of the process 9 | package proc 10 | -------------------------------------------------------------------------------- /pkg/proc/gdbserial/gdbserver_unix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || darwin || freebsd 2 | 3 | package gdbserial 4 | 5 | import ( 6 | "os/signal" 7 | "syscall" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | func sysProcAttr(foreground bool) *syscall.SysProcAttr { 13 | return &syscall.SysProcAttr{Setpgid: true, Pgid: 0, Foreground: foreground} 14 | } 15 | 16 | func foregroundSignalsIgnore() { 17 | signal.Ignore(syscall.SIGTTOU, syscall.SIGTTIN) 18 | } 19 | 20 | func tcsetpgrp(fd uintptr, pid int) error { 21 | pgid, _ := syscall.Getpgid(pid) 22 | if pid == pgid { 23 | return unix.IoctlSetPointerInt(int(fd), unix.TIOCSPGRP, pid) 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /pkg/proc/gdbserial/gdbserver_windows.go: -------------------------------------------------------------------------------- 1 | package gdbserial 2 | 3 | import "syscall" 4 | 5 | func sysProcAttr(foreground bool) *syscall.SysProcAttr { 6 | return nil 7 | } 8 | 9 | func foregroundSignalsIgnore() { 10 | } 11 | 12 | func tcsetpgrp(fd uintptr, pid int) error { 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/bpf/dummy.go: -------------------------------------------------------------------------------- 1 | //go:build dummy 2 | 3 | package ebpf 4 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/bpf/include/dummy.go: -------------------------------------------------------------------------------- 1 | //go:build dummy 2 | 3 | package ebpf 4 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/bpf/include/trace.bpf.h: -------------------------------------------------------------------------------- 1 | #include "vmlinux.h" 2 | #include "function_vals.bpf.h" 3 | #include 4 | #include 5 | #include 6 | 7 | #define BPF_MAX_VAR_SIZ (1 << 29) 8 | 9 | // Ring buffer to handle communication of variable values back to userspace. 10 | struct { 11 | __uint(type, BPF_MAP_TYPE_RINGBUF); 12 | __uint(max_entries, BPF_MAX_VAR_SIZ); 13 | } events SEC(".maps"); 14 | 15 | // Map which uses instruction address as key and function parameter info as the value. 16 | struct { 17 | __uint(max_entries, 42); 18 | __uint(type, BPF_MAP_TYPE_HASH); 19 | __type(key, u64); 20 | __type(value, function_parameter_list_t); 21 | } arg_map SEC(".maps"); 22 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/build/build-ebpf-builder-img.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | sudo docker build \ 4 | -t delve-ebpf-builder:v0.0.1 \ 5 | -f pkg/proc/internal/ebpf/build/ebpf-Dockerfile ./pkg/proc/internal/ebpf/build 6 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/build/build-ebpf-objects.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # The go generate command seems to not like being run from 4 | # the vendor directory. Remove it and restore it after. 5 | rm -rf vendor 6 | 7 | restore_vendor() { 8 | git checkout vendor 9 | } 10 | 11 | trap restore_vendor EXIT 12 | 13 | docker run \ 14 | -it \ 15 | --rm \ 16 | -v "$(pwd)":/delve-bpf \ 17 | delve-ebpf-builder:v0.0.1 18 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/build/ebpf-Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:21.04 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | RUN apt-get update && apt-get install -y \ 5 | build-essential \ 6 | gcc-multilib \ 7 | git \ 8 | wget \ 9 | clang \ 10 | linux-headers-5.11.0-40 \ 11 | libbpf-dev 12 | 13 | RUN wget https://golang.org/dl/go1.17.3.linux-amd64.tar.gz 14 | RUN tar -C /usr/local -xzf go1.17.3.linux-amd64.tar.gz 15 | RUN cp /usr/local/go/bin/go /usr/bin/go 16 | 17 | WORKDIR /delve-bpf/pkg/proc/internal/ebpf/ 18 | 19 | CMD [ "go", "generate", "./..." ] 20 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/dummy.go: -------------------------------------------------------------------------------- 1 | //go:build dummy 2 | 3 | // This file is part of a workaround for `go mod vendor` which won't 4 | // vendor C files if there are no Go files in the same directory. 5 | // 6 | // See https://github.com/golang/go/issues/26366 7 | 8 | package ebpf 9 | 10 | import ( 11 | _ "github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf" 12 | _ "github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/include" 13 | ) 14 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/testhelper/testhelper.go: -------------------------------------------------------------------------------- 1 | //go:build linux && amd64 && cgo && go1.16 2 | 3 | package testhelper 4 | 5 | // #include 6 | // #include "../bpf/include/function_vals.bpf.h" 7 | import "C" 8 | 9 | // Function_parameter_t exports function_parameter_t from function_vals.bpf.h 10 | type Function_parameter_t C.function_parameter_t 11 | 12 | // Function_parameter_list_t exports function_parameter_list_t from function_vals.bpf.h 13 | type Function_parameter_list_t C.function_parameter_list_t 14 | -------------------------------------------------------------------------------- /pkg/proc/internal/ebpf/trace_bpfel_x86.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-delve/delve/2e8df9d9b607c2a114e8851dd1d657715013c4c8/pkg/proc/internal/ebpf/trace_bpfel_x86.o -------------------------------------------------------------------------------- /pkg/proc/linutil/doc.go: -------------------------------------------------------------------------------- 1 | // Package linutil contains functions and data structures used by both the 2 | // linux implementation of the native backend and the core backend to deal 3 | // with structures used by the linux kernel. 4 | package linutil 5 | -------------------------------------------------------------------------------- /pkg/proc/macutil/rosetta_darwin.go: -------------------------------------------------------------------------------- 1 | package macutil 2 | 3 | import ( 4 | "errors" 5 | "syscall" 6 | ) 7 | 8 | // CheckRosetta returns an error if the calling process is being translated 9 | // by Apple Rosetta. 10 | func CheckRosetta() error { 11 | pt, err := syscall.Sysctl("sysctl.proc_translated") 12 | if err != nil { 13 | return nil 14 | } 15 | if len(pt) > 0 && pt[0] == 1 { 16 | return errors.New("can not run under Rosetta, check that the installed build of Go is right for your CPU architecture") 17 | } 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /pkg/proc/macutil/rosetta_other.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin 2 | 3 | package macutil 4 | 5 | // CheckRosetta returns an error if the calling process is being translated 6 | // by Apple Rosetta. 7 | func CheckRosetta() error { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /pkg/proc/native/cpuid/xsave_x86.s: -------------------------------------------------------------------------------- 1 | //go:build amd64 || 386 2 | 3 | TEXT ·cpuid(SB),$0-24 4 | MOVL axIn+0(FP), AX 5 | MOVL cxIn+4(FP), CX 6 | CPUID 7 | MOVL AX, axOut+8(FP) 8 | MOVL BX, bxOut+12(FP) 9 | MOVL CX, cxOut+16(FP) 10 | MOVL DX, dxOut+20(FP) 11 | RET 12 | 13 | -------------------------------------------------------------------------------- /pkg/proc/native/dump_linux_other.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !amd64 2 | 3 | package native 4 | 5 | import ( 6 | "github.com/go-delve/delve/pkg/elfwriter" 7 | ) 8 | 9 | func (p *nativeProcess) DumpProcessNotes(notes []elfwriter.Note, threadDone func()) (threadsDone bool, out []elfwriter.Note, err error) { 10 | return false, notes, nil 11 | } 12 | -------------------------------------------------------------------------------- /pkg/proc/native/dump_other.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || (windows && arm64) 2 | 3 | package native 4 | 5 | import ( 6 | "github.com/go-delve/delve/pkg/elfwriter" 7 | "github.com/go-delve/delve/pkg/proc" 8 | ) 9 | 10 | func (p *nativeProcess) MemoryMap() ([]proc.MemoryMapEntry, error) { 11 | return nil, proc.ErrMemoryMapNotSupported 12 | } 13 | 14 | func (p *nativeProcess) DumpProcessNotes(notes []elfwriter.Note, threadDone func()) (threadsDone bool, notesout []elfwriter.Note, err error) { 15 | return false, notes, nil 16 | } 17 | -------------------------------------------------------------------------------- /pkg/proc/native/exec_darwin.h: -------------------------------------------------------------------------------- 1 | //+build darwin,macnative 2 | 3 | #include "proc_darwin.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int 12 | fork_exec(char *, char **, int, char *, task_t*, mach_port_t*, mach_port_t*, mach_port_t*); 13 | -------------------------------------------------------------------------------- /pkg/proc/native/followexec_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | 3 | package native 4 | 5 | import "errors" 6 | 7 | // FollowExec enables (or disables) follow exec mode 8 | func (*nativeProcess) FollowExec(bool) error { 9 | return errors.New("follow exec not implemented") 10 | } 11 | 12 | func (*processGroup) detachChild(*nativeProcess) error { 13 | panic("not implemented") 14 | } 15 | -------------------------------------------------------------------------------- /pkg/proc/native/hwbreak_other.go: -------------------------------------------------------------------------------- 1 | //go:build (linux && 386) || (darwin && arm64) || (windows && arm64) || (linux && ppc64le) || (linux && riscv64) || (linux && loong64) 2 | 3 | package native 4 | 5 | import ( 6 | "errors" 7 | 8 | "github.com/go-delve/delve/pkg/proc" 9 | ) 10 | 11 | func (t *nativeThread) findHardwareBreakpoint() (*proc.Breakpoint, error) { 12 | return nil, errors.New("hardware breakpoints not supported") 13 | } 14 | 15 | func (t *nativeThread) writeHardwareBreakpoint(addr uint64, wtype proc.WatchType, idx uint8) error { 16 | return errors.New("hardware breakpoints not supported") 17 | } 18 | 19 | func (t *nativeThread) clearHardwareBreakpoint(addr uint64, wtype proc.WatchType, idx uint8) error { 20 | return errors.New("hardware breakpoints not supported") 21 | } 22 | -------------------------------------------------------------------------------- /pkg/proc/native/proc_ebpf_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux && amd64 && cgo && go1.16 2 | 3 | package native 4 | 5 | func (dbp *nativeProcess) SupportsBPF() bool { 6 | return true 7 | } 8 | -------------------------------------------------------------------------------- /pkg/proc/native/proc_no_ebpf_linux.go: -------------------------------------------------------------------------------- 1 | //go:build !linux || !amd64 || !go1.16 || !cgo 2 | 3 | package native 4 | 5 | func (dbp *nativeProcess) SupportsBPF() bool { 6 | return false 7 | } 8 | -------------------------------------------------------------------------------- /pkg/proc/native/proc_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package native 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "os/exec" 9 | 10 | isatty "github.com/mattn/go-isatty" 11 | ) 12 | 13 | func attachProcessToTTY(process *exec.Cmd, tty string) (*os.File, error) { 14 | f, err := os.OpenFile(tty, os.O_RDWR, 0) 15 | if err != nil { 16 | return nil, err 17 | } 18 | if !isatty.IsTerminal(f.Fd()) { 19 | f.Close() 20 | return nil, fmt.Errorf("%s is not a terminal", f.Name()) 21 | } 22 | process.Stdin = f 23 | process.Stdout = f 24 | process.Stderr = f 25 | process.SysProcAttr.Setpgid = false 26 | process.SysProcAttr.Setsid = true 27 | process.SysProcAttr.Setctty = true 28 | 29 | return f, nil 30 | } 31 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !darwin && !windows && !freebsd 2 | 3 | // This file is used to detect build on unsupported GOOS/GOARCH combinations. 4 | 5 | package your_operating_system_is_not_supported_by_delve 6 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel_cgo_freebsd.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd && amd64 && !cgo 2 | 3 | // This file is used to detect building on freebsd with cgo disabled 4 | 5 | package can_not_build_on_freebsd_with_cgo_disabled 6 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel_darwin.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && !amd64 && !arm64 2 | 3 | // This file is used to detect build on unsupported GOOS/GOARCH combinations. 4 | 5 | package your_darwin_architecture_is_not_supported_by_delve 6 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel_freebsd.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd && !amd64 2 | 3 | // This file is used to detect build on unsupported GOOS/GOARCH combinations. 4 | 5 | package your_freebsd_architecture_is_not_supported_by_delve 6 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !amd64 && !arm64 && !386 && !(ppc64le && exp.linuxppc64le) && !(riscv64 && exp.linuxriscv64) && !(loong64 && exp.linuxloong64) 2 | 3 | // This file is used to detect build on unsupported GOOS/GOARCH combinations. 4 | 5 | package your_linux_architecture_is_not_supported_by_delve 6 | -------------------------------------------------------------------------------- /pkg/proc/native/support_sentinel_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows && !amd64 && !(arm64 && exp.winarm64) 2 | 3 | // This file is used to detect build on unsupported GOOS/GOARCH combinations. 4 | 5 | package your_windows_architecture_is_not_supported_by_delve 6 | -------------------------------------------------------------------------------- /pkg/proc/native/threads_linux_386.go: -------------------------------------------------------------------------------- 1 | package native 2 | 3 | import ( 4 | "fmt" 5 | "github.com/go-delve/delve/pkg/proc" 6 | ) 7 | 8 | func (t *nativeThread) restoreRegisters(savedRegs proc.Registers) error { 9 | return fmt.Errorf("restore regs not supported on i386") 10 | } 11 | -------------------------------------------------------------------------------- /pkg/proc/redirect.go: -------------------------------------------------------------------------------- 1 | package proc 2 | 3 | import "os" 4 | 5 | // OutputRedirect Specifies where the target program output will be redirected to. 6 | // Only one of "Path" and "File" should be set. 7 | type OutputRedirect struct { 8 | // Path File path. 9 | Path string 10 | // File Redirect file. 11 | File *os.File 12 | } 13 | -------------------------------------------------------------------------------- /pkg/proc/redirector_windows.go: -------------------------------------------------------------------------------- 1 | package proc 2 | 3 | import ( 4 | "io" 5 | "os" 6 | ) 7 | 8 | func Redirector() (reader io.ReadCloser, output OutputRedirect, err error) { 9 | reader, output.File, err = os.Pipe() 10 | 11 | return reader, output, err 12 | } 13 | -------------------------------------------------------------------------------- /pkg/terminal/groups.go: -------------------------------------------------------------------------------- 1 | package terminal 2 | 3 | type commandGroup uint8 4 | 5 | const ( 6 | otherCmds commandGroup = iota 7 | breakCmds 8 | runCmds 9 | dataCmds 10 | goroutineCmds 11 | stackCmds 12 | ) 13 | 14 | type commandGroupDescription struct { 15 | description string 16 | group commandGroup 17 | } 18 | 19 | var commandGroupDescriptions = []commandGroupDescription{ 20 | {"Running the program", runCmds}, 21 | {"Manipulating breakpoints", breakCmds}, 22 | {"Viewing program variables and memory", dataCmds}, 23 | {"Listing and switching between threads and goroutines", goroutineCmds}, 24 | {"Viewing the call stack and selecting frames", stackCmds}, 25 | {"Other commands", otherCmds}, 26 | } 27 | -------------------------------------------------------------------------------- /pkg/terminal/out_unix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || darwin || freebsd 2 | 3 | package terminal 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | type winSize struct { 11 | row, col uint16 12 | xpixel, ypixel uint16 13 | } 14 | 15 | func (w *pagingWriter) getWindowSize() { 16 | var ws winSize 17 | ok, _, _ := syscall.Syscall(syscall.SYS_IOCTL, uintptr(syscall.Stdout), syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws))) 18 | if int(ok) < 0 { 19 | w.mode = pagingWriterNormal 20 | return 21 | } 22 | w.lines = int(ws.row) 23 | w.columns = int(ws.col) 24 | } 25 | -------------------------------------------------------------------------------- /pkg/terminal/starbind/conv_test.go: -------------------------------------------------------------------------------- 1 | package starbind 2 | 3 | import ( 4 | "testing" 5 | 6 | "go.starlark.net/starlark" 7 | ) 8 | 9 | func TestConv(t *testing.T) { 10 | script := ` 11 | # A list global that we'll unmarshal into a slice. 12 | x = [1,2] 13 | ` 14 | globals, err := execFileOptions(nil, &starlark.Thread{}, "test.star", script, nil) 15 | starlarkVal, ok := globals["x"] 16 | if !ok { 17 | t.Fatal("missing global 'x'") 18 | } 19 | if err != nil { 20 | t.Fatal(err) 21 | } 22 | var x []int 23 | err = unmarshalStarlarkValue(starlarkVal, &x, "x") 24 | if err != nil { 25 | t.Fatal(err) 26 | } 27 | if len(x) != 2 || x[0] != 1 || x[1] != 2 { 28 | t.Fatalf("expected [1 2], got: %v", x) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pkg/terminal/terminal_other.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package terminal 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // getColorableWriter simply returns stdout on 11 | // *nix machines. 12 | func getColorableWriter() io.Writer { 13 | return os.Stdout 14 | } 15 | -------------------------------------------------------------------------------- /pkg/terminal/terminal_test.go: -------------------------------------------------------------------------------- 1 | package terminal 2 | 3 | import ( 4 | "errors" 5 | "net/rpc" 6 | "testing" 7 | ) 8 | 9 | func TestIsErrProcessExited(t *testing.T) { 10 | tests := []struct { 11 | name string 12 | err error 13 | result bool 14 | }{ 15 | {"empty error", errors.New(""), false}, 16 | {"non-ServerError", errors.New("Process 33122 has exited with status 0"), false}, 17 | {"ServerError with zero status", rpc.ServerError("Process 33122 has exited with status 0"), true}, 18 | {"ServerError with non-zero status", rpc.ServerError("Process 2 has exited with status 25"), true}, 19 | } 20 | for _, test := range tests { 21 | if isErrProcessExited(test.err) != test.result { 22 | t.Error(test.name) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pkg/version/buildinfo.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "runtime/debug" 7 | ) 8 | 9 | func init() { 10 | buildInfo = moduleBuildInfo 11 | } 12 | 13 | func moduleBuildInfo() string { 14 | info, ok := debug.ReadBuildInfo() 15 | if !ok { 16 | return "not built in module mode" 17 | } 18 | 19 | buf := new(bytes.Buffer) 20 | fmt.Fprintf(buf, " mod\t%s\t%s\t%s\n", info.Main.Path, info.Main.Version, info.Main.Sum) 21 | for _, dep := range info.Deps { 22 | fmt.Fprintf(buf, " dep\t%s\t%s\t%s", dep.Path, dep.Version, dep.Sum) 23 | if dep.Replace != nil { 24 | fmt.Fprintf(buf, "\t=> %s\t%s\t%s", dep.Replace.Path, dep.Replace.Version, dep.Replace.Sum) 25 | } 26 | fmt.Fprintf(buf, "\n") 27 | } 28 | return buf.String() 29 | } 30 | -------------------------------------------------------------------------------- /service/internal/sameuser/doc.go: -------------------------------------------------------------------------------- 1 | // Package sameuser provides utilities for checking users of a local connection. 2 | // Only works in Linux. 3 | package sameuser 4 | -------------------------------------------------------------------------------- /service/internal/sameuser/sameuser.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | package sameuser 4 | 5 | import "net" 6 | 7 | func CanAccept(_, _, _ net.Addr) bool { 8 | return true 9 | } 10 | -------------------------------------------------------------------------------- /service/rpccallback.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | // RPCCallback is used by RPC methods to return their result asynchronously. 4 | type RPCCallback interface { 5 | Return(out interface{}, err error) 6 | 7 | // SetupDoneChan returns a channel that should be closed to signal that the 8 | // asynchronous method has completed setup and the server is ready to 9 | // receive other requests. 10 | SetupDoneChan() chan struct{} 11 | 12 | // DisconnectChan returns a channel that should be closed to signal that 13 | // the client that initially issued the command has been disconnected. 14 | DisconnectChan() chan struct{} 15 | } 16 | -------------------------------------------------------------------------------- /service/server.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | // Server represents a server for a remote client 4 | // to connect to. 5 | type Server interface { 6 | Run() error 7 | Stop() error 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: LLVM 4 | AlignAfterOpenBracket: DontAlign 5 | AlignConsecutiveAssignments: true 6 | AlignEscapedNewlines: DontAlign 7 | AlwaysBreakBeforeMultilineStrings: true 8 | AlwaysBreakTemplateDeclarations: false 9 | AllowAllParametersOfDeclarationOnNextLine: false 10 | AllowShortFunctionsOnASingleLine: false 11 | BreakBeforeBraces: Attach 12 | IndentWidth: 4 13 | KeepEmptyLinesAtTheStartOfBlocks: false 14 | TabWidth: 4 15 | UseTab: ForContinuationAndIndentation 16 | ColumnLimit: 1000 17 | # Go compiler comments need to stay unindented. 18 | CommentPragmas: '^go:.*' 19 | ... 20 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.o 8 | !*_bpf*.o 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.golangci.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | issues: 3 | exclude-rules: 4 | # syscall param structs will have unused fields in Go code. 5 | - path: syscall.*.go 6 | linters: 7 | - structcheck 8 | 9 | linters: 10 | disable-all: true 11 | enable: 12 | - errcheck 13 | - goimports 14 | - gosimple 15 | - govet 16 | - ineffassign 17 | - misspell 18 | - staticcheck 19 | - typecheck 20 | - unused 21 | - gofmt 22 | 23 | # Could be enabled later: 24 | # - gocyclo 25 | # - maligned 26 | # - gosec 27 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers 2 | 3 | Maintainers can be found in the [Cilium Maintainers file](https://github.com/cilium/community/blob/main/roles/Maintainers.md) 4 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/asm/doc.go: -------------------------------------------------------------------------------- 1 | // Package asm is an assembler for eBPF bytecode. 2 | package asm 3 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/btf/doc.go: -------------------------------------------------------------------------------- 1 | // Package btf handles data encoded according to the BPF Type Format. 2 | // 3 | // The canonical documentation lives in the Linux kernel repository and is 4 | // available at https://www.kernel.org/doc/html/latest/bpf/btf.html 5 | package btf 6 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/btf/workarounds.go: -------------------------------------------------------------------------------- 1 | package btf 2 | 3 | // datasecResolveWorkaround ensures that certain vars in a Datasec are added 4 | // to a Spec before the Datasec. This avoids a bug in kernel BTF validation. 5 | // 6 | // See https://lore.kernel.org/bpf/20230302123440.1193507-1-lmb@isovalent.com/ 7 | func datasecResolveWorkaround(b *Builder, ds *Datasec) error { 8 | for _, vsi := range ds.Vars { 9 | v, ok := vsi.Type.(*Var) 10 | if !ok { 11 | continue 12 | } 13 | 14 | switch v.Type.(type) { 15 | case *Typedef, *Volatile, *Const, *Restrict, *typeTag: 16 | // NB: We must never call Add on a Datasec, otherwise we risk 17 | // infinite recursion. 18 | _, err := b.Add(v.Type) 19 | if err != nil { 20 | return err 21 | } 22 | } 23 | } 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/align.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import "golang.org/x/exp/constraints" 4 | 5 | // Align returns 'n' updated to 'alignment' boundary. 6 | func Align[I constraints.Integer](n, alignment I) I { 7 | return (n + alignment - 1) / alignment * alignment 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/endian_be.go: -------------------------------------------------------------------------------- 1 | //go:build armbe || arm64be || mips || mips64 || mips64p32 || ppc64 || s390 || s390x || sparc || sparc64 2 | 3 | package internal 4 | 5 | import "encoding/binary" 6 | 7 | // NativeEndian is set to either binary.BigEndian or binary.LittleEndian, 8 | // depending on the host's endianness. 9 | var NativeEndian binary.ByteOrder = binary.BigEndian 10 | 11 | // ClangEndian is set to either "el" or "eb" depending on the host's endianness. 12 | const ClangEndian = "eb" 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/endian_le.go: -------------------------------------------------------------------------------- 1 | //go:build 386 || amd64 || amd64p32 || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || ppc64le || riscv64 2 | 3 | package internal 4 | 5 | import "encoding/binary" 6 | 7 | // NativeEndian is set to either binary.BigEndian or binary.LittleEndian, 8 | // depending on the host's endianness. 9 | var NativeEndian binary.ByteOrder = binary.LittleEndian 10 | 11 | // ClangEndian is set to either "el" or "eb" depending on the host's endianness. 12 | const ClangEndian = "el" 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/memoize.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | type memoizedFunc[T any] struct { 8 | once sync.Once 9 | fn func() (T, error) 10 | result T 11 | err error 12 | } 13 | 14 | func (mf *memoizedFunc[T]) do() (T, error) { 15 | mf.once.Do(func() { 16 | mf.result, mf.err = mf.fn() 17 | }) 18 | return mf.result, mf.err 19 | } 20 | 21 | // Memoize the result of a function call. 22 | // 23 | // fn is only ever called once, even if it returns an error. 24 | func Memoize[T any](fn func() (T, error)) func() (T, error) { 25 | return (&memoizedFunc[T]{fn: fn}).do 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/prog.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // EmptyBPFContext is the smallest-possible BPF input context to be used for 4 | // invoking `Program.{Run,Benchmark,Test}`. 5 | // 6 | // Programs require a context input buffer of at least 15 bytes. Looking in 7 | // net/bpf/test_run.c, bpf_test_init() requires that the input is at least 8 | // ETH_HLEN (14) bytes. As of Linux commit fd18942 ("bpf: Don't redirect packets 9 | // with invalid pkt_len"), it also requires the skb to be non-empty after 10 | // removing the Layer 2 header. 11 | var EmptyBPFContext = make([]byte, 15) 12 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/statfs.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "unsafe" 5 | 6 | "github.com/cilium/ebpf/internal/unix" 7 | ) 8 | 9 | func FSType(path string) (int64, error) { 10 | var statfs unix.Statfs_t 11 | if err := unix.Statfs(path, &statfs); err != nil { 12 | return 0, err 13 | } 14 | 15 | fsType := int64(statfs.Type) 16 | if unsafe.Sizeof(statfs.Type) == 4 { 17 | // We're on a 32 bit arch, where statfs.Type is int32. bpfFSType is a 18 | // negative number when interpreted as int32 so we need to cast via 19 | // uint32 to avoid sign extension. 20 | fsType = int64(uint32(statfs.Type)) 21 | } 22 | return fsType, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/doc.go: -------------------------------------------------------------------------------- 1 | // Package sys contains bindings for the BPF syscall. 2 | package sys 3 | 4 | // Regenerate types.go by invoking go generate in the current directory. 5 | 6 | //go:generate go run github.com/cilium/ebpf/internal/cmd/gentypes ../../btf/testdata/vmlinux.btf.gz 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/ptr_32_be.go: -------------------------------------------------------------------------------- 1 | //go:build armbe || mips || mips64p32 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | pad uint32 13 | ptr unsafe.Pointer 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/ptr_32_le.go: -------------------------------------------------------------------------------- 1 | //go:build 386 || amd64p32 || arm || mipsle || mips64p32le 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | ptr unsafe.Pointer 13 | pad uint32 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/ptr_64.go: -------------------------------------------------------------------------------- 1 | //go:build !386 && !amd64p32 && !arm && !mipsle && !mips64p32le && !armbe && !mips && !mips64p32 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | ptr unsafe.Pointer 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/tracefs/probetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ProbeType -linecomment"; DO NOT EDIT. 2 | 3 | package tracefs 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Kprobe-0] 12 | _ = x[Uprobe-1] 13 | } 14 | 15 | const _ProbeType_name = "kprobeuprobe" 16 | 17 | var _ProbeType_index = [...]uint8{0, 6, 12} 18 | 19 | func (i ProbeType) String() string { 20 | if i >= ProbeType(len(_ProbeType_index)-1) { 21 | return "ProbeType(" + strconv.FormatInt(int64(i), 10) + ")" 22 | } 23 | return _ProbeType_name[_ProbeType_index[i]:_ProbeType_index[i+1]] 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/tracefs/uprobe.go: -------------------------------------------------------------------------------- 1 | package tracefs 2 | 3 | import "fmt" 4 | 5 | // UprobeToken creates the PATH:OFFSET(REF_CTR_OFFSET) token for the tracefs api. 6 | func UprobeToken(args ProbeArgs) string { 7 | po := fmt.Sprintf("%s:%#x", args.Path, args.Offset) 8 | 9 | if args.RefCtrOffset != 0 { 10 | // This is not documented in Documentation/trace/uprobetracer.txt. 11 | // elixir.bootlin.com/linux/v5.15-rc7/source/kernel/trace/trace.c#L5564 12 | po += fmt.Sprintf("(%#x)", args.RefCtrOffset) 13 | } 14 | 15 | return po 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/doc.go: -------------------------------------------------------------------------------- 1 | // Package unix re-exports Linux specific parts of golang.org/x/sys/unix. 2 | // 3 | // It avoids breaking compilation on other OS by providing stubs as follows: 4 | // - Invoking a function always returns an error. 5 | // - Errnos have distinct, non-zero values. 6 | // - Constants have distinct but meaningless values. 7 | // - Types use the same names for members, but may or may not follow the 8 | // Linux layout. 9 | package unix 10 | 11 | // Note: please don't add any custom API to this package. Use internal/sys instead. 12 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/link/doc.go: -------------------------------------------------------------------------------- 1 | // Package link allows attaching eBPF programs to various kernel hooks. 2 | package link 3 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/ringbuf/doc.go: -------------------------------------------------------------------------------- 1 | // Package ringbuf allows interacting with Linux BPF ring buffer. 2 | // 3 | // BPF allows submitting custom events to a BPF ring buffer map set up 4 | // by userspace. This is very useful to push things like packet samples 5 | // from BPF to a daemon running in user space. 6 | package ringbuf 7 | -------------------------------------------------------------------------------- /vendor/github.com/cosiner/argv/argv.go: -------------------------------------------------------------------------------- 1 | // Package argv parse command line string into arguments array using the bash syntax. 2 | package argv 3 | 4 | // Argv split cmdline string as array of argument array by the '|' character. 5 | // 6 | // The parsing rules is same as bash. The environment variable will be replaced 7 | // and string surround by '`' will be passed to reverse quote parser. 8 | func Argv(cmdline string, backquoteExpander, stringExpander Expander) ([][]string, error) { 9 | return NewParser(NewScanner(cmdline), backquoteExpander, stringExpander).Parse() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | 7 | "github.com/russross/blackfriday/v2" 8 | ) 9 | 10 | // Render converts a markdown document into a roff formatted document. 11 | func Render(doc []byte) []byte { 12 | renderer := NewRoffRenderer() 13 | var r blackfriday.Renderer = renderer 14 | if v, _ := strconv.ParseBool(os.Getenv("MD2MAN_DEBUG")); v { 15 | r = &debugDecorator{Renderer: r} 16 | } 17 | 18 | return blackfriday.Run(doc, 19 | []blackfriday.Option{ 20 | blackfriday.WithRenderer(r), 21 | blackfriday.WithExtensions(renderer.GetExtensions()), 22 | }...) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/.gitignore: -------------------------------------------------------------------------------- 1 | [568].out 2 | _go* 3 | _test* 4 | _obj 5 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/Dockerfile.golang: -------------------------------------------------------------------------------- 1 | ARG GOVERSION=1.14 2 | FROM golang:${GOVERSION} 3 | 4 | # Set base env. 5 | ARG GOOS=linux 6 | ARG GOARCH=amd64 7 | ENV GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w' 8 | 9 | # Pre compile the stdlib for 386/arm (32bits). 10 | RUN go build -a std 11 | 12 | # Add the code to the image. 13 | WORKDIR pty 14 | ADD . . 15 | 16 | # Build the lib. 17 | RUN go build 18 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | //+build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/doc.go: -------------------------------------------------------------------------------- 1 | // Package pty provides functions for working with Unix terminals. 2 | package pty 3 | 4 | import ( 5 | "errors" 6 | "os" 7 | ) 8 | 9 | // ErrUnsupported is returned if a function is not 10 | // available on the current platform. 11 | var ErrUnsupported = errors.New("unsupported") 12 | 13 | // Open a pty and its corresponding tty. 14 | func Open() (pty, tty *os.File, err error) { 15 | return open() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && go1.12 2 | // +build !windows,go1.12 3 | 4 | package pty 5 | 6 | import "os" 7 | 8 | func ioctl(f *os.File, cmd, ptr uintptr) error { 9 | sc, e := f.SyscallConn() 10 | if e != nil { 11 | return ioctl_inner(f.Fd(), cmd, ptr) // fall back to blocking io (old behavior) 12 | } 13 | 14 | ch := make(chan error, 1) 15 | defer close(ch) 16 | 17 | e = sc.Control(func(fd uintptr) { ch <- ioctl_inner(fd, cmd, ptr) }) 18 | if e != nil { 19 | return e 20 | } 21 | e = <-ch 22 | return e 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl_inner.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !solaris && !aix 2 | // +build !windows,!solaris,!aix 3 | 4 | package pty 5 | 6 | import "syscall" 7 | 8 | const ( 9 | TIOCGWINSZ = syscall.TIOCGWINSZ 10 | TIOCSWINSZ = syscall.TIOCSWINSZ 11 | ) 12 | 13 | func ioctl_inner(fd, cmd, ptr uintptr) error { 14 | _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) 15 | if e != 0 { 16 | return e 17 | } 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl_legacy.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !go1.12 2 | // +build !windows,!go1.12 3 | 4 | package pty 5 | 6 | import "os" 7 | 8 | func ioctl(f *os.File, cmd, ptr uintptr) error { 9 | return ioctl_inner(f.Fd(), cmd, ptr) // fall back to blocking io (old behavior) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package pty 5 | 6 | const ( 7 | TIOCGWINSZ = 0 8 | TIOCSWINSZ = 0 9 | ) 10 | 11 | func ioctl_inner(fd, cmd, ptr uintptr) error { 12 | return ErrUnsupported 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/mktypes.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | GOOSARCH="${GOOS}_${GOARCH}" 4 | case "$GOOSARCH" in 5 | _* | *_ | _) 6 | echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 7 | exit 1 8 | ;; 9 | esac 10 | 11 | GODEFS="go tool cgo -godefs" 12 | 13 | $GODEFS types.go |gofmt > ztypes_$GOARCH.go 14 | 15 | case $GOOS in 16 | freebsd|dragonfly|netbsd|openbsd) 17 | $GODEFS types_$GOOS.go |gofmt > ztypes_$GOOSARCH.go 18 | ;; 19 | esac 20 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/pty_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !darwin && !freebsd && !dragonfly && !netbsd && !openbsd && !solaris 2 | // +build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris 3 | 4 | package pty 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | func open() (pty, tty *os.File, err error) { 11 | return nil, nil, ErrUnsupported 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/start.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package pty 5 | 6 | import ( 7 | "os" 8 | "os/exec" 9 | "syscall" 10 | ) 11 | 12 | // StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, 13 | // and c.Stderr, calls c.Start, and returns the File of the tty's 14 | // corresponding pty. 15 | // 16 | // This will resize the pty to the specified size before starting the command. 17 | // Starts the process in a new session and sets the controlling terminal. 18 | func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) { 19 | if cmd.SysProcAttr == nil { 20 | cmd.SysProcAttr = &syscall.SysProcAttr{} 21 | } 22 | cmd.SysProcAttr.Setsid = true 23 | cmd.SysProcAttr.Setctty = true 24 | return StartWithAttrs(cmd, ws, cmd.SysProcAttr) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/start_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package pty 5 | 6 | import ( 7 | "os" 8 | "os/exec" 9 | ) 10 | 11 | // StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, 12 | // and c.Stderr, calls c.Start, and returns the File of the tty's 13 | // corresponding pty. 14 | // 15 | // This will resize the pty to the specified size before starting the command. 16 | // Starts the process in a new session and sets the controlling terminal. 17 | func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) { 18 | return nil, ErrUnsupported 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/winsize.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import "os" 4 | 5 | // InheritSize applies the terminal size of pty to tty. This should be run 6 | // in a signal handler for syscall.SIGWINCH to automatically resize the tty when 7 | // the pty receives a window size change notification. 8 | func InheritSize(pty, tty *os.File) error { 9 | size, err := GetsizeFull(pty) 10 | if err != nil { 11 | return err 12 | } 13 | if err := Setsize(tty, size); err != nil { 14 | return err 15 | } 16 | return nil 17 | } 18 | 19 | // Getsize returns the number of rows (lines) and cols (positions 20 | // in each line) in terminal t. 21 | func Getsize(t *os.File) (rows, cols int, err error) { 22 | ws, err := GetsizeFull(t) 23 | if err != nil { 24 | return 0, 0, err 25 | } 26 | return int(ws.Rows), int(ws.Cols), nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/winsize_unsupported.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package pty 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | // Winsize is a dummy struct to enable compilation on unsupported platforms. 11 | type Winsize struct { 12 | Rows, Cols, X, Y uint16 13 | } 14 | 15 | // Setsize resizes t to s. 16 | func Setsize(*os.File, *Winsize) error { 17 | return ErrUnsupported 18 | } 19 | 20 | // GetsizeFull returns the full terminal size description. 21 | func GetsizeFull(*os.File) (*Winsize, error) { 22 | return nil, ErrUnsupported 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_386.go: -------------------------------------------------------------------------------- 1 | //go:build 386 2 | // +build 386 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 2 | // +build amd64 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_arm.go: -------------------------------------------------------------------------------- 1 | //go:build arm 2 | // +build arm 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build arm64 2 | // +build arm64 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 && dragonfly 2 | // +build amd64,dragonfly 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_dragonfly.go 6 | 7 | package pty 8 | 9 | const ( 10 | _C_SPECNAMELEN = 0x3f 11 | ) 12 | 13 | type fiodgnameArg struct { 14 | Name *byte 15 | Len uint32 16 | Pad_cgo_0 [4]byte 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build 386 && freebsd 2 | // +build 386,freebsd 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_freebsd.go 6 | 7 | package pty 8 | 9 | const ( 10 | _C_SPECNAMELEN = 0x3f 11 | ) 12 | 13 | type fiodgnameArg struct { 14 | Len int32 15 | Buf *byte 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 && freebsd 2 | // +build amd64,freebsd 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_freebsd.go 6 | 7 | package pty 8 | 9 | const ( 10 | _C_SPECNAMELEN = 0x3f 11 | ) 12 | 13 | type fiodgnameArg struct { 14 | Len int32 15 | Pad_cgo_0 [4]byte 16 | Buf *byte 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build arm && freebsd 2 | // +build arm,freebsd 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_freebsd.go 6 | 7 | package pty 8 | 9 | const ( 10 | _C_SPECNAMELEN = 0x3f 11 | ) 12 | 13 | type fiodgnameArg struct { 14 | Len int32 15 | Buf *byte 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build arm64 && freebsd 2 | // +build arm64,freebsd 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs types_freebsd.go 6 | 7 | package pty 8 | 9 | const ( 10 | _C_SPECNAMELEN = 0xff 11 | ) 12 | 13 | type fiodgnameArg struct { 14 | Len int32 15 | Buf *byte 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_ppc64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Pad_cgo_0 [4]byte 13 | Buf *byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Buf *byte 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_loong64.go: -------------------------------------------------------------------------------- 1 | //go:build loong64 2 | // +build loong64 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_mipsx.go: -------------------------------------------------------------------------------- 1 | //go:build (mips || mipsle || mips64 || mips64le) && linux 2 | // +build mips mipsle mips64 mips64le 3 | // +build linux 4 | 5 | // Created by cgo -godefs - DO NOT EDIT 6 | // cgo -godefs types.go 7 | 8 | package pty 9 | 10 | type ( 11 | _C_int int32 12 | _C_uint uint32 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_netbsd_32bit_int.go: -------------------------------------------------------------------------------- 1 | //go:build (386 || amd64 || arm || arm64) && netbsd 2 | // +build 386 amd64 arm arm64 3 | // +build netbsd 4 | 5 | package pty 6 | 7 | type ptmget struct { 8 | Cfd int32 9 | Sfd int32 10 | Cn [1024]int8 11 | Sn [1024]int8 12 | } 13 | 14 | var ( 15 | ioctl_TIOCPTSNAME = 0x48087448 16 | ioctl_TIOCGRANTPT = 0x20007447 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_openbsd_32bit_int.go: -------------------------------------------------------------------------------- 1 | //go:build (386 || amd64 || arm || arm64 || mips64) && openbsd 2 | // +build 386 amd64 arm arm64 mips64 3 | // +build openbsd 4 | 5 | package pty 6 | 7 | type ptmget struct { 8 | Cfd int32 9 | Sfd int32 10 | Cn [16]int8 11 | Sn [16]int8 12 | } 13 | 14 | var ioctl_PTMGET = 0x40287401 15 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_ppc.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_ppc64.go: -------------------------------------------------------------------------------- 1 | //go:build ppc64 2 | // +build ppc64 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_ppc64le.go: -------------------------------------------------------------------------------- 1 | //go:build ppc64le 2 | // +build ppc64le 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_riscvx.go: -------------------------------------------------------------------------------- 1 | //go:build riscv || riscv64 2 | // +build riscv riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_s390x.go: -------------------------------------------------------------------------------- 1 | //go:build s390x 2 | // +build s390x 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_sparcx.go: -------------------------------------------------------------------------------- 1 | //go:build sparc || sparc64 2 | // +build sparc sparc64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs types.go 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/derekparker/trie/.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | test_patterns = ["*_test.go"] 4 | 5 | exclude_patterns = ["vendor/*"] 6 | 7 | [[analyzers]] 8 | name = "go" 9 | enabled = true 10 | 11 | [analyzers.meta] 12 | import_path = "github.com/derekparker/trie" 13 | dependencies_vendored = true -------------------------------------------------------------------------------- /vendor/github.com/derekparker/trie/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/bsdinput.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd || freebsd || netbsd 2 | // +build openbsd freebsd netbsd 3 | 4 | package liner 5 | 6 | import "syscall" 7 | 8 | const ( 9 | getTermios = syscall.TIOCGETA 10 | setTermios = syscall.TIOCSETA 11 | ) 12 | 13 | const ( 14 | // Input flags 15 | inpck = 0x010 16 | istrip = 0x020 17 | icrnl = 0x100 18 | ixon = 0x200 19 | 20 | // Output flags 21 | opost = 0x1 22 | 23 | // Control flags 24 | cs8 = 0x300 25 | 26 | // Local flags 27 | isig = 0x080 28 | icanon = 0x100 29 | iexten = 0x400 30 | ) 31 | 32 | type termios struct { 33 | Iflag uint32 34 | Oflag uint32 35 | Cflag uint32 36 | Lflag uint32 37 | Cc [20]byte 38 | Ispeed int32 39 | Ospeed int32 40 | } 41 | 42 | const cursorColumn = false 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/input_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | // +build linux 3 | 4 | package liner 5 | 6 | import "syscall" 7 | 8 | const ( 9 | getTermios = syscall.TCGETS 10 | setTermios = syscall.TCSETS 11 | ) 12 | 13 | const ( 14 | icrnl = syscall.ICRNL 15 | inpck = syscall.INPCK 16 | istrip = syscall.ISTRIP 17 | ixon = syscall.IXON 18 | opost = syscall.OPOST 19 | cs8 = syscall.CS8 20 | isig = syscall.ISIG 21 | icanon = syscall.ICANON 22 | iexten = syscall.IEXTEN 23 | ) 24 | 25 | type termios struct { 26 | syscall.Termios 27 | } 28 | 29 | const cursorColumn = false 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/input_solaris.go: -------------------------------------------------------------------------------- 1 | package liner 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | const ( 8 | getTermios = unix.TCGETS 9 | setTermios = unix.TCSETS 10 | ) 11 | 12 | const ( 13 | icrnl = unix.ICRNL 14 | inpck = unix.INPCK 15 | istrip = unix.ISTRIP 16 | ixon = unix.IXON 17 | opost = unix.OPOST 18 | cs8 = unix.CS8 19 | isig = unix.ISIG 20 | icanon = unix.ICANON 21 | iexten = unix.IEXTEN 22 | ) 23 | 24 | type termios unix.Termios 25 | 26 | const cursorColumn = false 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/output_solaris.go: -------------------------------------------------------------------------------- 1 | package liner 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | func (s *State) getColumns() bool { 8 | ws, err := unix.IoctlGetWinsize(unix.Stdout, unix.TIOCGWINSZ) 9 | if err != nil { 10 | return false 11 | } 12 | s.columns = int(ws.Col) 13 | return true 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/output_unix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || darwin || openbsd || freebsd || netbsd 2 | // +build linux darwin openbsd freebsd netbsd 3 | 4 | package liner 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func (s *State) getColumns() bool { 12 | var ws winSize 13 | ok, _, _ := syscall.Syscall(syscall.SYS_IOCTL, uintptr(syscall.Stdout), 14 | syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws))) 15 | if int(ok) < 0 { 16 | return false 17 | } 18 | s.columns = int(ws.col) 19 | return true 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/signal_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin openbsd freebsd netbsd 2 | 3 | package liner 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func handleCtrlZ() { 11 | pid := os.Getpid() 12 | pgrp, err := syscall.Getpgid(pid) 13 | if err == nil { 14 | syscall.Kill(-pgrp, syscall.SIGTSTP) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/signal_windows.go: -------------------------------------------------------------------------------- 1 | package liner 2 | 3 | func handleCtrlZ() {} 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-delve/liner/unixmode_solaris.go: -------------------------------------------------------------------------------- 1 | package liner 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | func (mode *termios) ApplyMode() error { 8 | return unix.IoctlSetTermios(unix.Stdin, setTermios, (*unix.Termios)(mode)) 9 | } 10 | 11 | // TerminalMode returns the current terminal input mode as an InputModeSetter. 12 | // 13 | // This function is provided for convenience, and should 14 | // not be necessary for most users of liner. 15 | func TerminalMode() (ModeApplier, error) { 16 | return getMode(unix.Stdin) 17 | } 18 | 19 | func getMode(handle int) (*termios, error) { 20 | tos, err := unix.IoctlGetTermios(handle, getTermios) 21 | return (*termios)(tos), err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package mousetrap 5 | 6 | // StartedByExplorer returns true if the program was invoked by the user 7 | // double-clicking on the executable from explorer.exe 8 | // 9 | // It is conservative and returns false if any of the internal calls fail. 10 | // It does not guarantee that the program was run from a terminal. It only can tell you 11 | // whether it was launched from explorer.exe 12 | // 13 | // On non-Windows platforms, it always returns false. 14 | func StartedByExplorer() bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.13.x 5 | - tip 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | 10 | script: 11 | - go generate 12 | - git diff --cached --exit-code 13 | - ./go.test.sh 14 | 15 | after_success: 16 | - bash <(curl -s https://codecov.io/bash) 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package runewidth 4 | 5 | // IsEastAsian return true if the current locale is CJK 6 | func IsEastAsian() bool { 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | // +build !appengine 3 | 4 | package runewidth 5 | 6 | func IsEastAsian() bool { 7 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package runewidth 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.NewLazyDLL("kernel32") 12 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 13 | ) 14 | 15 | // IsEastAsian return true if the current locale is CJK 16 | func IsEastAsian() bool { 17 | r1, _, _ := procGetConsoleOutputCP.Call() 18 | if r1 == 0 { 19 | return false 20 | } 21 | 22 | switch int(r1) { 23 | case 932, 51932, 936, 949, 950: 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package uniseg implements Unicode Text Segmentation according to Unicode 3 | Standard Annex #29 (http://unicode.org/reports/tr29/). 4 | 5 | At this point, only the determination of grapheme cluster boundaries is 6 | implemented. 7 | */ 8 | package uniseg 9 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.swp 3 | *.8 4 | *.6 5 | _obj 6 | _test* 7 | markdown 8 | tags 9 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - "1.10.x" 5 | - "1.11.x" 6 | - tip 7 | matrix: 8 | fast_finish: true 9 | allow_failures: 10 | - go: tip 11 | install: 12 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 13 | script: 14 | - go get -t -v ./... 15 | - diff -u <(echo -n) <(gofmt -d -s .) 16 | - go tool vet . 17 | - go test -v ./... 18 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | cobra.test 36 | bin 37 | 38 | .idea/ 39 | *.iml 40 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/MAINTAINERS: -------------------------------------------------------------------------------- 1 | maintainers: 2 | - spf13 3 | - johnSchnake 4 | - jpmcb 5 | - marckhouzam 6 | inactive: 7 | - anthonyfok 8 | - bep 9 | - bogem 10 | - broady 11 | - eparis 12 | - jharshman 13 | - wfernandes 14 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2023 The Cobra Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !windows 16 | // +build !windows 17 | 18 | package cobra 19 | 20 | var preExecHookFn func(*Command) 21 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.go] 12 | indent_style = tab 13 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters: 2 | disable-all: true 3 | enable: 4 | - nolintlint 5 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/go.starlark.net/starlark/empty.s: -------------------------------------------------------------------------------- 1 | // The presence of this file allows the package to use the 2 | // "go:linkname" hack to call non-exported functions in the 3 | // Go runtime, such as hardware-accelerated string hashing. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/arch/loong64/loong64asm/gnu.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package loong64asm 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // GNUSyntax returns the GNU assembler syntax for the instruction, as defined by GNU binutils. 12 | // This form typically matches the syntax defined in the Loong64 Reference Manual. See 13 | // https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html 14 | func GNUSyntax(inst Inst) string { 15 | return strings.ToLower(inst.String()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/arch/ppc64/ppc64asm/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package ppc64asm implements decoding of 64-bit PowerPC machine code. 6 | package ppc64asm 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/arch/x86/x86asm/Makefile: -------------------------------------------------------------------------------- 1 | tables.go: ../x86map/map.go ../x86.csv 2 | go run ../x86map/map.go -fmt=decoder ../x86.csv >_tables.go && gofmt _tables.go >tables.go && rm _tables.go 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | return context.WithCancelCause(parent) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/pre_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | ctx, cancel := context.WithCancel(parent) 13 | return ctx, func(error) { cancel() } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/execabs/execabs_go118.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.19 6 | 7 | package execabs 8 | 9 | import "os/exec" 10 | 11 | func isGo119ErrDot(err error) bool { 12 | return false 13 | } 14 | 15 | func isGo119ErrFieldSet(cmd *exec.Cmd) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/execabs/execabs_go119.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.19 6 | 7 | package execabs 8 | 9 | import ( 10 | "errors" 11 | "os/exec" 12 | ) 13 | 14 | func isGo119ErrDot(err error) bool { 15 | return errors.Is(err, exec.ErrDot) 16 | } 17 | 18 | func isGo119ErrFieldSet(cmd *exec.Cmd) bool { 19 | return cmd.Err != nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && !race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .localstorage 3 | node_modules 4 | devtools 5 | .eslint* 6 | .gitignore 7 | .prettier* 8 | .stylelint* 9 | CONTRIBUTING.md 10 | LICENSE 11 | npm 12 | npx 13 | package-lock.json 14 | package.json 15 | PATENTS 16 | README.md 17 | tsconfig.json -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "eslint:recommended", 4 | "plugin:@typescript-eslint/recommended", 5 | "prettier" 6 | ], 7 | "parser": "@typescript-eslint/parser", 8 | "plugins": ["@typescript-eslint"], 9 | "root": true, 10 | "ignorePatterns": ["*.min.js"] 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in the repo as binary, with no git magic updating 2 | # line endings. This produces predictable results in different environments. 3 | # 4 | # Windows users contributing to Go will need to use a modern version 5 | # of git and editors capable of LF line endings. 6 | # 7 | # Windows .bat files are known to have multiple bugs when run with LF 8 | # endings. So if they are checked in with CRLF endings, there should 9 | # be a test like the one in test/winbatch.go in the go repository. 10 | # (See golang.org/issue/37791.) 11 | # 12 | # See golang.org/issue/9281. 13 | 14 | * -text 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .localstorage -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.prettierrc.json: -------------------------------------------------------------------------------- 1 | {"proseWrap": "always"} 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["stylelint-config-standard"], 3 | "rules": { 4 | "declaration-property-value-allowed-list": { 5 | "/color/": ["/^var\\(--/", "transparent"] 6 | }, 7 | "unit-disallowed-list": ["px"], 8 | "selector-class-pattern": "^[a-zA-Z\\-]+$" 9 | }, 10 | "ignoreFiles": ["**/*.min.css"] 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/dir.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package telemetry 6 | 7 | import "golang.org/x/telemetry/internal/telemetry" 8 | 9 | // Dir returns the telemetry directory. 10 | func Dir() string { 11 | return telemetry.Default.Dir() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/doc.go: -------------------------------------------------------------------------------- 1 | package telemetry 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/internal/crashmonitor/crash_go123.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.23 6 | // +build go1.23 7 | 8 | package crashmonitor 9 | 10 | import ( 11 | "os" 12 | "runtime/debug" 13 | ) 14 | 15 | func init() { 16 | setCrashOutput = func(f *os.File) error { return debug.SetCrashOutput(f, debug.CrashOptions{}) } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/internal/mmap/mmap_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (js && wasm) || wasip1 || plan9 || (solaris && !go1.20) 6 | 7 | package mmap 8 | 9 | import ( 10 | "io" 11 | "os" 12 | ) 13 | 14 | // mmapFile on other systems doesn't mmap the file. It just reads everything. 15 | func mmapFile(f *os.File) (*Data, error) { 16 | b, err := io.ReadAll(f) 17 | if err != nil { 18 | return nil, err 19 | } 20 | return &Data{f, b, nil}, nil 21 | } 22 | 23 | func munmapFile(_ *Data) error { 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/internal/telemetry/dateonly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package telemetry 6 | 7 | // TODO(rfindley): replace uses of DateOnly with time.DateOnly once we no 8 | // longer support building gopls with go 1.19. 9 | const DateOnly = "2006-01-02" 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/npm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2022 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | docker run \ 7 | --rm \ 8 | --volume $(pwd):/workspace \ 9 | --workdir /workspace \ 10 | --env NODE_OPTIONS="--dns-result-order=ipv4first" \ 11 | --entrypoint npm \ 12 | node:18.16.0-slim \ 13 | $@ 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/npx: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2022 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | docker run \ 7 | --rm \ 8 | --volume $(pwd):/workspace \ 9 | --workdir /workspace \ 10 | --env NODE_OPTIONS="--dns-result-order=ipv4first" \ 11 | --entrypoint npx \ 12 | node:18.16.0-slim \ 13 | $@ 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "eslint": "eslint . --fix", 4 | "stylelint": "stylelint '**/*.css' --fix", 5 | "prettier": "prettier --write **/*.{css,ts,md,yaml} !**/*.min.css", 6 | "all": "run-s --continue-on-error eslint stylelint prettier" 7 | }, 8 | "devDependencies": { 9 | "@typescript-eslint/eslint-plugin": "5.59.6", 10 | "@typescript-eslint/parser": "5.59.6", 11 | "eslint": "8.40.0", 12 | "eslint-config-prettier": "8.8.0", 13 | "npm-run-all": "4.1.5", 14 | "prettier": "2.8.8", 15 | "stylelint": "15.6.2", 16 | "stylelint-config-standard": "33.0.0", 17 | "typescript": "5.0.4" 18 | }, 19 | "dependencies": { 20 | "@observablehq/plot": "0.6.9", 21 | "d3": "7.8.5" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/start_posix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | 7 | package telemetry 8 | 9 | import ( 10 | "os/exec" 11 | "syscall" 12 | ) 13 | 14 | func init() { 15 | daemonize = daemonizePosix 16 | } 17 | 18 | func daemonizePosix(cmd *exec.Cmd) { 19 | cmd.SysProcAttr = &syscall.SysProcAttr{ 20 | Setsid: true, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 3 | "compilerOptions": { 4 | "target": "ES2022", 5 | "module": "ES2022", 6 | "moduleResolution": "node", 7 | 8 | "strict": true, 9 | "allowUnusedLabels": false, 10 | "allowUnreachableCode": false, 11 | "exactOptionalPropertyTypes": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "noImplicitOverride": true, 14 | "noImplicitReturns": true, 15 | "noPropertyAccessFromIndexSignature": true, 16 | "noUncheckedIndexedAccess": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | 20 | "checkJs": true, 21 | 22 | "esModuleInterop": true, 23 | "skipLibCheck": true, 24 | "forceConsistentCasingInFileNames": true 25 | }, 26 | } -------------------------------------------------------------------------------- /vendor/golang.org/x/telemetry/types_alias.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package telemetry 6 | 7 | import "golang.org/x/telemetry/internal/telemetry" 8 | 9 | // Common types and directories used by multiple packages. 10 | 11 | // An UploadConfig controls what data is uploaded. 12 | type UploadConfig = telemetry.UploadConfig 13 | 14 | type ProgramConfig = telemetry.ProgramConfig 15 | 16 | type CounterConfig = telemetry.CounterConfig 17 | 18 | // A Report is what's uploaded (or saved locally) 19 | type Report = telemetry.Report 20 | 21 | type ProgramReport = telemetry.ProgramReport 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package event provides a set of packages that cover the main 6 | // concepts of telemetry in an implementation agnostic way. 7 | package event 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.11 6 | // +build !go1.11 7 | 8 | package gcimporter 9 | 10 | import "go/types" 11 | 12 | func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { 13 | named := make([]*types.Named, len(embeddeds)) 14 | for i, e := range embeddeds { 15 | var ok bool 16 | named[i], ok = e.(*types.Named) 17 | if !ok { 18 | panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") 19 | } 20 | } 21 | return types.NewInterface(methods, named) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.11 6 | // +build go1.11 7 | 8 | package gcimporter 9 | 10 | import "go/types" 11 | 12 | func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { 13 | return types.NewInterfaceType(methods, embeddeds) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/support_go117.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.18 6 | // +build !go1.18 7 | 8 | package gcimporter 9 | 10 | import "go/types" 11 | 12 | const iexportVersion = iexportVersionGo1_11 13 | 14 | func additionalPredeclared() []types.Type { 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/unified_no.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !(go1.18 && goexperiment.unified) 6 | // +build !go1.18 !goexperiment.unified 7 | 8 | package gcimporter 9 | 10 | const unifiedIR = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.18 && goexperiment.unified 6 | // +build go1.18,goexperiment.unified 7 | 8 | package gcimporter 9 | 10 | const unifiedIR = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.18 6 | // +build !go1.18 7 | 8 | package gcimporter 9 | 10 | import ( 11 | "fmt" 12 | "go/token" 13 | "go/types" 14 | ) 15 | 16 | func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { 17 | err = fmt.Errorf("go/tools compiled with a Go version earlier than 1.18 cannot read unified IR export data") 18 | return 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkgbits 6 | 7 | const ( 8 | flagSyncMarkers = 1 << iota // file format contains sync markers 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.7 6 | // +build !go1.7 7 | 8 | // TODO(mdempsky): Remove after #44505 is resolved 9 | 10 | package pkgbits 11 | 12 | import "runtime" 13 | 14 | func walkFrames(pcs []uintptr, visit frameVisitor) { 15 | for _, pc := range pcs { 16 | fn := runtime.FuncForPC(pc) 17 | file, line := fn.FileLine(pc) 18 | 19 | visit(file, line, fn.Name(), pc-fn.Entry()) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.7 6 | // +build go1.7 7 | 8 | package pkgbits 9 | 10 | import "runtime" 11 | 12 | // walkFrames calls visit for each call frame represented by pcs. 13 | // 14 | // pcs should be a slice of PCs, as returned by runtime.Callers. 15 | func walkFrames(pcs []uintptr, visit frameVisitor) { 16 | if len(pcs) == 0 { 17 | return 18 | } 19 | 20 | frames := runtime.CallersFrames(pcs) 21 | for { 22 | frame, more := frames.Next() 23 | visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry) 24 | if !more { 25 | return 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/support.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkgbits 6 | 7 | import "fmt" 8 | 9 | func assert(b bool) { 10 | if !b { 11 | panic("assertion failed") 12 | } 13 | } 14 | 15 | func errorf(format string, args ...interface{}) { 16 | panic(fmt.Errorf(format, args...)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.18 6 | // +build !go1.18 7 | 8 | package typeparams 9 | 10 | // Enabled reports whether type parameters are enabled in the current build 11 | // environment. 12 | const Enabled = false 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.18 6 | // +build go1.18 7 | 8 | package typeparams 9 | 10 | // Note: this constant is in a separate file as this is the only acceptable 11 | // diff between the <1.18 API of this package and the 1.18 API. 12 | 13 | // Enabled reports whether type parameters are enabled in the current build 14 | // environment. 15 | const Enabled = true 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/typesinternal/types_118.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.18 6 | // +build go1.18 7 | 8 | package typesinternal 9 | 10 | import ( 11 | "go/types" 12 | ) 13 | 14 | func init() { 15 | SetGoVersion = func(conf *types.Config, version string) bool { 16 | conf.GoVersion = version 17 | return true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------