1. 11 4月, 2020 1 次提交
    • D
      *: Add --tty flag for debug / exec · 3e60ae20
      Derek Parker 提交于
      This flag allows users on UNIX systems to set the tty for the program
      being debugged by Delve. This is useful for debugging command line
      applications which need access to their own TTY, and also for
      controlling the output of the debugged programs so that IDEs may open a
      dedicated terminal to show the output for the process.
      3e60ae20
  2. 03 4月, 2020 1 次提交
  3. 01 4月, 2020 1 次提交
  4. 11 3月, 2020 1 次提交
    • A
      proc,proc/*: add StopReason field to Target (#1877) · 9f97edb0
      Alessandro Arzilli 提交于
      * proc,proc/*: move SelectedGoroutine to proc.Target, remove PostInitializationSetup
      
      moves SelectedGoroutine, SwitchThread and SwitchGoroutine to
      proc.Target, merges PostInitializationSetup with NewTarget.
      
      * proc,proc/*: add StopReason field to Target
      
      Adds a StopReason field to the Target object describing why the target
      process is currently stopped. This will be useful for the DAP server
      (which needs to report this reason in one of its requests) as well as
      making pull request #1785 (reverse step) conformant to the new
      architecture.
      
      * proc: collect NewTarget arguments into a struct
      9f97edb0
  5. 11 2月, 2020 1 次提交
    • A
      *: Go 1.14 support branch (#1727) · 0741d3e5
      Alessandro Arzilli 提交于
      * tests: misc test fixes for go1.14
      
      - math.go is now ambiguous due to changes to the go runtime so specify
        that we mean our own math.go in _fixtures
      - go list -m requires vendor-mode to be disabled so pass '-mod=' to it
        in case user has GOFLAGS=-mod=vendor
      - update version of go/packages, required to work with go 1.14 (and
        executed go mod vendor)
      - Increased goroutine migration in one development version of Go 1.14
        revealed a problem with TestCheckpoints in command_test.go and
        rr_test.go. The tests were always wrong because Restart(checkpoint)
        doesn't change the current thread but we can't assume that when the
        checkpoint was taken the current goroutine was running on the same
        thread.
      
      * goversion: update maximum supported version
      
      * Makefile: disable testing lldb-server backend on linux with Go 1.14
      
      There seems to be some incompatibility with lldb-server version 6.0.0
      on linux and Go 1.14.
      
      * proc/gdbserial: better handling of signals
      
      - if multiple signals are received simultaneously propagate all of them to the
        target threads instead of only one.
      - debugserver will drop an interrupt request if a target thread simultaneously
        receives a signal, handle this situation.
      
      * dwarf/line: normalize backslashes for windows executables
      
      Starting with Go 1.14 the compiler sometimes emits backslashes as well
      as forward slashes in debug_line, normalize everything to / for
      conformity with the behavior of previous versions.
      
      * proc/native: partial support for Windows async preempt mechanism
      
      See https://github.com/golang/go/issues/36494 for a description of why
      full support for 1.14 under windows is problematic.
      
      * proc/native: disable Go 1.14 async preemption on Windows
      
      See https://github.com/golang/go/issues/36494
      0741d3e5
  6. 22 1月, 2020 1 次提交
    • D
      pkg/proc: Introduce Target and remove CommonProcess (#1834) · 94a20d57
      Derek Parker 提交于
      * pkg/proc: Introduce Target
      
      * pkg/proc: Remove Common.fncallEnabled
      
      Realistically we only block it on recorded backends.
      
      * pkg/proc: Move fncallForG to Target
      
      * pkg/proc: Remove CommonProcess
      
      Remove final bit of functionality stored in CommonProcess and move it to
      *Target.
      
      * pkg/proc: Add SupportsFunctionCall to Target
      94a20d57
  7. 13 8月, 2019 1 次提交
    • A
      proc: next/step/stepout restarts thread from wrong instruction (#1657) · 3b0c8865
      Alessandro Arzilli 提交于
      proc.Next and proc.Step will call, after setting their temp
      breakpoints, curthread.SetCurrentBreakpoint. This is intended to find
      if one of the newly created breakpoints happens to be at the same
      instruction that curthread is stopped at.
      However SetCurrentBreakpoint is intended to be called after a Continue
      and StepInstruction operation so it will also detect if curthread is
      stopped one byte after a breakpoint.
      If the instruction immediately preceeding the current instruction of
      curthread happens to:
       1. have one of the newly created temp breakpoints
       2. be one byte long
      SetCurrentBreakpoint will believe that we just hit that breakpoint and
      therefore the instruction should be repeated, and thus rewind the PC of
      curthread by 1.
      
      We should distinguish between the two uses of SetCurrentBreakpoint and
      disable the check for "just hit" breakpoints when inappropriate.
      
      Fixes #1656
      3b0c8865
  8. 05 1月, 2019 1 次提交
    • D
      *: Update import name to github.com/go-delve/delve · 4c9a72e4
      Derek Parker 提交于
      The repository is being switched from the personal account
      github.com/derekparker/delve to the organization account
      github.com/go-delve/delve. This patch updates imports and docs, while
      preserving things which should not be changed such as my name in the
      CHANGELOG and in TODO comments.
      4c9a72e4
  9. 16 11月, 2018 1 次提交
    • D
      pkg/proc: Refactor process post initialization · d61cd1c0
      Derek Parker 提交于
      This patch is a slight refactor to share more code used for genericprocess initialization. There will always be OS/backend specificinitialization, but as much as can be shared should be to preventduplicating of any logic (setting internal breakpoints, loading bininfo,etc).
      d61cd1c0
  10. 09 11月, 2018 1 次提交
  11. 12 10月, 2018 1 次提交
    • A
      proc: support position independent executables (PIE) · 74c98bc9
      aarzilli 提交于
      Support for position independent executables (PIE) on the native linux
      backend, the gdbserver backend on linux and the core backend.
      Also implemented in the windows native backend, but it can't be tested
      because go doesn't support PIE on windows yet.
      74c98bc9
  12. 03 10月, 2018 1 次提交
    • A
      proc/native,Makefile: allow compiling on macOS without native backend · 910f90c3
      aarzilli 提交于
      On macOS 10.14 Apple changed the command line tools so that system
      headers now need to be manually installed.
      
      Instead of adding one extra install step to the install procedure add a
      build tag to allow compilation of delve without the native backend on
      macOS. By default (i.e. when using `go get`) this is how delve will be
      compiled on macOS, the make script is changed to enable compiling the
      native backend if the required dependencies have been installed.
      
      Insure that both configuration still build correctly on Travis CI and
      change the documentation to describe how to compile the native backend
      and that it isn't normally needed.
      
      Fixes #1359
      910f90c3
  13. 20 9月, 2018 1 次提交
  14. 12 6月, 2018 1 次提交
    • A
      proc,service: display return values when stepping out of a function · 60c58acb
      aarzilli 提交于
      Displays the return values of the current function when we step out of
      it after executing a step, next or stepout command.
      
      Implementation of this feature is tricky: when the function has
      returned the return variables are not in scope anymore. Implementing
      this feature requires evaluating variables that are out of scope, using
      a stack frame that doesn't exist anymore.
      
      We can't calculate the address of these variables when the
      next/step/stepout command is initiated either, because between that
      point and the time where the stepout breakpoint is actually hit the
      goroutine stack could grow and be moved to a different memory address.
      60c58acb
  15. 19 5月, 2018 1 次提交
    • A
      proc/native,proc/gdbserial: let target access terminal · cc86bde5
      aarzilli 提交于
      Change the linux verison of proc/native and proc/gdbserial (with
      debugserver) so that they let the target process use the terminal when
      delve is launched in headless mode.
      
      Windows already worked, proc/gdbserial (with rr) already worked.
      I couldn't find a way to make proc/gdbserial (with lldb-server) work.
      
      No tests are added because I can't think of a way to test for
      foregroundness of a process.
      
      Fixes #65
      cc86bde5
  16. 07 3月, 2018 4 次提交
  17. 08 2月, 2018 1 次提交
    • M
      proc: Handle race between fork and task_for_pid (#1117) · beb3e76f
      Matt Bauer 提交于
      * Handle race between fork and task_for_pid
      
      On macOS a call to fork and a subsequent call to task_for_pid will race each other. This is because the macOS kernel assigns a new proc_t structure early but the new task, thread and uthread come much later. The function exec_mach_imgact in the XNU sources contains this logic.
      
      In a system under load or one with delays in fork processing (i.e. various security software), task_for_pid as currently called by Delve often returns the parent task. This can be seen by printing out the task number around line 86. In a normal system we would see three calls:
      
      -> ~/go/bin/dlv --listen=localhost:59115 --headless=true --api-version=2 --backend=native exec ./___main_go -- 
      Task: 9731
      Task: 9731
      Task: 9731
      API server listening at: 127.0.0.1:59115
      
      This is the result on a system where the race is lost:
      
      -> ~/go/bin/dlv --listen=localhost:59115 --headless=true --api-version=2 --backend=native exec ./___main_go -- 
      Task: 8707
      Task: 10499
      Task: 10499
      could not launch process: could not get thread count
      
      In this latter case, task 8707 is the parent task. The child task of 10499 was desired and hence the error.
      
      This code change checks to make sure the returned task is not that of the parent. If it is, it retries. It's possible other macOS reported Delve issues are the result of this failed race.
      
      * proc: correct formatting
      beb3e76f
  18. 21 11月, 2017 1 次提交
    • A
      proc: next should not skip lines with conditional bps · 1ced7c3a
      aarzilli 提交于
      Conditional breakpoints with unmet conditions would cause next and step
      to skip the line.
      
      This breakpoint changes the Kind field of proc.Breakpoint from a single
      value to a bit field, each breakpoint object can represent
      simultaneously a user breakpoint and one internal breakpoint (of which
      we have several different kinds).
      
      The breakpoint condition for internal breakpoints is stored in the new
      internalCond field of proc.Breakpoint so that it will not conflict with
      user specified conditions.
      
      The breakpoint setting code is changed to allow overlapping one
      internal breakpoint on a user breakpoint, or a user breakpoint on an
      existing internal breakpoint. All other combinations are rejected. The
      breakpoint clearing code is changed to clear the UserBreakpoint bit and
      only remove the phisical breakpoint if no other bits are set in the
      Kind field. ClearInternalBreakpoints does the same thing but clearing
      all bits that aren't the UserBreakpoint bit.
      
      Fixes #844
      1ced7c3a
  19. 31 8月, 2017 1 次提交
  20. 30 6月, 2017 1 次提交
  21. 13 6月, 2017 1 次提交
  22. 06 5月, 2017 1 次提交
  23. 22 4月, 2017 1 次提交
  24. 07 4月, 2017 1 次提交
    • A
      proc refactor: split out BinaryInfo implementation (#745) · 436a3c21
      Alessandro Arzilli 提交于
      * proc: refactor BinaryInfo part of proc.Process to own type
      
      The data structures and associated code used by proc.Process
      to implement target.BinaryInfo will also be useful to support a
      backend for examining core dumps, split this part of proc.Process
      to a different type.
      
      * proc: compile support for all executable formats unconditionally
      
      So far we only compiled in support for loading the executable format
      supported by the host operating system.
      Once support for core files is introduced it is however useful to
      support loading in all executable formats, there is no reason why it
      shouldn't be possible to examine a linux coredump on windows, or
      viceversa.
      
      * proc: bugfix: do not resume threads on detach if killing
      
      * Replace BinaryInfo interface with BinInfo() method returning proc.BinaryInfo
      436a3c21
  25. 29 3月, 2017 1 次提交
    • A
      proc: add test for attach/detach, fix detach (#773) · 7b19fe9e
      Alessandro Arzilli 提交于
      Detach did not work for processes we attach to via PID.
      
      Linux: we were only detaching from the main thread, all threads are
      detached independently
      
      Windows: we must resume all threads before detaching.
      
      macOS: still broken.
      
      Updates #772
      7b19fe9e
  26. 14 2月, 2017 1 次提交
  27. 09 2月, 2017 3 次提交
  28. 23 12月, 2016 1 次提交
  29. 17 12月, 2016 1 次提交
  30. 02 11月, 2016 1 次提交
    • E
      Flag to set working directory (#650) · 4064d6ac
      Evgeny L 提交于
      * proc: Add `wd` to Launch
      
      This change adds the `wd` arg which specify working directory of the
      program.
      
      Fixes #295
      
      * service/debugger: Add `Wd` field to debugger.Config
      
      This change adds the `Wd` field which specify working directory of the
      program launched by debugger.
      
      Fixes #295
      
      * service: Add `Wd` to service.Config
      
      This change adds the `Wd` field which specify working directory of the
      program debugger will launch.
      
      Fixes #295
      
      * cmd/dlv: Add `Wd` flag
      
      This change adds `Wd` flag which specify working directory of the
      program which launched by debugger.
      
      Fixes #295
      
      * only set the Linux working directory if it is set,
      stub out param in darwin and windows
      
      * set working directory for Windows
      https://godoc.org/golang.org/x/sys/windows#CreateProcess
      https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
      
      * Windows workingDir must be an *uint16
      
      * attempt to chdir on darwin via @yuntan
      
      * proc/exec_darwin.c: fix working directory for darwin
      
      * Add tests to check if working directory works.
      * Fix darwin implementation of fork/exec, which paniced if
        child fork returned.
      
      * cmd, service: rename Wd to WorkingDir
      4064d6ac
  31. 06 7月, 2016 1 次提交
  32. 30 6月, 2016 1 次提交
    • A
      proc: detect when Launching non-executable files · 51c39ed1
      aarzilli 提交于
      This provides a better error message when the user tries to run dlv
      debug on a directory that does not contain a main package, when `dlv
      exec` is used with a source file.
      
      Additionally the architecture of the executable is checked as suggested
      by @alexbrainman in #443.
      
      Fixes #509
      51c39ed1
  33. 30 5月, 2016 1 次提交
    • A
      Go 1.7 compatibility (#524) · 9bc6ad4f
      Alessandro Arzilli 提交于
      * tests: update to cope with go1.7 SSA compiler
      
      * de-vendored golang.org/x/debug/dwarf
      
      We need our own tweaked version
      
      * dwarf/debug/dwarf: always use the entry's name attribute
      
      Using the name attribute leads to better type names as well as fixes
      inconsistencies between 1.5, 1.6 and 1.7.
      
      * proc: Updated loadInterface to work with go1.7
      
      go1.7 changed the internal representation of types, removing the string
      field from runtime._type.
      Updated loadInterface to use the new str field.
      9bc6ad4f
  34. 13 4月, 2016 1 次提交
  35. 25 1月, 2016 1 次提交