1. 25 9月, 2021 5 次提交
    • A
      tests: run staticcheck during tests (#2705) · 038cd99b
      Alessandro Arzilli 提交于
      038cd99b
    • M
      pkg/proc: merge register data before writing to register (#2699) · 041eedd1
      Michael Knyszek 提交于
      Right now, if (*compositeMemory).WriteMemory needs to write a value to
      a register that's smaller than the full size of the register (say, a
      uint32 being passed as an argument), then (*AMD64Registers).SetReg can
      later fail a sanity check that ensures the passed DwarfRegister is a
      full size register.
      
      Fix this by reading the old value of the register and overwriting just
      the relevant parts with the new register. For the purposes of an
      argument, it would probably be fine to just pad with zeroes, but merging
      with the existing value is what gdb does.
      
      Fixes #2698
      041eedd1
    • S
      service/dap: add basic log points (#2634) · 4b30ba42
      Suzy Mueller 提交于
      Log points are special kinds of breakpoints that do not 'break' but instead log a message and then continue. This change implements basic log points that simply log the provided message, without any interpolation.
      
      In order to resume execution after hitting a breakpoint, I added a new lock resumeMu and tracked the running state within the DAP server. resumeMu must be held in order to issue a debugger request that would start execution. This means it can be used to make sure that another goroutine does not resume execution while you are holding the lock.
      
      Most of the synchronization logic is taken from PR #2530
      
      Updates golang/vscode-go#123
      4b30ba42
    • S
      service/debugger: return correct exit status on manual halt (#2674) · e00670b9
      Suzy Mueller 提交于
      * service/dap: add test for nonzero exit status
      e00670b9
    • A
      b50052cc
  2. 24 9月, 2021 2 次提交
  3. 23 9月, 2021 6 次提交
  4. 20 9月, 2021 1 次提交
  5. 16 9月, 2021 1 次提交
  6. 14 9月, 2021 2 次提交
    • S
      pkg/proc: update check for system goroutine (#2585) · 53eed299
      Suzy Mueller 提交于
      * pkg/proc: update check for system goroutine
      
      The finalizer goroutine can be either a system goroutine or a user goroutine. It is considered a user goroutine only when it calls back to user code. This change attempts to get closer to the implementation in the src/runtime/traceback.go by checking the value of fingRunning.
      
      We could alternatively adopt the approximation done by src/cmd/trace/trace.go which only special cases "runtime.main", and always considers the finalizer to be a system goroutine.
      53eed299
    • C
      terminal/make: Add GOARCH and GOOS arguments (#2696) · 4bcb8fb1
      Claus Lensbøl 提交于
      This change adds '--GOARCH=[arch]' and '--GOOS=[os]' as arguments for
      the make script to simplify the process of cross compilling.
      4bcb8fb1
  7. 13 9月, 2021 1 次提交
  8. 09 9月, 2021 1 次提交
  9. 02 9月, 2021 5 次提交
  10. 01 9月, 2021 1 次提交
  11. 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
  12. 25 8月, 2021 2 次提交
  13. 24 8月, 2021 5 次提交
  14. 21 8月, 2021 1 次提交
  15. 18 8月, 2021 2 次提交
  16. 16 8月, 2021 1 次提交
  17. 10 8月, 2021 3 次提交
    • 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