1. 27 1月, 2020 1 次提交
  2. 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
  3. 14 1月, 2020 1 次提交
  4. 03 1月, 2020 1 次提交
    • A
      proc/native: call ElfUpdateSharedObjects after Attach · dd2a59a9
      aarzilli 提交于
      When attaching to a process in linux ElfUpdateSharedObjects will be
      called for the first time during the call to updateThreadList,
      unfortunately it won't do anything because the dynamic section of the
      base elf executable needs to have been read first and that's done when
      we initialize the BinaryInfo object (which happens later during the
      call to initialize).
      dd2a59a9
  5. 28 11月, 2019 5 次提交
  6. 12 11月, 2019 1 次提交
    • A
      proc/linux: do not route signals to threads while stopping (#1752) · 4fc85289
      Alessandro Arzilli 提交于
      * proc/linux: do not route signals to threads while stopping
      
      While we are trying to stop the process we should not route signals
      sent to threads because that will result in threads being resumed.
      Also keep better track of which threads are stopped.
      
      This fixes an incompatibility with Go 1.14, which sends a lot of
      signals to its threads to implement non-cooperative preemption,
      resulting in Delve hanging waiting for an already-stopped thread to
      stop.
      
      In principle however this bug has nothing to do with Go 1.14 and could
      manifest in any instance of high signal pressure.
      
      * Makefile: discard stderr of "go list"
      
      In module mode "go" will print messages about downloading modules to
      stderr, we shouldn't confuse them for the real command output.
      4fc85289
  7. 29 10月, 2019 1 次提交
    • A
      proc: fix breakpoint confusion on resume (#1738) · f1a5e654
      Alessandro Arzilli 提交于
      Fixes a case of breakpoint confusion on resume caused by having two
      breakpoints one byte apart. This bug can cause the target program to
      resume execution a single byte inside an instruction and crash either
      with SIGILL or a SIGSEGV, or misbehave (depending on how the truncated
      instruction is decoded).
      
      native.(*Thread).StepInstruction should call FindBreakpoint using
      adjustPC==false because at that point the PC of the thread should
      already have been adjusted (and it has been).
      f1a5e654
  8. 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
  9. 18 7月, 2019 1 次提交
  10. 13 7月, 2019 1 次提交
    • R
      *: FreeBSD initial support (#1480) · df65be43
      Robert Ayrapetyan 提交于
      * FreeBSD initial support
      
      * first code review fixes
      
      * regs slice upd
      
      * execPtraceFunc wrap
      
      * disabled concurrency tests
      fixed kill() issue
      
      * disabled concurrency tests
      fixed kill() issue
      
      * cleanup vendor related code
      
      * cleanup ptrace calls
      
      * vendoring latest changes
      
      * Revert "vendoring latest changes"
      
      This reverts commit 833cb87b
      
      * vendoring latest changes
      
      * requested changes
      df65be43
  11. 26 4月, 2019 1 次提交
    • A
      proc/native: fix target program crash caused by call injection (linux) (#1538) · 0b3c7d80
      Alessandro Arzilli 提交于
      RestoreRegisters on linux would also restore FS_BASE and GS_BASE, if
      the target goroutine migrated to a different thread during the call
      injection this would result in two threads of the target process
      pointing to the same TLS area which would greatly confuse the target
      runtime, leading to fatal panics with nonsensical stack traces.
      
      Other backends are unaffected:
      
      - native/windows doesn't store the TLS in the same CONTEXT struct as
        the other register values.
      - native/darwin doesn't support function calls (and wouldn't store the
        TLS value in the same struct)
      - gdbserial/rr doesn't support function calls (because it's a
        recording)
      - gsdbserial/lldb extracts the value of TLS by executing code in the
        target process.
      0b3c7d80
  12. 21 3月, 2019 1 次提交
  13. 27 2月, 2019 1 次提交
  14. 15 1月, 2019 1 次提交
  15. 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
  16. 04 12月, 2018 1 次提交
  17. 22 11月, 2018 1 次提交
  18. 21 11月, 2018 1 次提交
    • A
      proc/*: allow stepping into functions without debug_info symbols · b8ed126b
      aarzilli 提交于
      If proc.Step encounters a CALL instruction that points to an address
      that isn't associated with any function it should still follow the
      CALL.
      
      The circumstances creating this problem do not normally occur, it was
      encountered in the process of fixing a bug created by Go1.12.
      b8ed126b
  19. 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
  20. 09 11月, 2018 1 次提交
  21. 23 10月, 2018 1 次提交
  22. 20 10月, 2018 1 次提交
    • A
      proc/native: Mask MS_VC_EXCEPTION [windows] · 4db99398
      aarzilli 提交于
      Some libraries (for example steam_api64.dll) will send this exception
      code to set the thread name on Microsoft VisualC.
      In theory it should be fine to send the exception back to the target,
      which is responsible for setting a handler for it, in practice in some
      cases (steam_api64.dll) this will crash the program. So we'll mask it
      instead.
      
      Fixes #1383
      4db99398
  23. 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
  24. 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
  25. 20 9月, 2018 1 次提交
  26. 31 8月, 2018 2 次提交
    • A
      proc/native: implement Copy/RestoreRegisters on windows · b8e80746
      aarzilli 提交于
      b8e80746
    • A
      proc: replace SavedRegisters interface with a Copy method · 438e51f3
      aarzilli 提交于
      Fncall.go was written with the assumption that the object returned by
      proc.Thread.Registers does not change after we call
      proc.Thread.SetPC/etc.
      
      This is true for the native backend but not for gdbserial. I had
      anticipated this problem and introduced the Save/SavedRegisters
      mechanism during the first implementation of fncall.go but that's
      insufficient.
      
      Instead:
      
      1. clarify that the object returned by proc.Thread.Registers could
         change when the CPU registers are modified.
      2. add a Copy method to Registers that returns a copy of the registers
         that are guaranteed not to change when the CPU registers change.
      3. remove the Save/SavedRegisters mechanism.
      
      This solution leaves us the option, in the future, to cache the output
      of proc.(Thread).Registers, avoiding a system call every time it's
      called.
      438e51f3
  27. 17 8月, 2018 1 次提交
  28. 01 8月, 2018 1 次提交
    • A
      proc/native,proc/gdbserial: ignore SIGTTIN, SIGTTOU when fg'ing target · 7e15327e
      aarzilli 提交于
      If we send a process to foreground while the headless instance may get
      a SIGTTOU/SIGTTIN, if not ignored this signal will stop the headless.
      It's not clear why this only happens the second time we do this but
      that's how it is.
      
      Also removes the direct syscall to TIOCSPGRP and lets the go runtime do
      it instead.
      
      Fixes #1279
      7e15327e
  29. 14 7月, 2018 1 次提交
  30. 27 6月, 2018 1 次提交
    • A
      proc,terminal,service: let headless instances run without connected clients · 9a216211
      aarzilli 提交于
      This pull request makes several changes to delve to allow headless
      instancess that are started with the --accept-multiclient flag to
      keep running even if there is no connected client. Specifically:
      
      1. Makes a headless instance started with --accept-multiclient quit
          after one of the clients sends a Detach request (previously they
          would never ever quit, which was a bug).
      2. Changes proc/gdbserial and proc/native so that they mark the
          Process as exited after they detach, even if they did not kill the
          process during detach. This prevents bugs such as #1231 where we
          attempt to manipulate a target process after we detached from it.
      3. On non --accept-multiclient instances do not kill the target
          process unless we started it or the client specifically requests
          it (previously if the client did not Detach before closing the
          connection we would kill the target process unconditionally)
      4. Add a -c option to the quit command that detaches from the
          headless server after restarting the target.
      5. Change terminal so that, when attached to --accept-multiclient,
          pressing ^C will prompt the user to either disconnect from the
          server or pause the target process. Also extend the exit prompt to
          ask if the user wants to keep the headless server running.
      
      Implements #245, #952, #1159, #1231
      9a216211
  31. 12 6月, 2018 3 次提交
    • 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
    • A
      proc: move AllGCache to a common struct · f38a2816
      aarzilli 提交于
      Add a new method "Common" to proc.Process that returns a pointer to a
      struct that pkg/proc can use to store its things, independently of the
      backend.
      
      This is used here to replace the AllGCache typecasts, it will also be
      used to store the return values of the stepout breakpoint and the state
      for injected function calls.
      f38a2816
    • A
      proc: handle new way of panic'ing in 1.11 · 5d26d333
      aarzilli 提交于
      5d26d333
  32. 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
  33. 11 4月, 2018 1 次提交