1. 13 7月, 2019 2 次提交
    • 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
    • Q
      terminal: Add breakpoint autocompletion (#183) (#1612) · 114b76ae
      qingyunha 提交于
      114b76ae
  2. 09 7月, 2019 7 次提交
  3. 04 7月, 2019 1 次提交
  4. 03 7月, 2019 1 次提交
    • A
      terminal: adds embedded scripting language (#1466) · ed35dce7
      Alessandro Arzilli 提交于
      If the argument of 'source' ends in '.star' it will be interpreted as a
      starlark script.
      If the argument of 'source' is '-' an interactive starlark repl will be
      started.
      
      For documentation on how the starlark execution environment works see
      Documentation/cli/starlark.md.
      
      The starlark API is autogenerated from the JSON-RPC API by
      script/gen-starlark-bindings.go.
      In general for each JSON-RPC API a single global starlark function is
      created.
      When one of those functions is called (through a starlark script) the
      arguments are converted to go structs using reflection. See
      unmarshalStarlarkValue in pkg/terminal/starbind/conv.go.
      If there are no type conversion errors the JSON-RPC call is executed.
      The return value of the JSON-RPC call is converted back into a starlark
      value by interfaceToStarlarkValue (same file):
      
      * primitive types (such as integers, floats or strings) are converted
        by creating the corresponding starlark value.
      * compound types (such as structs and slices) are converted by wrapping
        their reflect.Value object into a type that implements the relevant
        starlark interfaces.
      * api.Variables are treated specially so that their Value field can be
        of the proper type instead of always being a string.
      
      Implements #1415, #1443
      ed35dce7
  5. 02 7月, 2019 2 次提交
  6. 01 7月, 2019 2 次提交
    • A
      proc: allow simultaneous call injection to multiple goroutines (#1591) · dd4fd5dc
      Alessandro Arzilli 提交于
      * proc: allow simultaneous call injection to multiple goroutines
      
      Changes the call injection code so that we can have multiple call
      injections going on at the same time as long as they happen on distinct
      goroutines.
      
      * proc: fix EvalExpressionWithCalls for constant expressions
      
      The lack of address of constant expressions would confuse EvalExpressionWithCalls
      
      Fixes #1577
      dd4fd5dc
    • A
      Go 1.13 support (#1546) · 55eed318
      Alessandro Arzilli 提交于
      * tests: fix tests for Go 1.13
      
      - Go 1.13 doesn't autogenerate init functions anymore, tests that
        expected that now fail and should be skipped.
      - Plugin tests now need -gcflags'all=-N -l' now, we were probably
        getting lucky with -gcflags='-N -l' before.
      
      * proc: allow signed integers as shift counts
      
      Go1.13 allows signed integers to be used as the right hand side of a
      shift operator, change eval to match.
      
      * goversion: update maximum supported version
      
      * travis: force Go to use vendor directory
      
      Travis scripts get confused by "go: downloading" lines, the exact
      reason is not clear. Testing that the vendor directory is up to date is
      a good idea anyway.
      55eed318
  7. 28 6月, 2019 1 次提交
  8. 26 6月, 2019 1 次提交
    • A
      proc,service: remove support for locspec '<fnname>:0' (#1588) · 7afda8db
      Alessandro Arzilli 提交于
      The location specified '<fnname>:0' could be used to set a breakpoint
      on the entry point of the function (as opposed to locspec '<fnname>'
      which sets it after the prologue).
      Setting a breakpoint on an entry point is almost never useful, the way
      this feature was implemented could cause it to be used accidentally and
      there are other ways to accomplish the same task (by setting a
      breakpoint on the PC address directly).
      7afda8db
  9. 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
  10. 18 6月, 2019 1 次提交
  11. 16 6月, 2019 1 次提交
    • D
      proc/linutil: Fix register bitmasks · b9bcd979
      Derek Parker 提交于
      The bitmasks for transforming a 64-bit register into it's lower-bit
      counterparts (e.g. RAX -> EAX -> AX -> AH/AL) were incorrect. This patch
      fixes the bitmasks and adds an additional test.
      b9bcd979
  12. 13 6月, 2019 1 次提交
  13. 12 6月, 2019 1 次提交
  14. 05 6月, 2019 1 次提交
  15. 04 6月, 2019 2 次提交
  16. 01 6月, 2019 2 次提交
    • D
      cmd/dlv: Change name for binary dlv auto compiles · b9f7dd50
      Derek Parker 提交于
      Prevent conflicts by choosing a name that is extremely unlikely to
      conflict with any actual package a user may have in their code.
      
      Fixes #580
      b9f7dd50
    • 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
  17. 31 5月, 2019 1 次提交
  18. 30 5月, 2019 4 次提交
    • T
      proc: Less confusing error message for requesting break on blank line. (#1556) · 9076056c
      tschundler 提交于
      The current wording is confusing - the file exists and the line exists, so what is the problem? I suspect this ambiguity is behind #1496 and likely others.
      
      Also I updated the style to return values like the rest of the code in the file, which is also more readable (IMO and per https://github.com/golang/go/wiki/CodeReviewComments#named-result-parameters)
      9076056c
    • A
      More Function Calls, parts 2 (#1504) · 60830c2b
      Alessandro Arzilli 提交于
      * proc: support nested function calls
      
      Changes the code in fncall.go to support nested function calls.
      
      This changes delays argument evaluation until after we have used
      the call injection protocol to allocate an argument frame. When
      evaluating the parse tree of an expression we'll initiate each
      function call we find on the way down and then complete the function
      call on the way up.
      
      For example. in:
      
      	f(g(x))
      
      we will:
      
      1. initiate the call injection protocol for f(...)
      2. progress it until the point where we have space for the arguments
         of 'f' (i.e. when we receive the debugCallAXCompleteCall message
         from the target runtime)
      3. inititate the call injection protocol for g(...)
      4. progress it until the point where we have space for the arguments
         of 'g'
      5. copy the value of x into the argument frame of 'g'
      6. finish the call to g(...)
      7. copy the return value of g(x) into the argument frame of 'f'
      8. finish the call to f(...)
      
      Updates #119
      
      * proc: bugfix: closure addr was wrong for non-closure functions
      60830c2b
    • J
      documentation: update idea plugin url (#1562) · 3215dc2d
      Justin Clift 提交于
      3215dc2d
    • J
      proc: trivial typo fix (#1561) · 6f258d91
      Justin Clift 提交于
      6f258d91
  19. 24 5月, 2019 1 次提交
  20. 09 5月, 2019 2 次提交
    • A
      proc: allow function calls to appear inside an expression (#1503) · c30a333f
      Alessandro Arzilli 提交于
      The initial implementation of the 'call' command required the
      function call to be the root expression, i.e. something like:
      
      	double(3) + 1
      
      was not allowed, because the root expression was the binary operator
      '+', not the function call.
      
      With this change expressions like the one above and others are
      allowed.
      
      This is the first step necessary to implement nested function calls
      (where the result of a function call is used as argument to another
      function call).
      
      This is implemented by replacing proc.CallFunction with
      proc.EvalExpressionWithCalls. EvalExpressionWithCalls will run
      proc.(*EvalScope).EvalExpression in a different goroutine. This
      goroutine, the 'eval' goroutine, will communicate with the main
      goroutine of the debugger by means of two channels: continueRequest
      and continueCompleted.
      
      The eval goroutine evaluates the expression recursively, when
      a function call is encountered it takes care of setting up the
      function call on the target program and writes a request to the
      continueRequest channel, this causes the 'main' goroutine to restart
      the target program by calling proc.Continue.
      
      Whenever Continue encounters a breakpoint that belongs to the
      function call injection protocol (runtime.debugCallV1 and associated
      functions) it writes to continueCompleted which resumes the 'eval'
      goroutine.
      
      The 'eval' goroutine takes care of implementing the function call
      injection protocol.
      
      When the expression is fully evaluated the 'eval' goroutine will
      write a special message to 'continueRequest' signaling that the
      expression evaluation is terminated which will cause Continue to
      return to the user.
      
      Updates #119
      c30a333f
    • 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
  21. 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
  22. 27 4月, 2019 2 次提交
  23. 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
  24. 30 3月, 2019 1 次提交