1. 22 10月, 2019 1 次提交
  2. 08 10月, 2019 1 次提交
  3. 05 9月, 2019 1 次提交
    • H
      proc: round TLS segment size to its alignment (#1682) · 8954858e
      Heschi Kreinick 提交于
      The fix for #1428 was buggy, partly because I communicated poorly. Sorry
      about that.
      
      The size of the TLS segment should be padded such that TLS addresses
      are congruent in the file to where they will end up memory, i.e.
      (tlsoffset%align) == (vaddr%align). In most cases, vaddr will be aligned
      and it won't matter, but if not then simply aligning the end of the
      segment is incorrect. This should be right.
      
      (For the record, the current rounding logic is working in bits, but
      PtrSize is in bytes, so it wasn't working as originally intended
      either.)
      8954858e
  4. 14 8月, 2019 2 次提交
  5. 10 8月, 2019 4 次提交
  6. 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
  7. 28 6月, 2019 1 次提交
  8. 24 6月, 2019 1 次提交
    • A
      proc: add LocationCover method to BinaryInfo (#1573) · a7c2d837
      Alessandro Arzilli 提交于
      Also fixes findCompileUnitForOffset which was broken in some edge cases
      (when looking up an offset inside the last child of the compilation
      unit) which don't happen in normal executables (we only look up types, and those
      are always direct childs of compile units).
      a7c2d837
  9. 01 6月, 2019 1 次提交
    • A
      proc: simplify partial unit support (#1565) · 215e13e8
      Alessandro Arzilli 提交于
      Instead of reading partial units as we see them skip them entirely and
      then re-read them when they are imported, directly into the destination
      compile unit.
      
      This avoids a lot of duplicate code in the loadDebugInfoMaps function
      and will simplify implementing logical breakpoints and support for the
      new DW_AT_go_package_name attribute added in Go 1.13.
      215e13e8
  10. 30 5月, 2019 2 次提交
  11. 09 5月, 2019 1 次提交
    • A
      proc: support debugging plugins (#1414) · f3b149bd
      Alessandro Arzilli 提交于
      This change splits the BinaryInfo object into a slice of Image objects
      containing information about the base executable and each loaded shared
      library (note: go plugins are shared libraries).
      
      Delve backens are supposed to call BinaryInfo.AddImage whenever they
      detect that a new shared library has been loaded.
      
      Member fields of BinaryInfo that are used to speed up access to dwarf
      (Functions, packageVars, consts, etc...) remain part of BinaryInfo and
      are updated to reference the correct image object. This simplifies this
      change.
      
      This approach has a few shortcomings:
      
      1. Multiple shared libraries can define functions or globals with the
         same name and we have no way to disambiguate between them.
      
      2. We don't have a way to handle library unloading.
      
      Both of those affect C shared libraries much more than they affect go
      plugins. Go plugins can't be unloaded at all and a lot of name
      collisions are prevented by import paths.
      
      There's only one problem that is concerning: if two plugins both import
      the same package they will end up with multiple definition for the same
      function.
      For example if two plugins use fmt.Printf the final in-memory image
      (and therefore our BinaryInfo object) will end up with two copies of
      fmt.Printf at different memory addresses. If a user types
        break fmt.Printf
      a breakpoint should be created at *both* locations.
      Allowing this is a relatively complex change that should be done in a
      different PR than this.
      
      For this reason I consider this approach an acceptable and sustainable
      stopgap.
      
      Updates #865
      f3b149bd
  12. 21 3月, 2019 1 次提交
  13. 27 2月, 2019 1 次提交
  14. 22 2月, 2019 1 次提交
  15. 29 1月, 2019 1 次提交
  16. 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
  17. 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
  18. 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
  19. 09 11月, 2018 3 次提交
  20. 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
  21. 20 9月, 2018 1 次提交
  22. 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
  23. 16 8月, 2018 1 次提交
  24. 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
  25. 14 7月, 2018 1 次提交
  26. 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
  27. 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
  28. 12 6月, 2018 2 次提交
  29. 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
  30. 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
  31. 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
  32. 23 3月, 2018 1 次提交