1. 09 9月, 2021 1 次提交
  2. 02 9月, 2021 5 次提交
  3. 01 9月, 2021 1 次提交
  4. 26 8月, 2021 1 次提交
    • H
      dap: define LaunchConfig/AttachConfig types (#2571) · 1433c079
      Hyang-Ah Hana Kim 提交于
      Formally define these types and document their meaning.
      We will auto-generate the dlv-dap documentation from these Go type doc.
      
      mapToStruct is a helper that sets the given struct's fields with the
      info in map[string]interface{} (launch/attach's Arguments). We achieve
      this by reencoding map[string]interface{} to json and decoding back to
      the target struct. If go-dap left the implementation-specific arguments
      as json.RawMessage and let the implementation decode as needed, this
      reencoding could've been avoided.
      
      encoding/json itself does not have mean to enforce required fields.
      There was a test case that checks substitutePath elements must set
      both from/to fields. Path.UnmarshalJSON implements the check.
      I am not yet sure about the need for distinction between missing
      'from/to' and empty strings yet. (empty value is useful when dealing with
      a binary built with trimpath, right?)
      
      A minor behavior change - previously, if noDebug is not a boolean type,
      we ignored the attribute silently. Since we use json decoding, any
      mismatched types will cause an error and this non-boolean type noDebug
      attribute will result in launch failure.
      1433c079
  5. 25 8月, 2021 2 次提交
  6. 24 8月, 2021 5 次提交
  7. 21 8月, 2021 1 次提交
  8. 18 8月, 2021 2 次提交
  9. 16 8月, 2021 1 次提交
  10. 10 8月, 2021 5 次提交
    • A
      service: fix sameuser check (#2642) · 51375157
      Alessandro Arzilli 提交于
      Change the socket search to check both the remote and local fields of the
      socket match the socket we want to find.
      
      Sockets are identified by the 4-uple
      
      	local_addr, local_port, remote_addr, remote_port
      
      Two socket can differ by a single one of this four elements.
      It is possible for the same local_port to be used by two different sockets,
      as long as they are connecting to different remote addresses (or remote
      ports).
      
      An example of this bug in action can be seen at:
      
      https://github.com/golang/vscode-go/runs/3141270564?check_suite_focus=true
      
      There the server starts listening on 127.0.0.1:46011 and rejects a valid
      client connection by finding the following socket:
      
      60: 0100007F:DD82 0100007F:962D 06 00000000:00000000 03:00000133 00000000     0        0 0 3 0000000000000000
      
      the local address of this socket is 0100007F:DD82 (127.0.0.1:56706), and the
      remote address is 0100007F:962D (127.0.0.1:38445).
      
      The reported error is:
      
      	closing connection from different user (127.0.0.1:56706): connections to localhost are only accepted from the same UNIX user for security reasons
      
      note how the local port does match the socket line (56706) but the remote
      port is wrong (38445 instead of 46011).
      
      Note also that the state of this socket is 06, or TIME_WAIT, which would be
      impossible if this was the right socket, since the right socket would still
      be open.
      
      Fixes https://github.com/golang/vscode-go/issues/1555
      51375157
    • S
      pkg/proc: configure target to not clear stepping breakpoints (#2635) · c426c5b3
      Suzy Mueller 提交于
      In order for DAP to support halting the program (either manually or on a breakpoint) performing some action and then resuming execution, there needs to be a way to stop the program without clearing the internal breakpoints. This is necessary for log points and stopping the program to set breakpoints.
      
      The debugging UI makes it seem like a user should be able to set or clear a breakpoint at any time. Adding this ability to complete synchronous requests while the program is running is thus important to create a seamless user experience.
      
      This change just adds a configuration to determine whether the target should clear the stepping breakpoints, and changes the server to use this new mode. Using the new mode means that the DAP server must determine when it expect the next to be canceled and do this manually.
      c426c5b3
    • A
      proc,terminal,service: support stack watchpoints (#2521) · 4264bf00
      Alessandro Arzilli 提交于
      * terminal,service: add way to see internal breakpoints
      
      Now that Delve has internal breakpoints that survive for long periods
      of time it will be useful to have an option to display them.
      
      * proc,terminal,service: support stack watchpoints
      
      Adds support for watchpoints on stack allocated variables.
      
      When a stack variable is watched, in addition to the normal watchpoint
      some support breakpoints are created:
      
      - one breakpoint inside runtime.copystack, used to adjust the address
        of the watchpoint when the stack is resized
      - one or more breakpoints used to detect when the stack variable goes
        out of scope, those are similar to the breakpoints set by StepOut.
      
      Implements #279
      4264bf00
    • A
      proc: move breakpoint condition evaluation out of backends (#2628) · f3e76238
      Alessandro Arzilli 提交于
      * proc: move breakpoint condition evaluation out of backends
      
      Moves breakpoint condition evaluation from the point where breakpoints
      are set, inside ContinueOnce, to (*Target).Continue.
      
      This accomplishes three things:
      
      1. the breakpoint evaluation method needs not be exported anymore
      2. breakpoint condition evaluation can be done with a full scope,
         containing a Target object, something that wasn't possible before
         because ContinueOnce doesn't have access to the Target object.
      3. moves breakpoint condition evaluation out of the critical section
         where some of the threads of the target process might be still
         running.
      
      * proc/native: handle process death during stop() on Windows
      
      It is possible that the thread dies while we are inside the stop()
      function. This results in an Access is denied error being returned by
      SuspendThread being called on threads that no longer exist.
      
      Delay the reporting the error from SuspendThread until the end of
      stop() and only report it if the thread still exists at that point.
      
      Fixes flakyness with TestIssue1101 that was exacerbated by moving
      breakpoint condition evaluation outside of the backends.
      f3e76238
    • H
      4e5bddee
  11. 06 8月, 2021 4 次提交
  12. 05 8月, 2021 3 次提交
    • D
      service/debugger: Remove target lock on GetBufferedTracepoints (#2645) · 7caa534d
      Derek Parker 提交于
      There is already a lock on the actual buffered tracepoints collection
      within proc, and this method call doesn't do anything to mutate Target
      otherwise so we shouldn't be opening ourselves up for a race condition
      error or any other kind of parallelism problem.
      
      Additionally, with this lock we essentially can never get the data until
      the process has exited becuase `continue` will lock the target. This
      change allows us to get the buffered tracepoint information immediately
      and display it as the program is running.
      7caa534d
    • A
      service/dap: fix TestNextParked/TestStepInParked (#2643) · 2971fd4c
      Alessandro Arzilli 提交于
      The loop searching for a suitable goroutine is not guaranteed to ever
      find it, and failing to find one is not an error.
      
      Changes testStepParkedHelper to match the behavior of TestNextParked in
      proc_test.go.
      Deletes TestStepInParked because it does not test anything meaningful
      beyond what's already tested by TestNextParked.
      2971fd4c
    • A
      tests: check presence of gcc for cgo tests (#2644) · 4e242098
      Alessandro Arzilli 提交于
      The install of gcc sometimes fails on our CI, it is not an error if the
      tests for cgo can not run because there's no C compiler.
      4e242098
  13. 04 8月, 2021 5 次提交
  14. 31 7月, 2021 1 次提交
  15. 30 7月, 2021 2 次提交
    • S
      service/dap: page stack frames (#2597) · 89ed5a0b
      Suzy Mueller 提交于
      Returning monotonically increasing totalFrames values for subsequent requests can be used to enforce paging in the client. If we are not at the end of the stackFrames that are returned, we return a higher total frames to suggest to the client that they should request more frames.
      89ed5a0b
    • S
      service/dap: make next while nexting error more clear (#2622) · b87a1fc5
      Suzy Mueller 提交于
      To make it more clear that the user can resume the program when they encounter a next while nexting error, make the exception information have instructions for resuming the program. This implements the suggestions outlined by @polinasok in #2443.
      b87a1fc5
  16. 28 7月, 2021 1 次提交
    • A
      Fix crashes on Go dev.typeparams (soon to be Go main branch) (#2627) · a2b83999
      Austin Clements 提交于
      * proc: Go 1.18 removes the _defer.siz field
      
      As of Go 1.17, the _defer.siz field is always 0 because _defer no
      longer stores defer call arguments at all. golang.org/cl/326062
      removes it entirely for Go 1.18. Simply treat it as 0 if the field is
      missing from the _defer type.
      
      * proc: Go 1.18 changes _defer.fn from *funcval to func()
      
      golang.org/cl/325918 changed the type of the _defer.fn field from
      *funcval to func() for Go 1.18. This CL was later reverted because it
      caused failures in Delve, but we would like to un-revert it. Handle
      this change by inspecting the type of this field before decoding it.
      a2b83999