1. 03 5月, 2019 1 次提交
    • A
      proc/test: fix flakyness of TestCallConcurrent (#1543) · 71a7fe04
      Alessandro Arzilli 提交于
      Remove the breakpoint set in TestCallConcurrent so that it doesn't
      interfere with the call injection protocol.
      The fact that it can is a bug but that bug is better addressed after
      PRs #1503 and #1504 are merged, this keeps tests happy in the meantime.
      
      Fixes #1542
      71a7fe04
  2. 27 4月, 2019 2 次提交
  3. 26 4月, 2019 1 次提交
    • A
      proc/native: fix target program crash caused by call injection (linux) (#1538) · 0b3c7d80
      Alessandro Arzilli 提交于
      RestoreRegisters on linux would also restore FS_BASE and GS_BASE, if
      the target goroutine migrated to a different thread during the call
      injection this would result in two threads of the target process
      pointing to the same TLS area which would greatly confuse the target
      runtime, leading to fatal panics with nonsensical stack traces.
      
      Other backends are unaffected:
      
      - native/windows doesn't store the TLS in the same CONTEXT struct as
        the other register values.
      - native/darwin doesn't support function calls (and wouldn't store the
        TLS value in the same struct)
      - gdbserial/rr doesn't support function calls (because it's a
        recording)
      - gsdbserial/lldb extracts the value of TLS by executing code in the
        target process.
      0b3c7d80
  4. 30 3月, 2019 1 次提交
  5. 28 3月, 2019 2 次提交
    • A
      proc,debugger,terminal: read goroutine ancestors · 98265315
      aarzilli 提交于
      Add options to the stack command to read the goroutine ancestors.
      Ancestor tracking was added to Go 1.12 with CL:
      https://go-review.googlesource.com/c/go/+/70993/
      
      Implements #1491
      98265315
    • A
      Miscellaneous logging improvements (#1525) · 48f1f51e
      Alessandro Arzilli 提交于
      * *: use loglevel to control what gets logged instead of output redirection
      
      This stops logrus from doing all the formatting just to discard it
      immediately afterwards.
      
      * logflags: replace default formatter of logrus
      
      The default formatter of logrus emits logs in two different formats
      depending on whether or not the output is going to a terminal. The
      output format for non-terminals is indented to be machine readable, but
      we mostly read logs ourselves and the excessive quoting makes that
      format unreadable.
      When outputting to terminals it uses ANSI escape codes unconditionally,
      without checking whether the terminal it is connected to actually
      supports colors.
      
      This commit replaces the default formatter with a much simpler
      formatter that always uses a more readable format, doesn't use colors
      and places the key-value pairs at the beginning of the line (which is a
      better match for how we use them).
      
      * cmd/dlv: add command line options to redirect logs
      
      Adds two options, --log-to-file and --log-to-fd, to redirect logs to a
      file or to a file descriptor.
      
      When one of those two options is specified the "API server listening
      at:" message will also be redirected to the specified file/file
      descriptor.
      This allows clients that want to use the "API server listening at:"
      message to do so even if they want to redirect the target's stdout to
      another file or device.
      
      Implements #1179, #1523
      48f1f51e
  6. 27 3月, 2019 2 次提交
  7. 21 3月, 2019 1 次提交
  8. 19 3月, 2019 1 次提交
  9. 28 2月, 2019 1 次提交
    • A
      proc: catch fatal runtime errors (#1502) · ac3b1c7a
      Alessandro Arzilli 提交于
      Like we do with unrecovered panics, create a default breakpoint to
      catch runtime errors that will cause the program to terminate.
      Primarily intended to give users the opportunity to examine the state
      of a deadlocked process.
      ac3b1c7a
  10. 27 2月, 2019 6 次提交
    • A
      proc: workarounds for runtime.clone (#1470) · 520d7924
      Alessandro Arzilli 提交于
      runtime.clone (on some operating systems?) work similarly to fork:
      when a thread calls runtime.clone a new thread is created. For a
      short period of time both the parent thread and the child thread
      appear to be running the same goroutine, until the child thread
      adjusts its TLS to point to the correct goroutine.
      
      This means that proc.GetG for a thread that's currently running
      'runtime.clone' could be wrong and, consequently, the field
      proc.(G).thread of a G struct returned by GoroutinesInfo could be
      also wrong. And, finally, that FindGoroutine could sometimes return
      a *G with a bad associated thread if the goroutine of interest
      recently called 'runtime.clone'.
      
      To work around this problem this commit makes two changes:
      
      1. proc.GetG will return nil for all threads executing runtime.clone.
      2. FindGoroutine will return the selected goroutine as long as the
         ID matches the one requested.
      
      Change (1) takes care of the 'runtime.clone' problem. If we stop
      the target process shortly after a thread executed the SYSCALL
      instruction in 'runtime.clone' there are three possibilities:
      
      a. Both the parent thread and the child thread are stopped inside
      'runtime.clone'. In this case the state we report is slightly
      incorrect, because both threads will be reported as not running any
      goroutine when we do know which goorutine one of them (the parent)
      is running. This doesn't actually matter since runtime.clone is
      always called on the system stack and therefore the goroutine in
      runtime.allgs will have the correct location.
      
      b. The child thread managed to exit 'runtime.clone' but the parent
      thread didn't. This is similar to (a) but in this case GetG on the
      child thread will return the correct goroutine. GetG on the parent
      thread will still return (incorrectly) nil but this doesn't matter
      for the samer reason as described in (a).
      
      c. The parent thread managed to exit 'runtime.clone' but the child
      thread didn't. In this case GetG will return the correct goroutine
      both for the parent thread (because it's not executing runtime.clone)
      and the child thread.
      
      Change (2) means that even if a thread has a completely nonsensical
      TLS (for example because it's set through cgo) evaluating a variable
      with a valid GoroutineID will still work as long as it's the current
      goroutine (which is the most common case). This change also doubles
      as an optimization for FindGoroutine.
      
      Fixes #1469
      520d7924
    • A
      3ba4bcf4
    • A
      14aeea2b
    • A
      travis.yml: add 1.12 to test matrix (#1498) · 0e1c7427
      Alessandro Arzilli 提交于
      0e1c7427
    • A
      service/api: add quotes around types when needed in prettyprint.go (#1500) · d52572e8
      Alessandro Arzilli 提交于
      Type names need to be quoted when that expression is evaluated, by
      printing them quoted the user can just copy and paste the output.
      d52572e8
    • A
      proc: drop support for reading interfaces in Go <= 1.6 (#1501) · b9c842b4
      Alessandro Arzilli 提交于
      Go 1.6 is now unsupported by the Go team and 3 years old and
      runtimeTypeToDIE can use some simplification.
      b9c842b4
  11. 22 2月, 2019 3 次提交
  12. 21 2月, 2019 2 次提交
    • D
      service/test: Follow symlinks in integration tests · 3194ab1c
      Derek Parker 提交于
      3194ab1c
    • 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
  13. 20 2月, 2019 1 次提交
  14. 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
  15. 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
  16. 29 1月, 2019 1 次提交
  17. 15 1月, 2019 1 次提交
  18. 09 1月, 2019 1 次提交
  19. 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
  20. 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
  21. 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
  22. 04 12月, 2018 2 次提交