Skip to content

Undo v1.20.2 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: upstream-v1.20.2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ name = "go"
enabled = true

[analyzers.meta]
import_path = "github.com/go-delve/delve"
import_path = "github.com/undoio/delve"
dependencies_vendored = true
2 changes: 1 addition & 1 deletion Documentation/KnownBugs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Known Bugs

- 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).
- 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/undoio/delve/issues/528).
- 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.
- `reverse step` will not reverse step into functions called by deferred calls.
10 changes: 5 additions & 5 deletions Documentation/api/ClientHowto.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Command line arguments that should be handed to the inferior process should be s
dlv exec --headless ./somebinary -- these arguments are for the inferior process
```

Specifying a static port number, like in the [README](//github.com/go-delve/Delve/tree/master/Documentation/README.md) example, can be done using `--listen=127.0.0.1:portnumber`.
Specifying a static port number, like in the [README](//github.com/undoio/Delve/tree/master/Documentation/README.md) example, can be done using `--listen=127.0.0.1:portnumber`.

This will, however, cause problems if you actually spawn multiple instances of the debugger.

Expand All @@ -39,11 +39,11 @@ The `--log-dest` option can be used to redirect the "API server listening at:" m

Once you have a running headless instance you can connect to it and start sending commands. Delve's protocol is built on top of the [JSON-RPC 1.0 specification](https://www.jsonrpc.org/specification_v1).

The methods of a `service/rpc2.RPCServer` are exposed through this connection, to find out which requests you can send see the documentation of RPCServer on [godoc](https://godoc.org/github.com/go-delve/Delve/service/rpc2#RPCServer).
The methods of a `service/rpc2.RPCServer` are exposed through this connection, to find out which requests you can send see the documentation of RPCServer on [godoc](https://godoc.org/github.com/undoio/Delve/service/rpc2#RPCServer).

### Example

Let's say you are trying to create a breakpoint. By looking at [godoc](https://godoc.org/github.com/go-delve/Delve/service/rpc2#RPCServer) you'll find that there is a `CreateBreakpoint` method in `RPCServer`.
Let's say you are trying to create a breakpoint. By looking at [godoc](https://godoc.org/github.com/undoio/Delve/service/rpc2#RPCServer) you'll find that there is a `CreateBreakpoint` method in `RPCServer`.

This method, like all other methods of RPCServer that you can call through the API, has two arguments: `args` and `out`: `args` contains all the input arguments of `CreateBreakpoint`, while `out` is what `CreateBreakpoint` will return to you.

Expand Down Expand Up @@ -190,7 +190,7 @@ If you want to let your users specify a breakpoint on a function selected
from a list of all functions you should specify the name of the function in
the FunctionName field of Breakpoint.

If you want to support the [same language as dlv's break and trace commands](//github.com/go-delve/Delve/tree/master/Documentation/cli/locspec.md)
If you want to support the [same language as dlv's break and trace commands](//github.com/undoio/Delve/tree/master/Documentation/cli/locspec.md)
you should call RPCServer.FindLocation and
then use the returned slice of Location objects to create Breakpoints to
pass to CreateBreakpoint: just fill each Breakpoint.Addr with the
Expand Down Expand Up @@ -244,7 +244,7 @@ are interested in the topmost stack frame of the current goroutine (or
thread) use: `EvalScope{ GoroutineID: -1, Frame: 0 }`.

More information on the expression language interpreted by RPCServer.Eval
can be found [here](//github.com/go-delve/Delve/tree/master/Documentation/cli/expr.md).
can be found [here](//github.com/undoio/Delve/tree/master/Documentation/cli/expr.md).

### Variable shadowing

Expand Down
9 changes: 4 additions & 5 deletions Documentation/api/dap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ detailed [debugging documentation](https://github.com/golang/vscode-go/blob/mast

[DAP](https://microsoft.github.io/debug-adapter-protocol/specification) is a general debugging protocol supported by many [tools](https://microsoft.github.io/debug-adapter-protocol/implementors/tools/) and [programming languages](https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/). We tailored it to Go specifics, such as mapping [threads request](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Threads) to communicate goroutines and [exceptionInfo request](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ExceptionInfo) to support panics and fatal errors.

See [dap.Server.handleRequest](https://github.com/go-delve/delve/search?q=handleRequest) and capabilities set in [dap.Server.onInitializeRequest](https://github.com/go-delve/delve/search?q=onInitializeRequest) for an up-to-date list of supported requests and options.
See [dap.Server.handleRequest](https://github.com/undoio/delve/search?q=handleRequest) and capabilities set in [dap.Server.onInitializeRequest](https://github.com/undoio/delve/search?q=onInitializeRequest) for an up-to-date list of supported requests and options.

## Launch and Attach Configurations

In addition to the general [DAP spec](https://microsoft.github.io/debug-adapter-protocol/specification), the server supports the following implementation-specific configuration options for starting the debug session:

<table border=1>
<tr><th>request<th>mode<th>required<th colspan=9>optional<th></tr>
<tr><td rowspan=5>launch<br><a href="https://pkg.go.dev/github.com/go-delve/delve/service/dap#LaunchConfig">godoc</a>
<tr><td rowspan=5>launch<br><a href="https://pkg.go.dev/github.com/undoio/delve/service/dap#LaunchConfig">godoc</a>
<td>debug<td>program <td>dlvCwd<td>env<td>backend<td>args<td>cwd<td>buildFlags<td>output<td>noDebug
<td rowspan=7>
substitutePath<br>
Expand All @@ -44,13 +44,12 @@ In addition to the general [DAP spec](https://microsoft.github.io/debug-adapter-
<td>core<td>program<br>corefilePath<td>dlvCwd<td>env<td> <td> <td> <td> <td> <td> </tr>
<tr>
<td>replay<td>traceDirPath <td>dlvCwd<td>env<td> <td> <td> <td> <td> <td> </tr>
<tr><td rowspan=2>attach<br><a href="https://pkg.go.dev/github.com/go-delve/delve/service/dap#AttachConfig">godoc</a>
<tr><td rowspan=2>attach<br><a href="https://pkg.go.dev/github.com/undoio/delve/service/dap#AttachConfig">godoc</a>
<td>local<td>processId <td> <td> <td>backend<td> <td> <td> <td> <td> </tr>
<tr>
<td>remote<td> <td> <td> <td> <td> <td> <td> <td> <td> </tr>
</table>


Not all of the configurations are supported by each of the two available DAP servers:

<table border=1>
Expand Down Expand Up @@ -143,4 +142,4 @@ one must first update the [go-dap](https://github.com/google/go-dap) dependency.
<!--- TODO:
- most requests are handled synchronously and block
- hence many commands not supported when running, but setting breakpoints is
--->
--->
4 changes: 2 additions & 2 deletions Documentation/api/json-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Note that this JSON-RPC interface is served over a streaming socket, *not* over
# API versions

Delve currently supports two versions of its API. By default a headless instance of `dlv` will serve APIv1 for backward compatibility with old clients, however new clients should use APIv2 as new features will only be made available through version 2. To select APIv2 use `--api-version=2` command line argument.
Clients can also select APIv2 by sending a [SetApiVersion](https://godoc.org/github.com/go-delve/delve/service/rpccommon#RPCServer.SetApiVersion) request specifying `APIVersion = 2` after connecting to the headless instance.
Clients can also select APIv2 by sending a [SetApiVersion](https://godoc.org/github.com/undoio/delve/service/rpccommon#RPCServer.SetApiVersion) request specifying `APIVersion = 2` after connecting to the headless instance.

# API version 2 documentation

All the methods of the type `service/rpc2.RPCServer` can be called using JSON-RPC, the documentation for these calls is [available on godoc](https://godoc.org/github.com/go-delve/delve/service/rpc2#RPCServer).
All the methods of the type `service/rpc2.RPCServer` can be called using JSON-RPC, the documentation for these calls is [available on godoc](https://godoc.org/github.com/undoio/delve/service/rpc2#RPCServer).

Note that all exposed methods take one single input parameter (usually called `args`) of a struct type and also return a result of a struct type. Also note that the method name should be prefixed with `RPCServer.` in JSON-RPC.

Expand Down
6 changes: 3 additions & 3 deletions Documentation/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Sets a breakpoint.

break [name] [locspec]

See [Documentation/cli/locspec.md](//github.com/go-delve/delve/tree/master/Documentation/cli/locspec.md) for the syntax of locspec. If locspec is omitted a breakpoint will be set on the current line.
See [Documentation/cli/locspec.md](//github.com/undoio/delve/tree/master/Documentation/cli/locspec.md) for the syntax of locspec. If locspec is omitted a breakpoint will be set on the current line.

See also: "help on", "help cond" and "help clear"

Expand Down Expand Up @@ -577,7 +577,7 @@ Executes a file containing a list of delve commands

source <path>

If path ends with the .star extension it will be interpreted as a starlark script. See [Documentation/cli/starlark.md](//github.com/go-delve/delve/tree/master/Documentation/cli/starlark.md) for the syntax.
If path ends with the .star extension it will be interpreted as a starlark script. See [Documentation/cli/starlark.md](//github.com/undoio/delve/tree/master/Documentation/cli/starlark.md) for the syntax.

If path is a single '-' character an interactive starlark interpreter will start instead. Type 'exit' to exit.

Expand Down Expand Up @@ -645,7 +645,7 @@ Set tracepoint.

trace [name] [locspec]

A tracepoint is a breakpoint that does not stop the execution of the program, instead when the tracepoint is hit a notification is displayed. See [Documentation/cli/locspec.md](//github.com/go-delve/delve/tree/master/Documentation/cli/locspec.md) for the syntax of locspec. If locspec is omitted a tracepoint will be set on the current line.
A tracepoint is a breakpoint that does not stop the execution of the program, instead when the tracepoint is hit a notification is displayed. See [Documentation/cli/locspec.md](//github.com/undoio/delve/tree/master/Documentation/cli/locspec.md) for the syntax of locspec. If locspec is omitted a tracepoint will be set on the current line.

See also: "help on", "help cond" and "help clear"

Expand Down
2 changes: 1 addition & 1 deletion Documentation/cli/expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To see more values use the slice operator:

For this purpose delve allows use of the slice operator on maps, `m[64:]` will return the key/value pairs of map `m` that follow the first 64 key/value pairs (note that delve iterates over maps using a fixed ordering).

These limits can be configured with `max-string-len` and `max-array-values`. See [config](https://github.com/go-delve/delve/tree/master/Documentation/cli#config) for usage.
These limits can be configured with `max-string-len` and `max-array-values`. See [config](https://github.com/undoio/delve/tree/master/Documentation/cli#config) for usage.

# Interfaces

Expand Down
Loading