1. 21 2月, 2019 1 次提交
    • D
      pkg/proc: Disable default compression on DWZ test · 389e96ae
      Derek Parker 提交于
      When compression is applied by default running the DWZ tool on the
      resulting binary will crash.
      
      The actual default compression code will look and see if compression
      makes any difference and if so replace the normal `.debug_*` section
      with `.zdebug_*`. This is why it may not have been hit before. On one of
      my workstations I build with 1.12rc1 and no compression happens, but on
      a Fedora VM I build and the binary results in compressed DWARF sections.
      
      Adding this flag will make this test more consistent overall.
      389e96ae
  2. 20 2月, 2019 1 次提交
  3. 14 2月, 2019 1 次提交
    • A
      all: Bump to v1.2.0 · 725411a3
      aarzilli 提交于
      Add new version to CHANGELOG and update internal version.
      
      Thank you @sbromberger @chainhelen, @dishmaev, @kevin-cantwell,
      @Russtopia, @slp, @zavla, @the4thamigo-uk, @altimac and
      @GregorioMartinez.
      725411a3
  4. 12 2月, 2019 1 次提交
    • G
      pkg/config: try to use XDG_CONFIG_HOME when present · c1a39c6f
      Gregorio Martinez 提交于
      * config/config.go
      
      This change checks for the environmental variable XDG_CONFIG_HOME
      before storing the configuration file in the home directory.
      
      Closes #1454
      
      * config/config.go
      
      This change attempts to move the previous config file location to the
      new XDG_CONFIG_HOME compliant location on linux systems or when
      XDG_CONFIG_HOME is set.
      
      This change removes the old config file location if the file is
      successfully moved.
      
      * config/config.go
      
      Consolidate messages about config moving and clean up into one.
      Remove extraneous newlines.
      
      * pkg/config: config path error messages print to stderr
      
      This change updates the output location of error messages related to
      the config path. This will prevent clients from getting unexpected output
      when an error occurs.
      
      * pkg/config: Update path used when returning unable to move config error
      
      This change fixes the error message when Delve was unable to move the config. Previously returned a FileInfo object not the file path.
      
      * pkg/config: Remove check for stderr when printing error messages
      
      * pkg/config: Move success message for moving config to stderr
      
      This prevents the success message from being printed to stdout and
      breaking frontends.
      
      * pkg/config: Rename variable to be more descriptive
      c1a39c6f
  5. 29 1月, 2019 1 次提交
  6. 15 1月, 2019 1 次提交
  7. 09 1月, 2019 1 次提交
  8. 08 1月, 2019 4 次提交
    • A
      service: improve documentation of ListGoroutines · 86c4b720
      aarzilli 提交于
      Describe how the Start and Count parameters of ListGoroutines are used.
      86c4b720
    • A
      proc: improve performance of FindGoroutine in normal circumstances · 503bf529
      aarzilli 提交于
      FindGoroutine can be slow when there are many goroutines running. This
      can not be fixed in the general case, however:
      
      1. Instead of getting the entire list of goroutines at once just get a
         few at a time and return as soon as we find the one we want.
      
      2. Since FindGoroutine is mostly called by ConvertEvalScope and users
         are more likely to request informations about a goroutine running on a
         thread, look within the threads first.
      503bf529
    • A
      proc: fix GoroutinesInfo cache · 515ccc4b
      aarzilli 提交于
      The allg cache was corrupted when the count parameter was actually
      reached.
      
      Fix the bug and add a test for this.
      515ccc4b
    • A
      tests: fix typecheckrpc.go and convert it to a test · a357ce06
      aarzilli 提交于
      We forgot to run typecheckrpc.go periodically and it didn't work
      anymore and there were some minor errors in service/rpc2/client.go.
      
      Rewrite typecheckrpc.go using go/packages, so that it works with go1.11
      and go.mod, and fix the issues in client.go
      a357ce06
  9. 05 1月, 2019 4 次提交
    • A
      dwarf/godwarf: tolerate cyclical type DIEs · 7e86d674
      aarzilli 提交于
      As specified in line dwarf/godwarf/type.go:507 the typeCache entry
      should always be set before recursive calls to readType to avoid infite
      recursion.
      Most code in readType already does this but some of the code added
      later to handle Go types was wrong.
      Fix this bug and also fix the String and Size methods of Type so that
      they handle recursive types "correctly" (i.e. they don't recur
      forever).
      
      No test is added for this since all legitimate uses of cyclical types
      were already handled correctly and the malformed types emitted by the
      go compiler will probably be removed in 1.12.
      See: https://github.com/golang/go/issues/29264
      
      Fixes #1444
      7e86d674
    • A
      *: Missed go-delve renames · efa77fda
      aarzilli 提交于
      * Change module name to github.com/go-delve/delve
      * Change package name in appveyor.yml
      efa77fda
    • 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
    • A
      385c7935
  10. 04 1月, 2019 1 次提交
    • D
      pkg/proc/test: Eval symlinks for test source (#1452) · de6682d2
      Derek Parker 提交于
      Some build environments (such as when building RPMs) enjoy symlinking
      things. This unfortunately causes our tests to fail as we record the
      path of fixtures and use that when looking up file:line information.
      However, the debug info in the binary records the original file
      location, not the location of the symlink.
      de6682d2
  11. 04 12月, 2018 3 次提交
  12. 30 11月, 2018 2 次提交
    • 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
    • A
      proc: handle gid == 0 in FindGoroutine · 2210debf
      aarzilli 提交于
      Goroutine id == 0 is special (there can be many goroutines with id 0).
      If the caller of FindGoroutine asks for gid==0 and current thread is
      running a goroutine 0 (i.e. either no goroutine or a special
      goroutine) return whatever goroutine is running on the current thread.
      
      Updates #1428
      2210debf
  13. 29 11月, 2018 2 次提交
  14. 28 11月, 2018 1 次提交
  15. 27 11月, 2018 3 次提交
    • A
      proc: do not panic if we can't satisfy a composite location for a slice var · 53957e9f
      aarzilli 提交于
      The fix in 7f53117e for Issue #1416 had a bug, fix it and add a test.
      
      Fixes #1419
      53957e9f
    • S
      pkg/config: Use a default value for DebugInfoDirectories · dc208bc0
      Sergio Lopez 提交于
      If DebugInfoDirectories is empty, set it to same value as we have in the
      default configuration.
      
      This is useful for users which already have an older config file.
      dc208bc0
    • S
      pkg/config: Rewind *File after writeDefaultConfig · 46923142
      Sergio Lopez 提交于
      Otherwise the later call to ioutil.ReadAll will return an empty array.
      
      This issue is visible from the user's perspective due to the new
      debug-info-directories parameter, which does have a value in the default
      config.
      
      As a consequence, the first 'dlv' invocation fails to find the separate
      debug info files, while the second one works as expected:
      
      $ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
      could not find external debug info file
      $ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
      Type 'help' for list of commands.
      (dlv) exit
      46923142
  16. 22 11月, 2018 2 次提交
  17. 21 11月, 2018 4 次提交
    • A
      proc: correctly extract name of functions that have been inlined · 3048b960
      aarzilli 提交于
      If a function can be inlined it will appear as two entries in
      debug_info. A DW_TAG_subprogram entry with DW_AT_inlined = true (that
      will be used as the abstract origin) and a second DW_TAG_subprogram
      entry with an abstract origin.
      To retrieve the name of this second entry we must load its abstract
      origin.
      3048b960
    • 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
    • A
      tests: minor fixes for Go 1.12 · f813520e
      aarzilli 提交于
      f813520e
    • A
      proc: remove inversion of return variables from returnBreakpointInfo · f8c0c37f
      aarzilli 提交于
      It was never true that return variables were in the inverse order.
      Instead in Go1.11 return variables are saved in debug_info in an
      arbitrary order and inverting them just happened to work for this
      specific example.
      
      This bug was fixed in Go 1.12, regardless we should attempt to
      rearrange return variables anyway.
      f8c0c37f
  18. 20 11月, 2018 2 次提交
    • A
      proc: do not panic if we can't satisfy a composite location · 7f53117e
      aarzilli 提交于
      When a location expression requests a register check that we have as
      many bytes in the register as requested and if we don't report the
      error.
      
      Updates #1416
      7f53117e
    • S
      proc/proc: Extend GoroutinesInfo to allow specifying a range · 11accd4d
      Sergio Lopez 提交于
      Instead of unconditionally returning all present goroutines,
      GoroutinesInfo now allows specifying a range (start and count). In
      addition to the array of goroutines and the error, it now also returns
      the next goroutine to be processed, to be used as 'start' argument on
      the next call, or 0 if all present goroutines have already been
      processed.
      
      This way clients can avoid eating large amounts of RAM while debugging
      core dumps and processes with a exceptionally high amount of goroutines.
      
      Fixes #1403
      11accd4d
  19. 16 11月, 2018 2 次提交
  20. 14 11月, 2018 1 次提交
  21. 10 11月, 2018 1 次提交
    • A
      proc: Improve performance of loadMap on very large sparse maps · 89c8da65
      aarzilli 提交于
      Users can create sparse maps in two ways, either by:
      a) adding lots of entries to a map and then deleting most of them, or
      b) using the make(mapType, N) expression with a very large N
      
      When this happens reading the resulting map will be very slow
      because loadMap needs to scan many buckets for each entry it finds.
      
      Technically this is not a bug, the user just created a map that's
      very sparse and therefore very slow to read. However it's very
      annoying to have the debugger hang for several seconds when trying
      to read the local variables just because one of them (which you
      might not even be interested into) happens to be a very sparse map.
      
      There is an easy mitigation to this problem: not reading any
      additional buckets once we know that we have already read all
      entries of the map, or as many entries as we need to fulfill the
      MaxArrayValues parameter.
      
      Unfortunately this is mostly useless, a VLSM (Very Large Sparse Map)
      with a single entry will still be slow to access, because the single
      entry in the map could easily end up in the last bucket.
      
      The obvious solution to this problem is to set a limit to the
      number of buckets we read when loading a map. However there is no
      good way to set this limit.
      If we hardcode it there will be no way to print maps that are beyond
      whatever limit we pick.
      We could let users (or clients) specify it but the meaning of such
      knob would be arcane and they would have no way of picking a good
      value (because there is no objectively good value for it).
      
      The solution used in this commit is to set an arbirtray limit on
      the number of buckets we read but only when loadMap is invoked
      through API calls ListLocalVars and ListFunctionArgs. In this way
      `ListLocalVars` and `ListFunctionArgs` (which are often invoked
      automatically by GUI clients) remain fast even in presence of a
      VLSM, but the contents of the VLSM can still be inspected using
      `EvalVariable`.
      89c8da65
  22. 09 11月, 2018 1 次提交