1. 29 1月, 2019 1 次提交
  2. 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
  3. 30 11月, 2018 1 次提交
    • A
      pkg/proc: align memory size of tls arena to pointer sized boundary · 7d06d2c0
      aarzilli 提交于
      The size of the TLS memory arena needs to be aligned to pointer sized
      boundaries on 86x64 architectures, otherwise some programs using cgo
      will not have the correct offset for the g struct.
      
      No tests because reproducing this problem depends on behavior of the
      GNU ld linker caused by unclear influences.
      
      Fixes #1428.
      7d06d2c0
  4. 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
  5. 09 11月, 2018 3 次提交
  6. 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
  7. 20 9月, 2018 1 次提交
  8. 30 8月, 2018 1 次提交
    • A
      proc: fix type of some struct global variables · 0461af83
      aarzilli 提交于
      Normally variables that have a named struct as a type will get a
      typedef entry as their type, sometimes however the Go linker will
      decide to use the DW_TAG_structure_type entry instead.
      
      For consistency always wrap a struct type into a typedef when we are
      creating a new variables (see comment in newVariable for exceptions).
      
      This fixes a bug where it would be impossible to call methods on a
      global variable.
      0461af83
  9. 16 8月, 2018 1 次提交
  10. 08 8月, 2018 1 次提交
    • D
      proc: Increase inline function support · 49bfbe6d
      Derek Parker 提交于
      This patch makes it so inlined functions are returned in the
      function
      list, and also allows users to set breakpoints on the call site of
      inlined functions.
      
      Fixes #1261
      49bfbe6d
  11. 14 7月, 2018 1 次提交
  12. 23 6月, 2018 1 次提交
    • A
      proc: support GNU compressed debug sections (go1.11 support) · 440b4405
      aarzilli 提交于
      Go1.11 switched to the zlib-gnu compression format for debug sections.
      Change proc and and a test in dwarf/line to support this change.
      
      Also deletes some dead code from pkg/proc/bininfo.go that hadn't been
      used in a long time.
      440b4405
  13. 22 6月, 2018 1 次提交
    • S
      proc: add support for separate debug info · 774b5c7c
      Sergio Lopez 提交于
      To save disk space, some distributions strip the debugging information
      from the binaries, putting it in separate files, usually distributed in
      separate packages.
      
      To locate the file containing the debug information for a certain
      binary, an ELF note named ".note.gnu.build-id" is added to the latter,
      which contains a header and a build identification. This identification
      can be used to compose a path with this form:
      
      /usr/lib/debug/.build-id/BUILDID[:2]/BUILDID[2:].debug
      
      With this patch, if Delve can't find the debug information in the main
      binary, it'll try to locate and parse ".note.gnu.build-id", to compose
      and attempt to open a path with the format described above.
      
      Fixes #1206
      774b5c7c
  14. 12 6月, 2018 2 次提交
  15. 24 5月, 2018 1 次提交
    • S
      proc: add support for dwz compressed DWARF · 38307f92
      Sergio Lopez 提交于
      'dwz' is a tool that reduces the size of DWARF sections by
      deduplicating symbols. The deduplicated symbols are moved from their
      original 'compile unit' to a 'partial unit', which is then referenced
      from its original location with an 'imported unit' tag.
      
      In the case of Go binaries, all symbols are located in a single
      'compile unit', and the name of each symbol contains a reference to its
      package, so 'dwz' is not able to deduplicate them. But still, some C
      symbols included in the binary are deduplicated, which also alters the
      structure of the DWARF sections, making delve unable to parse them
      (crashing in the attempt).
      
      While it would've been possible to simply ignore the C symbols, or
      blindly loading all then into BinaryInfo members (packageVars,
      Functions...), for correctness sake this change tries to do the right
      thing, staging symbols into temporary partialUnit objects, moving them
      to BinaryInfo when they are actually requested  by a 'imported unit'
      tag.
      38307f92
  16. 16 5月, 2018 1 次提交
    • J
      Keep searching for file:line until found · c7cde8b1
      Jay Mundrawala 提交于
      Go seems to be generating multiple compilation units that have
      the same file. I think this happens for functions that get inlined.
      Without this patch, those inlined functions break the ability to set
      a breakpoint at other lines in the file. I was able to load the same
      binary in gdb and set a breakpoints throughout the file without issue.
      
      ```
      ➜ objdump --dwarf=decodedline automate-gateway | grep handler/users.go
      .../handler/users.go:[++]
      s/.../handler/users.go           20            0xb6dd88
      .../handler/users.go:[++]
      s/.../handler/users.go           20            0xb6e50f
      .../handler/users.go:[++]
      s/automate-gateway/handler/users.go           32            0xb66640
      ```
      
      Inlined functions are still a little weird. setting a breakpoint on
      a function that gets inlined picks the first occurence. That being
      said, I think delve should still do something reasonable for the rest
      of the lines in the file.
      c7cde8b1
  17. 27 3月, 2018 1 次提交
    • A
      proc: support inlining · 290e8e75
      aarzilli 提交于
      Go 1.10 added inlined calls to debug_info, this commit adds support
      for DW_TAG_inlined_call to delve, both for stack traces (where
      inlined calls will appear as normal stack frames) and to correct
      the behavior of next, step and stepout.
      
      The calls to Next and Frame of stackIterator continue to work
      unchanged and only return real stack frames, after reading each line
      appendInlinedCalls is called to unpacked all the inlined calls that
      involve the current PC.
      
      The fake stack frames produced by appendInlinedCalls are
      distinguished from real stack frames by having the Inlined attribute
      set to true. Also their Current and Call locations are treated
      differently. The Call location will be changed to represent the
      position inside the inlined call, while the Current location will
      always reference the real stack frame. This is done because:
      
      * next, step and stepout need to access the debug_info entry of
      the real function they are stepping through
      * we are already manipulating Call in different ways while Current
      is just what we read from the call stack
      
      The strategy remains mostly the same, we disassemble the function
      and we set a breakpoint on each instruction corresponding to a
      different file:line. The function in question will be the one
      corresponding to the first real (i.e. non-inlined) stack frame.
      
      * If the current function contains inlined calls, 'next' will not
      set any breakpoints on instructions that belong to inlined calls. We
      do not do this for 'step'.
      
      * If we are inside an inlined call that makes other inlined
      functions, 'next' will not set any breakpoints that belong to
      inlined calls that are children of the current inlined call.
      
      * If the current function is inlined the breakpoint on the return
      address won't be set, because inlined frames don't have a return
      address.
      
      * The code we use for stepout doesn't work at all if we are inside
      an inlined call, instead we call 'next' but instruct it to remove
      all PCs belonging to the current inlined call.
      290e8e75
  18. 23 3月, 2018 1 次提交
  19. 14 2月, 2018 1 次提交
    • A
      dwarf/reader,proc: support DW_AT_abstract_origin (#1111) · 0c40a8f5
      Alessandro Arzilli 提交于
      debug_info entries can use DW_AT_abstract_origin to inherit the
      attributes of another entry, supporting this attribute is necessary to
      support DW_TAG_inlined_subroutine.
      
      Go, starting with 1.10, emits DW_TAG_inlined_subroutine entries when
      inlining is enabled.
      0c40a8f5
  20. 21 12月, 2017 1 次提交
  21. 14 12月, 2017 2 次提交
  22. 22 11月, 2017 2 次提交
  23. 04 11月, 2017 2 次提交
  24. 31 8月, 2017 1 次提交
  25. 02 8月, 2017 1 次提交
  26. 19 7月, 2017 1 次提交
    • A
      proc/eval: optimize variable lookup (#925) · 222cf7fc
      Alessandro Arzilli 提交于
      Variable lookup is slow because it requires a full scan of debug_info
      to check for package variables, this doesn't matter much in interactive
      use but can slow down evaluation of breakpoint conditions
      significantly.
      
      Providing benchmark proof for this is hard since this effect doesn't
      show for small programs with small debug_info sections.
      222cf7fc
  27. 22 6月, 2017 1 次提交
    • H
      proc: read G struct offset from runtime.tlsg if possible (#883) · 7d2834a9
      heschik 提交于
      When a Go program is externally linked, the external linker is
      responsible for picking the TLS offset. It records its decision in the
      runtime.tlsg symbol. Read the offset from that rather than guessing -16.
      
      This implementation causes a regression: 1.4 and earlier will no longer
      work.
      7d2834a9
  28. 22 4月, 2017 1 次提交
  29. 19 4月, 2017 1 次提交
  30. 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