1. 03 7月, 2018 3 次提交
    • P
      Handle gdb core files better · 1d8636cd
      Peter Sanford 提交于
      Core files created by gdb can have sections missing that would be
      present in OS created core files.
      
      We work around this by first reading PT_LOAD entries from the exe and
      then reading them from the core.
      
      Fixes #1121
      1d8636cd
    • A
      Documentation: better documentation menu, add guide to writing a client · 78377cad
      aarzilli 提交于
      * Adds some links to the more relevant documentation pages on the main
        README.md
      * Adds a document informally describing how to write a client of delve
      * Adds link to slides describing the architecture of delve
      78377cad
    • A
      *: Fix log level setting in logrus · c53c43d1
      aarzilli 提交于
      Setting the Level field of a logrus logger doesn't actually do anything
      since the Level field simply reports the log level of the last log
      message emitted on the logger.
      The right way to do that is to set logger.Logger.Level.
      Also cleans up newline characters from log messages emitted through
      logrus and fixes the direction of the arrows in the messages emitted by
      rpccommon, which was inconsistent with the arrows of gdbserial.
      c53c43d1
  2. 29 6月, 2018 1 次提交
  3. 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
  4. 26 6月, 2018 1 次提交
    • A
      rpccommon: restore API port message · 818ed0b2
      aarzilli 提交于
      This message is used by clients to determine the port that a headless
      instance is using, therefore the format can not change or move to a
      different file handle.
      
      Fixes #1245
      818ed0b2
  5. 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
  6. 22 6月, 2018 3 次提交
    • D
      *: Update vendor · de7b8c66
      Derek Parker 提交于
      de7b8c66
    • D
      *: Use structured logging · a208c897
      Derek Parker 提交于
      Implements structured logging via Logrus. This gives us a logger per
      boundry that we care about, allowing for easier parsing of logs if users
      have more than one log option enabled. Also, cleans up a lot of
      conditionals in the code by simply silencing the logger at creation as
      opposed to conditionally logging everywhere.
      a208c897
    • 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
  7. 20 6月, 2018 1 次提交
    • A
      proc,command: fix optimized function warning in 1.9 · e19cbcef
      aarzilli 提交于
      A user complained on the mailing list about having continuous
      "optimized function warnings" on non-optimized functions when using 1.9.
      This commit fixes the problem by disabling optimized function detection
      on 1.9 and earlier (where it's impossible) and adds a test so we don't
      break it again in the future.
      e19cbcef
  8. 15 6月, 2018 2 次提交
    • A
      proc: allow "package/path".varname syntax · 2a2d1040
      aarzilli 提交于
      If the application being debugged imports two packages with the same
      name (but different paths) there was no way to disambiguate the two,
      since the character '/' can not appear inside a go identifier.
      
      By allowing users to use a string literal as the package name a package
      path can be specified.
      2a2d1040
    • A
      service,logflags: log all RPC messages · 454491ce
      aarzilli 提交于
      We occasionally receive bug reports from users of VSCode-go and GoLand.
      GoLand has its own way of capturing the packet exchange between itself
      and delve but VSCode-go (supposedly) doesn't.
      So far this hasn't been a problem since all bug reports were obvious
      bugs on the plugin or easy to reproduce without VSCode-go, but it might
      be helpful in the future to have a way to log the packet exchange
      between dlv and a frontend.
      
      This commit adds a --log-output option to enable logging of all rpc
      messages and changes service/rpccommon accordingly.
      454491ce
  9. 12 6月, 2018 10 次提交
  10. 09 6月, 2018 2 次提交
  11. 24 5月, 2018 4 次提交
    • S
      travis: install dwz package on linux tests · 33780e96
      Sergio Lopez 提交于
      33780e96
    • S
      proc_test: implement test for DWZ compressed DWARF · bafa5120
      Sergio Lopez 提交于
      If dwz binary is available in the system, test delve's ability to find
      deduplicated symbols in the DWARF information.
      
      dwzcompression.go contains a small C function (void fortytwo()) which
      calls glibc's fprintf with stdin as first argument. Normally, stdin
      will be present as a DW_TAG_variable as part of a DW_TAG_compile_unit
      named dwzcompression.cgo2.c.
      
      After running dwz on the binary, stdin is moved to a
      DW_TAG_partial_unit, which is imported from dwzcompression.cgo2.c with
      a DW_TAG_imported_unit.
      
      This test verifies that delve is able to find stdin symbol's type, as a
      way to confirm it understands dwz's compressed/deduplicated DWARF
      information.
      bafa5120
    • S
      proc/test/support: implement EnableDWZCompression · ed71248f
      Sergio Lopez 提交于
      The EnableDWZCompression flag allows tests to request BuildFixture to
      run "dwz" on the Fixture's resulting binary to compress/deduplicate its
      DWARF sections.
      ed71248f
    • 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
  12. 23 5月, 2018 1 次提交
  13. 22 5月, 2018 1 次提交
  14. 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
  15. 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
  16. 10 5月, 2018 1 次提交
  17. 08 5月, 2018 1 次提交
  18. 05 5月, 2018 1 次提交
  19. 27 4月, 2018 1 次提交
  20. 24 4月, 2018 3 次提交
    • A
      proc: Flag shadowed arguments as shadowed · 7fd47749
      aarzilli 提交于
      Fixes #951
      7fd47749
    • A
      proc: cache entire frame in FrameToScope instead of variablesByTag · 21be5946
      aarzilli 提交于
      Caching the frame in variablesByTag is problematic:
      
      1. accounting for variables that are (partially) stored in registers is
      complicated (see issue #1106)
      2. for some types (strings, interfaces...) simply creating the Variable
      object reads memory, which therefore happens before we can do any
      caching.
      
      Instead cache the entire frame when the EvalScope object is created.
      The cached range is between the SP value of the current frame and the
      CFA of the preceeding frame, if available, or the CFA of the current
      frame otherwise.
      
      Fixes #1106
      21be5946
    • A
      proc: change memCache to delay reading · a5574bcd
      aarzilli 提交于
      Change memCache so that the preloaded memory is not read immediately
      but only after the actual read to the preloaded range.
      
      This allows us to request caching the entire stack frame every time we
      create an eval scope and no unnecessary reads will be made even if the
      user is just trying to evaluate a global variable.
      a5574bcd