-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path_dlv
565 lines (542 loc) · 32.8 KB
/
_dlv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
#compdef dlv
# -----------------------------------------------------------------------------
# The BSD-3-Clause License
#
# Copyright 2016, The zsh-completions Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# github.com/go-delve/delve
#
# -----------------------------------------------------------------------------
function _dlv() {
local context curcontext=$curcontext state line ret=1
declare -A opt_args
_go_packages() {
local -a gopaths
gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)")
for p in $gopaths; do
_alternative ':go packages:_path_files -W "$p/src" -/'
done
}
local -a commands
commands=(
'attach:Attach to running process and begin debugging.'
'connect:Connect to a headless debug server.'
'dap:[EXPERIMENTAL] Starts a TCP server communicating via Debug Adaptor Protocol (DAP).'
'debug:Compile and begin debugging main package in current directory, or the package specified.'
'exec:Execute a precompiled binary, and begin a debug session.'
'help:Help about any command'
'test:Compile test binary and begin debugging program.'
'trace:Compile and begin tracing program.'
'version:Prints version.'
)
# TODO(zchee): Need it?
case ${OSTYPE} in
darwin*)
# nothig to do
;;
linux*|cygwin*|msys*)
commands+=('core:Examine a core dump.')
;;
esac
local -a _backend
_backend=(
'default:Uses lldb on macOS, native everywhere else'
'native:Native backend'
'lldb:Uses lldb-server or debugserver'
'rr:Uses mozilla rr'
)
local -a _global_flags
_global_flags=(
'--accept-multiclient[Allows a headless server to accept multiple client connections.]'
"--allow-non-terminal-interactive[Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr]"
'--api-version=[Selects API version when headless. \(default: 1\)]:api version:(1 2)'
"--backend=[Backend selection \(default: default\)]:backend:{_describe 'backend' _backend}"
'--build-flags=[Build flags, to be passed to the compiler.]:build flags'
'--check-go-version=[Checks that the version of Go in use is compatible with Delve. \(default: true\)]:boolean:(true false)'
'--headless[Run debug server only, in headless mode.]'
'--init=[Init file, executed by the terminal client.]:init file:_files'
{-l,--listen}='[Debugging server listen address. \(default: "127.0.0.1:0"\)]:listen address'
'--log[Enable debugging server logging.]'
'--log-dest=[Writes logs to the specified file or file descriptor.]:log dest'
'--log-output=[Comma separated list of components that should produce debug output]:log output'
'--only-same-user=[Only connections from the same user that started this instance of Delve are allowed to connect. \(default: true\)]:boolean:(true false)'
{-r,--redirect}='[Specifies redirect rules for target process]:redirect rules'
'--wd=[Working directory for running the program.]:working directory:_files'
)
# '--accept-multiclient[Allows a headless server to accept multiple client connections.]'
# '--api-version[Selects API version when headless. \(default: 1\)]'
# "--backend[Backend selection]:backend:{_describe 'backend' _backend}"
# '--build-flags[Build flags, to be passed to the compiler.]'
# '--check-go-version[Checks that the version of Go in use is compatible with Delve.]'
# '--headless[Run debug server only, in headless mode.]'
# '--init[Init file, executed by the terminal client.]:init file:_files'
# {-l,--listen}'[Debugging server listen address. \(default: 127.0.0.1:0\)]:listen address'
# '--log[Enable debugging server logging.]'
# '--log-dest[Writes logs to the specified file or file descriptor]:log destination:_files'
# "--log-output[Comma separated list of components that should produce debug output]:log output:_files"
# '--only-same-user[Only connections from the same user that started this instance of Delve are allowed to connect.]'
# '--wd[Working directory for running the program. \(default: current dir\)]:Working directory:_files'
_arguments -C \
$_global_flags \
"1: :{_describe 'dlv command' commands}" \
'*:: :->args' \
&& ret=0
case $words[1] in
attach)
_arguments \
'--continue[Continue the debugged process on start.]' \
'1:pid:_pids' \
'*:executable:_files' \
$_global_flags
;;
connect)
_arguments \
'1:addr:_ipset' \
$_global_flags
;;
core)
_arguments \
'1:executable:_files' \
'2:core file or minidumps:_files' \
$_global_flags
;;
dap)
_arguments \
$_global_flags
;;
debug)
_arguments \
'--continue[Continue the debugged process on start.]' \
'--output[Output path for the binary. \(default "./__debug_bin"\)]:output binary path:_files' \
'--tty[TTY to use for the target program]:target tty:_tty' \
'*:package:_go_packages' \
$_global_flags
;;
exec)
_arguments \
'--continue[Continue the debugged process on start.]' \
'--tty[TTY to use for the target program]:target tty' \
'1:binary:_exec' \
$_global_flags
;;
test)
_arguments \
'--output[Output path for the binary. \(default "./__debug_bin"\)]:output binary path:_files' \
'*:package:_go_packages' \
$_global_flags
;;
trace)
_arguments \
{-e,--exec}'[Binary file to exec and trace.]:binary file:_files' \
'--output[Output path for the binary. \(default "debug"\)]:output binary path:_files' \
{-p,--pid}'[Pid to attach to.]:attach pid:_pids' \
{-s,--stack}'[Show stack trace with given depth.]:stack trace depth' \
{-t,--test}'[Trace a test binary.]:test binary:_files' \
'1:package:_go_packages' \
'2:regexp' \
$_global_flags
;;
version)
_arguments $_global_flags
;;
help)
local -a topics
topics=(
'backend:Help about the --backend flag.'
'log:Help about logging flags.'
'redirect:Help about file redirection'
)
_arguments "1: :{_describe 'command' commands -- topics}"
;;
esac
return ret
}
_dlv "$*"
# -------------------------------------------------------------------------------
#
# Delve is a source level debugger for Go programs.
#
# Delve enables you to interact with your program by controlling the execution of the process,
# evaluating variables, and providing information of thread / goroutine state, CPU register state and more.
#
# The goal of this tool is to provide a simple yet powerful interface for debugging Go programs.
#
# Pass flags to the program you are debugging using `--`, for example:
#
# `dlv exec ./hello -- server --config conf/config.toml`
#
# Usage:
# dlv [command]
#
# Available Commands:
# attach Attach to running process and begin debugging.
# connect Connect to a headless debug server.
# core Examine a core dump.
# dap [EXPERIMENTAL] Starts a TCP server communicating via Debug Adaptor Protocol (DAP).
# debug Compile and begin debugging main package in current directory, or the package specified.
# exec Execute a precompiled binary, and begin a debug session.
# help Help about any command
# run Deprecated command. Use 'debug' instead.
# test Compile test binary and begin debugging program.
# trace Compile and begin tracing program.
# version Prints version.
#
# Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# Additional help topics:
# dlv backend Help about the --backend flag.
# dlv log Help about logging flags.
# dlv redirect Help about file redirection.
#
# Use "dlv [command] --help" for more information about a command.#
#
# -------------------------------------------------------------------------------
#
# Attach to an already running process and begin debugging it.
#
# This command will cause Delve to take control of an already running process, and
# begin a new debug session. When exiting the debug session you will have the
# option to let the process continue or kill it.
#
# Usage:
# dlv attach pid [executable] [flags]
#
# Flags:
# --continue Continue the debugged process on start.
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Connect to a running headless debug server.
#
# Usage:
# dlv connect addr [flags]
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Examine a core dump (only supports linux and windows core dumps).
#
# The core command will open the specified core file and the associated
# executable and let you examine the state of the process when the
# core dump was taken.
#
# Currently supports linux/amd64 and linux/arm64 core files and windows/amd64 minidumps.
#
# Usage:
# dlv core <executable> <core> [flags]
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# [EXPERIMENTAL] Starts a TCP server communicating via Debug Adaptor Protocol (DAP).
#
# The server supports debugging of a precompiled binary akin to 'dlv exec' via a launch request.
# It does not yet support support specification of program arguments.
# It does not yet support launch requests with 'debug' and 'test' modes that require compilation.
# It does not yet support attach requests to debug a running process like with 'dlv attach'.
# It does not yet support asynchronous request-response communication.
# The server does not accept multiple client connections.
#
# Usage:
# dlv dap [flags]
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Compiles your program with optimizations disabled, starts and attaches to it.
#
# By default, with no arguments, Delve will compile the 'main' package in the
# current directory, and begin to debug it. Alternatively you can specify a
# package name and Delve will compile that package instead, and begin a new debug
# session.
#
# Usage:
# dlv debug [package] [flags]
#
# Flags:
# --continue Continue the debugged process on start.
# --output string Output path for the binary. (default "./__debug_bin")
# --tty string TTY to use for the target program
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Execute a precompiled binary and begin a debug session.
#
# This command will cause Delve to exec the binary and immediately attach to it to
# begin a new debug session. Please note that if the binary was not compiled with
# optimizations disabled, it may be difficult to properly debug it. Please
# consider compiling debugging binaries with -gcflags="all=-N -l" on Go 1.10
# or later, -gcflags="-N -l" on earlier versions of Go.
#
# Usage:
# dlv exec <path/to/binary> [flags]
#
# Flags:
# --continue Continue the debugged process on start.
# --tty string TTY to use for the target program
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Help provides help for any command in the application.
# Simply type dlv help [path to command] for full details.
#
# Usage:
# dlv help [command] [flags]
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Compiles a test binary with optimizations disabled and begins a new debug session.
#
# The test command allows you to begin a new debug session in the context of your
# unit tests. By default Delve will debug the tests in the current directory.
# Alternatively you can specify a package name, and Delve will debug the tests in
# that package instead.
#
# Usage:
# dlv test [package] [flags]
#
# Flags:
# --output string Output path for the binary. (default "debug.test")
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Trace program execution.
#
# The trace sub command will set a tracepoint on every function matching the
# provided regular expression and output information when tracepoint is hit. This
# is useful if you do not want to begin an entire debug session, but merely want
# to know what functions your process is executing.
#
# The output of the trace sub command is printed to stderr, so if you would like to
# only see the output of the trace operations you can redirect stdout.
#
# Usage:
# dlv trace [package] regexp [flags]
#
# Flags:
# -e, --exec string Binary file to exec and trace.
# --output string Output path for the binary. (default "debug")
# -p, --pid int Pid to attach to.
# -s, --stack int Show stack trace with given depth.
# -t, --test Trace a test binary.
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
#
# Prints version.
#
# Usage:
# dlv version [flags]
#
# Global Flags:
# --accept-multiclient Allows a headless server to accept multiple client connections.
# --allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
# --api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
# --backend string Backend selection (see 'dlv help backend'). (default "default")
# --build-flags string Build flags, to be passed to the compiler.
# --check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
# --headless Run debug server only, in headless mode.
# --init string Init file, executed by the terminal client.
# -l, --listen string Debugging server listen address. (default "127.0.0.1:0")
# --log Enable debugging server logging.
# --log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
# --log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
# --only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
# -r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
# --wd string Working directory for running the program.
#
# -------------------------------------------------------------------------------
# vim:ft=zsh:et:sts=2:sw=2