1. 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
  2. 11 3月, 2020 4 次提交
    • 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
    • P
      service/dap: Add support for threads request (#1914) · 5613cf15
      polinasok 提交于
      * Add support for threads request
      
      * Address review comments
      
      * Relax threads test condition
      
      * Address review comments
      
      * Clean up unnecessary newline
      
      * Respond to review comment
      Co-authored-by: NPolina Sokolova <polinasok@users.noreply.github.com>
      5613cf15
    • 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
  3. 10 3月, 2020 3 次提交
  4. 06 3月, 2020 1 次提交
  5. 05 3月, 2020 1 次提交
  6. 04 3月, 2020 1 次提交
  7. 03 3月, 2020 1 次提交
  8. 01 3月, 2020 3 次提交
    • D
      service/api: Refactor examine memory pretty printer · 241f2422
      Derek Parker 提交于
      Use strings.Builder and tabwriter to format the output of the examine
      memory command instead of doing direct string manipulation and
      allocating.
      241f2422
    • D
      *: Add Go 1.14 to test matrix · 6319d50e
      Derek Parker 提交于
      This also removes Go 1.11 from the test matrix.
      
      Now that 1.14 has been released, as always it should be included in the
      test matrix.
      6319d50e
    • J
      proc/native/linux: try to use process_vm_readv/writev · d0d2d478
      Josh Stone 提交于
      This change adds `ProcessVmRead` and `ProcessVmWrite` wrappers around
      the syscalls `process_vm_readv` and `process_vm_writev`, available since
      Linux 3.2. These follow the same permission model as `ptrace`, but they
      don't actually require being attached, which means they can be called
      directly from any thread in the debugger. They also use `iovec` to write
      entire blocks at once, rather than having to peek/poke each `uintptr`.
      
      These wrappers are used in `Thread.ReadMemory` and `WriteMemory`, still
      falling back to `ptrace` if that fails for any reason.  Notably,
      `process_vm_writev` respects memory protection, so it can't modify
      read-only memory like `ptrace`. This frequently occurs when writing
      breakpoints in read-only `.text`, so to avoid a lot of wasted `EFAULT`
      calls, we only try `process_vm_writev` for larger writes.
      d0d2d478
  9. 29 2月, 2020 2 次提交
  10. 27 2月, 2020 3 次提交
  11. 26 2月, 2020 3 次提交
  12. 25 2月, 2020 6 次提交
    • A
      proc,service: allow printing registers for arbitrary frames (#1875) · d925f6b7
      Alessandro Arzilli 提交于
      Adds an optional scope prefix to the `regs` command which allows
      printing registers for any stack frame (as long as they were somehow
      saved). Issue #1838 is not yet to be closed since we are still not
      recovering the registers of a segfaulting frame.
      
      Updates #1838
      d925f6b7
    • A
      18678623
    • A
      proc/native: better error message when building on unsupported systems (#1883) · ade20a4d
      Alessandro Arzilli 提交于
      As we rearrange the code and the Go compiler changes the error message
      returned by the compiler on unsupported architectures will change too,
      making it un-googlable. Since the error message tends to be rather
      obscure too this regularly confuses newbies.
      
      This is an effort to make the error message for unsupported GOOS/GOARCH
      combinations the same across all unsupported combinations and to make
      it more user friendly.
      
      Directories containing Go source code are supposed to contain a single
      package. This property happens to be checked by cmd/go itself so it
      will happen even before the syntax is fully checked and therefore has a
      high probability of being the first (and only) error message being
      print.
      
      Here we take advantage of this by adding to the pkg/proc/native
      directory a file with a bad package line that only gets compiled in on
      unsupported GOOS/GOARCH combinations.
      
      At present the error message for compiling Delve on unsupported systems
      will be:
      
      service/debugger/debugger.go:21:2: found packages native (proc.go) and your_operating_system_and_architecture_combination_is_not_supported_by_delve (support_sentinel.go) in $PATH_TO_DELVE/pkg/proc/native
      ade20a4d
    • E
      service/dap: avoid hardcoded []byte slices in DAP tests (#1881) · 7f14f6ab
      Eli Bendersky 提交于
      * Remove hardcoded tests
      
      * Cleanup - consistent naming, simplify some code, remove unused func
      
      * Address review comments
      
      * Add Seq checks back
      
      * Address more review comments
      
      * Remove hardcoded tests
      
      * Cleanup - consistent naming, simplify some code, remove unused func
      
      * Address review comments
      
      * Add Seq checks back
      
      * Address more review comments
      
      * Make more consistent
      
      * More consistency
      
      * Simplify Except* methods with a helper
      
      Mark t.Helper() where appropriate
      7f14f6ab
    • C
      pkg/proc: Fix ThreadId when ErrNoGoroutine on g0 stack in GetG · d0b21fbb
      chainhelen 提交于
      Avoid always showing `no G executing on thread 0` when ErrNoGoroutine on
      g0 stack in GetG.
      d0b21fbb
    • K
      scripts: support macOS 10.15 or later · 9239013e
      Koichi Shiraishi 提交于
      macOS hasn't /usr/include/sys/types.h header with Canalina or later.
      switch types.h path to CommandLineTools if kernel minor version up to 15 or later.
      9239013e
  13. 22 2月, 2020 2 次提交
    • H
      service/dap: minor cosmetic changes (#1882) · 44c644cc
      Hyang-Ah Hana Kim 提交于
      - Move package doc comments so they are recognized as package doc.
      - Use t.Helper when appropriate.
      44c644cc
    • K
      dwarf/line: Fixed DirIdx (index starts at one) (#1873) · 17f2fa79
      Klemens Morgenstern 提交于
      * Fixed DirIdx (index starts at one)
      
      I am using the elf to load C++ based elf and there the index starts at one and not zero, hence the minor fix.
      
      * Added test
      
      * Added proper test for c-generated elf & replaced index offset by adding build dir
      
      * Changed other IncludeDir test
      
      * Format fix & replace print with actual test
      
      * Format fixes @derekparker requested.
      17f2fa79
  14. 21 2月, 2020 1 次提交
  15. 20 2月, 2020 2 次提交
  16. 19 2月, 2020 1 次提交
  17. 18 2月, 2020 2 次提交
    • O
      proc/core: implementing coredump functionality for ARM64 (#1774) · a83d1c14
      ossdev07 提交于
      * proc/native: optimize native.status through buffering (#1865)
      
      Benchmark before:
      
      BenchmarkConditionalBreakpoints-4              1        15649407130 ns/op
      
      Benchmark after:
      
      BenchmarkConditionalBreakpoints-4   	       1	14586710018 ns/op
      
      Conditional breakpoint evaluation 1.56ms -> 1.45ms
      
      Updates #1549
      
      * proc/core: Review Comments Incorporated
      Signed-off-by: Nossdev07 <ossdev@puresoftware.com>
      Co-authored-by: NAlessandro Arzilli <alessandro.arzilli@gmail.com>
      a83d1c14
    • A
      proc: optimize parseG (#1866) · ecea2e18
      Alessandro Arzilli 提交于
      runtime.g is a large and growing struct, we only need a few fields.
      Instead of using loadValue to load the full contents of g, cache its
      memory and then only load the fields we care about.
      
      Benchmark before:
      
      BenchmarkConditionalBreakpoints-4              1        14586710018 ns/op
      
      Benchmark after:
      
      BenchmarkConditionalBreakpoints-4   	       1	12476166303 ns/op
      
      Conditional breakpoint evaluation: 1.45ms -> 1.24ms
      
      Updates #1549
      ecea2e18
  18. 16 2月, 2020 2 次提交
    • A
      proc/native: optimize native.status through buffering (#1865) · c272212b
      Alessandro Arzilli 提交于
      Benchmark before:
      
      BenchmarkConditionalBreakpoints-4              1        15649407130 ns/op
      
      Benchmark after:
      
      BenchmarkConditionalBreakpoints-4   	       1	14586710018 ns/op
      
      Conditional breakpoint evaluation 1.56ms -> 1.45ms
      
      Updates #1549
      c272212b
    • P
      service/dap: Initial implementation for 'dlv dap' (#1858) · fbc4623c
      polinasok 提交于
      * Initial implementation for 'dlv dap'
      
      * Fix Travis and AppVeyor failures
      
      * Address review comments
      
      * Address review comments
      
      * Regenrate documentation
      
      * Replace dap server printfs with log.Error
      
      * Update 'dap log'
      
      * Fix typos
      
      * Revert logflags changes that got mixed in by accident
      fbc4623c