1. 29 11月, 2017 2 次提交
    • A
      proc: support cgo stacktraces · 5372588c
      aarzilli 提交于
      When creating a stack trace we should switch between the goroutine
      stack and the system stack (where cgo code is executed) as appropriate
      to reconstruct the logical stacktrace.
      
      Goroutines that are currently executing on the system stack will have
      the SystemStack flag set, frames of the goroutine stack will have a
      negative FrameOffset (like always) and frames of the system stack will
      have a positive FrameOffset (which is actually just the CFA value for
      the frame).
      
      Updates #935
      5372588c
    • A
      cmd, proc/test: disable optimizations on the C compiler · 5fdcd2c9
      aarzilli 提交于
      Pass CGO_FLAGS='-O0 -g' to go build to disable optimizations when
      calling the C compiler.
      5fdcd2c9
  2. 21 11月, 2017 2 次提交
    • 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
    • A
      proc: breakpoints refactoring · 178589a4
      aarzilli 提交于
      Move some duplicate code, related to breakpoints, that was in both
      backends into a single place.
      This is in preparation to solve issue #844 (conditional breakpoints
      make step and next fail) which will make this common breakpoint code
      more complicated.
      178589a4
  3. 18 11月, 2017 1 次提交
    • A
      proc: refactor stack.go to use DWARF registers · f4e2000f
      aarzilli 提交于
      Instead of only tracking a few cherrypicked registers in stack.go track
      all DWARF registers.
      
      This is needed for cgo code and for the locationlists emitted by go in
      1.10:
      * The debug_frame sections emitted by C compilers can not be used
        without tracking all registers
      * the loclists emitted by go1.10 need all registers of a frame to be
        interpreted.
      f4e2000f
  4. 26 9月, 2017 1 次提交
    • A
      proc: change next to skip deferred functions · 5c9b2009
      aarzilli 提交于
      Make 'next' skip deferred functions unless they are called via a panic.
      Call to a deferred function through 'return' are predictable, if the
      user wants to step into them 'step' can be used but without this change
      there is no way to avoid stepping into them.
      
      Implements #956
      5c9b2009
  5. 21 9月, 2017 1 次提交
    • A
      proc/gdbserial: return error if stopped with a sginal · 2c0e3116
      aarzilli 提交于
      On macOS we can also stop when we receive a signal,
      propagate this reason upwards to the client.
      
      Also clear internal breakpoints after an unrecovered-panic since they
      can not be reached anymore.
      
      Fixes #872
      2c0e3116
  6. 31 8月, 2017 1 次提交
  7. 15 8月, 2017 1 次提交
  8. 02 8月, 2017 5 次提交
  9. 27 7月, 2017 2 次提交
  10. 19 7月, 2017 1 次提交
  11. 30 6月, 2017 1 次提交
  12. 13 6月, 2017 1 次提交
    • A
      proc/*: remove Process.Running · 16d8bd64
      aarzilli 提交于
      Implementing proc.Process.Running in a thread safe way is complicated
      and nothing actually uses it besides tests, so we are better off
      rewriting the tests without Running and removing it.
      
      In particular:
      
      * The call to d.target.Running() in service/debugger/debugger.go
        (Restart) can never return true because that line executes while
        holding processMutex and all continue operations are also executed
        while holding processMutex.
      * The call to dbp.Running() pkg/proc/native/proc.go (Detach) can never
        return true, because it's only called from
        debugger.(*Debugger).detach() which is also always called while
        holding processMutex.
      
      Since some tests are hard to write correctly without Process.Running a
      simpler interface, Process.NotifyResumed, is introduced.
      
      Fixes #830
      16d8bd64
  13. 26 5月, 2017 1 次提交
  14. 17 5月, 2017 1 次提交
    • A
      proc: next, stepout should work on recursive goroutines (#831) · 35405583
      Alessandro Arzilli 提交于
      Before this commit our temp breakpoints only checked that we would stay
      on the same goroutine.
      However this isn't enough for recursive functions we must check that we
      stay on the same goroutine AND on the same stack frame (or, in the case
      of the StepOut breakpoint, the previous stack frame).
      
      This commit:
      1. adds a new synthetic variable runtime.frameoff that returns the
         offset of the current frame from the base of the call stack.
         This is similar to runtime.curg
      2. Changes the condition used for breakpoints on the lines of the
         current function to check that runtime.frameoff hasn't changed.
      3. Changes the condition used for breakpoints on the return address to
         check that runtime.frameoff corresponds to the previous frame in the
         stack.
      4. All other temporary breakpoints (the step-into breakpoints and defer
         breakpoints) remain unchanged.
      
      Fixes #828
      35405583
  15. 16 5月, 2017 1 次提交
  16. 06 5月, 2017 2 次提交
  17. 05 5月, 2017 1 次提交
  18. 29 4月, 2017 1 次提交
  19. 26 4月, 2017 1 次提交
  20. 22 4月, 2017 3 次提交
  21. 19 4月, 2017 4 次提交
  22. 14 4月, 2017 1 次提交
  23. 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
  24. 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
  25. 14 3月, 2017 3 次提交