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. 10 4月, 2020 2 次提交
    • A
      Miscellaneous debug_line improvements (#1999) · c3a4d726
      Alessandro Arzilli 提交于
      * dwarf/line: implement DW_LNE_set_discriminator
      
      We don't use the discriminator field in any way but we need to at least
      parse it to support debub_line programs that use it.
      
      * dwarf/line: support parsing DWARF4 debug_line sections
      
      There is an extra field maximum_operations_per_instruction that is used
      for VLIW CPUs. We don't support this feature but we have to at least
      parse the field to not crash.
      c3a4d726
    • D
      gdbserial/gdbserver: Dynamically resolve debugserver binary (#1994) · bc30b539
      Darren Rambaud 提交于
      * gdbserial/gdbserver: Dynamically resolve debugserver binary
      
      Instead of hardcoding the absolute path to the Command Line
      Tools (CLT) binary, will attempt to resolve the path at the
      $PATH, or at the Xcode bundle. If none are available, will
      fallback to the default CLT location.
      
      Fixes #986
      
      * gdbserial/gdbserver: Log outgoing executed commands
      
      Add logging to capture the executable and associated arguments used
      in LLDBLaunch and LLDBAttach
      
      Related to #986
      
      * gdbserial/gdbserver: Add unit tests for helper function
      
      Define unit tests for helper function. Setup each test to temporarily make
      PATH variable, and file system changes, and subsequently revert them.
      
      Related to #986
      
      * gdbserial/gdbserver: Lazily load function
      
      Lazily obtain absolute path to avoid increasing load times.
      
      Remove flaky tests.
      
      Related to #986
      bc30b539
  3. 05 4月, 2020 1 次提交
  4. 03 4月, 2020 1 次提交
  5. 01 4月, 2020 4 次提交
  6. 31 3月, 2020 1 次提交
  7. 29 3月, 2020 2 次提交
  8. 28 3月, 2020 1 次提交
  9. 26 3月, 2020 2 次提交
  10. 25 3月, 2020 1 次提交
    • A
      proc/gdbserial,debugger: allow clients to stop a recording (#1890) · 8bb93e9a
      Alessandro Arzilli 提交于
      Allows Delve clients to stop a recording midway by sending a
      Command('halt')
      request.
      
      This is implemented by changing debugger.New to start recording the
      process on a separate goroutine while holding the processMutex locked.
      By locking the processMutex we ensure that almost all RPC requests will
      block until the recording is done, since we can not respond correctly
      to any of them.
      API calls that do not require manipulating or examining the target
      process, such as "IsMulticlient", "SetApiVersion" and
      "GetState(nowait=true)" will work while we are recording the process.
      
      Two other internal changes are made to the API: both GetState and
      Restart become asynchronous requests, like Command. Restart because
      this way it can be interrupted by a StopRecording request if the
      rerecord option is passed.
      GetState because clients need a call that will block until the
      recording is compelted and can also be interrupted with a
      StopRecording.
      
      Clients that are uninterested in allowing the user to stop a recording
      can ignore this change, since eventually they will make a request to
      Delve that will block until the recording is completed.
      
      Clients that wish to support this feature must:
      
      1. call GetState(nowait=false) after connecting to Delve, before any
         call that would need to manipulate the target process
      2. allow the user to send a StopRecording request during the initial
         GetState call
      3. allow the user to send a StopRecording request during any subsequent
         Restart(rerecord=true) request (if supported).
      
      Implements #1747
      8bb93e9a
  11. 24 3月, 2020 2 次提交
    • D
      pkg/proc: Reset time after continue in benchmarks · 475551cf
      Derek Parker 提交于
      Reset the timer once we start executing the code paths we actually care
      to measure, since the setup and continue steps can be relatively
      expensive.
      
      Also, disable recording on benchmarks. This seems less useful, and also
      cuts out a lot of noise when benchmarks are run.
      475551cf
    • D
      pkg/proc: Clean up proc.go · c4fd80fc
      Derek Parker 提交于
      This patch moves out unrelated types, variables and functions from
      proc.go into a place where they make more sense.
      c4fd80fc
  12. 21 3月, 2020 2 次提交
    • A
      proc: fix switch to goroutine stack (#1948) · 11204917
      Alessandro Arzilli 提交于
      When switching to the goroutine stack the stack iterator registers
      might not have any entry for the BP register, make sure to add it
      instead of just trying to change it.
      11204917
    • A
      proc,dwarf: cache debug.Entry objects (#1931) · 7cd12c34
      Alessandro Arzilli 提交于
      Instead of rescanning debug_info every time we want to read a function
      (either to find inlined calls or its variables) cache the tree of
      dwarf.Entry that we would generate and use that.
      
      Benchmark before:
      
      BenchmarkConditionalBreakpoints-4   	       1	5164689165 ns/op
      
      Benchmark after:
      
      BenchmarkConditionalBreakpoints-4   	       1	4817425836 ns/op
      
      Updates #1549
      7cd12c34
  13. 20 3月, 2020 8 次提交
  14. 19 3月, 2020 3 次提交
  15. 15 3月, 2020 1 次提交
  16. 12 3月, 2020 2 次提交
    • A
      proc,terminal: Implement reverse step, next and stepout (#1785) · 1a9e38aa
      Alessandro Arzilli 提交于
      * proc: move defer breakpoint code into a function
      
      Moves the code that sets a breakpoint on the first deferred function,
      used by both next and StepOut, to its function.
      
      * proc: implement reverse step/next/stepout
      
      When the direction of execution is reversed (on a recording) Step, Next and
      StepOut will behave similarly to their forward version. However there are
      some subtle interactions between their behavior, prologue skipping, deferred
      calls and normal calls. Specifically:
      
      - when stepping backwards we need to set a breakpoint on the first
        instruction after each CALL instruction, once this breakpoint is reached we
        need to execute a single StepInstruction operation to reverse step into the
        CALL.
      - to insure that the prologue is skipped reverse next needs to check if it
        is on the first instruction after the prologue, and if it is behave like
        reverse stepout.
      - there is no reason to set breakpoints on deferred calls when reverse
        nexting or reverse stepping out, they will never be hit.
      - reverse step out should generally place its breakpoint on the CALL
        instruction that created the current stack frame (which will be the CALL
        instruction immediately preceding the instruction at the return address).
      - reverse step out needs to treat panic calls and deferreturn calls
        specially.
      
      * service,terminal: implement reverse step, next, stepout
      1a9e38aa
    • C
      terminal: add `-l` prompt on goroutines help (#1922) · e90a5b48
      chainhelen 提交于
      Update: #1879
      e90a5b48
  17. 11 3月, 2020 3 次提交
    • A
      proc: cache result of GetG (#1921) · 134fcb18
      Alessandro Arzilli 提交于
      Benchmark before:
      
      BenchmarkConditionalBreakpoints-4   	       1	7031242832 ns/op
      
      Benchmark after:
      
      BenchmarkConditionalBreakpoints-4   	       1	5282482841 ns/op
      
      Conditional breakpoint evaluation latency: 0.70ms -> 0.52ms
      
      Updates #1549
      134fcb18
    • 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
    • C
      pkg/proc,service: support linux/386 (#1884) · f3a191cd
      chainhelen 提交于
      Implement debugging function for 386 on linux with reference to AMD64.
      There are a few remaining problems that need to be solved in another time.
      
      1. The stacktrace of cgo are not exactly as expected.
      2. Not implement `core` for now.
      3. Not implement `call` for now. Can't not find `runtime·debugCallV1` or
         similar function in $GOROOT/src/runtime/asm_386.s.
      
      Update #20
      f3a191cd
  18. 10 3月, 2020 3 次提交