- 28 1月, 2020 1 次提交
-
-
由 aarzilli 提交于
-
- 22 1月, 2020 4 次提交
-
-
由 Derek Parker 提交于
* pkg/proc: Introduce Target * pkg/proc: Remove Common.fncallEnabled Realistically we only block it on recorded backends. * pkg/proc: Move fncallForG to Target * pkg/proc: Remove CommonProcess Remove final bit of functionality stored in CommonProcess and move it to *Target. * pkg/proc: Add SupportsFunctionCall to Target
-
由 hengwu0 提交于
* proc: separate amd64-arch code separate amd64 code about stacktrace, so we can add arm64 stacktrace code. * proc: implemente stacktrace of arm64 * delve now can use stack, frame commands on arm64-arch debug. Co-authored-by: Ntykcd996 <tang.yuke@zte.com.cn> Co-authored-by: Nhengwu0 <wu.heng@zte.com.cn> * test: remove skip-code of stacktrace on arm64 * add LR DWARF register and remove skip-code for fixed tests * proc: fix the Continue command after the hardcoded breakpoint on arm64 Arm64 use hardware breakpoint, and it will not set PC to the next instruction like amd64. We should move PC in both runtime.breakpoints and hardcoded breakpoints(probably cgo). * proc: implement cgo stacktrace on arm64 * proc: combine amd64_stack.go and arm64_stack.go file * proc: reorganize the stacktrace code * move SwitchStack function arch-related * fix Continue command after manual stop on arm64 * add timeout flag to make.go to enable infinite timeouts Co-authored-by: Naarzilli <alessandro.arzilli@gmail.com> Co-authored-by: Nhengwu0 <wu.heng@zte.com.cn> Co-authored-by: Ntykcd996 <56993522+tykcd996@users.noreply.github.com> Co-authored-by: NAlessandro Arzilli <alessandro.arzilli@gmail.com>
-
由 Dmitry Neverov 提交于
-
由 Dmitry Neverov 提交于
Labels can help in identifying a particular goroutine during debugging. Fixes #1763
-
- 10 1月, 2020 3 次提交
-
-
由 aarzilli 提交于
Due to a bug in the Go compiler midstack inlined calls do not report their ranges correctly. We can't check if an address is in the range of a DIE by simply looking at that DIE's range, we should also recursively check the DIE's children's ranges. Also fixes the way stacktraces of midstack inlined calls are reported (they used to be inverted, with the deepest inlined stack frame reported last). Fixes #1795
-
由 aarzilli 提交于
Adds an API call that returns a list of packages contained in the program and the files that were used to build them, and also a best guess at which filesystem directory contained the package when it was built. This can be used by IDEs to map file paths if the debugging environment doesn't match the build environment exactly.
-
由 aarzilli 提交于
When a line has instructions associated but none of them have is_stmt set LineToPC and LineToPCIn should behave in the same way. Fixes #1817
-
- 03 1月, 2020 1 次提交
-
-
由 aarzilli 提交于
Remove build tags from disassembler code, move architecture specific functionality inside proc.Arch. This is necessary because Delve should be able to debug corefiles cross-platform.
-
- 12 12月, 2019 1 次提交
-
-
由 hengwu0 提交于
-
- 28 11月, 2019 5 次提交
-
-
由 吴衡10223547 提交于
* fix TestKill test: It will fail in Open /proc/pid/ sporadicly since there is no any sync between signal sended(tracee handled) and open /proc/%d/, especially in some weak arm64 cpu. Skip /proc check on arm64. * remove skip-code of Detach tests.
-
由 hengwu0 提交于
* move firstPCAfterPrologueDisassembly() and checkPrologue() out of arch independent. * s/do not/does not/ (for all tests)
-
由 hengwu0 提交于
* remove skip-code of some arm64 tests, which implemented. * fix errors in testsuits for arm64
-
由 hengwu0 提交于
-
由 hengwu0 提交于
Skip the failed tests that don't work on arm64.
-
- 12 11月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
* proc/linux: do not route signals to threads while stopping While we are trying to stop the process we should not route signals sent to threads because that will result in threads being resumed. Also keep better track of which threads are stopped. This fixes an incompatibility with Go 1.14, which sends a lot of signals to its threads to implement non-cooperative preemption, resulting in Delve hanging waiting for an already-stopped thread to stop. In principle however this bug has nothing to do with Go 1.14 and could manifest in any instance of high signal pressure. * Makefile: discard stderr of "go list" In module mode "go" will print messages about downloading modules to stderr, we shouldn't confuse them for the real command output.
-
- 02 11月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Modifies FindFileLocation, FindFunctionLocation and LineToPC as well as service/debugger to support inlining and introduces the concept of logical breakpoints. For inlined functions FindFileLocation, FindFunctionLocation and LineToPC will now return one PC address for each inlining and one PC for the concrete implementation of the function (if present). A proc.Breakpoint will continue to represent a physical breakpoint, at a single memory location. Breakpoints returned by service/debugger, however, will represent logical breakpoints and may be associated with multiple memory locations and, therefore, multiple proc.Breakpoints. The necessary logic is introduced in service/debugger so that a change to a logical breakpoint will be mirrored to all its physical breakpoints and physical breakpoints are aggregated into a single logical breakpoint when returned.
-
- 29 10月, 2019 2 次提交
-
-
由 aarzilli 提交于
program When evaluating type casts always resolve array types. Instead of resolving them by looking up the string in debug_info construct a fake array type so that a type cast to an array type always works as long as the element type exists. We already did this for byte arrays, this commit extends this to any array type. The reason is that we return a fake array type (that doesn't exist in the target program) for the array of a channel type. Fixes #1736
-
由 Alessandro Arzilli 提交于
Fixes a case of breakpoint confusion on resume caused by having two breakpoints one byte apart. This bug can cause the target program to resume execution a single byte inside an instruction and crash either with SIGILL or a SIGSEGV, or misbehave (depending on how the truncated instruction is decoded). native.(*Thread).StepInstruction should call FindBreakpoint using adjustPC==false because at that point the PC of the thread should already have been adjusted (and it has been).
-
- 22 10月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Adds a '-r' option to the 'restart' command (and to the Restart API) that re-records the target when using rr. Also moves the code to delete the trace directory inside the gdbserial package.
-
- 26 9月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Add options to start a stacktrace from the values saved in the runtime.g struct as well as a way to disable the stackSwitch logic and just get a normal stacktrace.
-
- 14 8月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
-
- 13 8月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
proc.Next and proc.Step will call, after setting their temp breakpoints, curthread.SetCurrentBreakpoint. This is intended to find if one of the newly created breakpoints happens to be at the same instruction that curthread is stopped at. However SetCurrentBreakpoint is intended to be called after a Continue and StepInstruction operation so it will also detect if curthread is stopped one byte after a breakpoint. If the instruction immediately preceeding the current instruction of curthread happens to: 1. have one of the newly created temp breakpoints 2. be one byte long SetCurrentBreakpoint will believe that we just hit that breakpoint and therefore the instruction should be repeated, and thus rewind the PC of curthread by 1. We should distinguish between the two uses of SetCurrentBreakpoint and disable the check for "just hit" breakpoints when inappropriate. Fixes #1656
-
- 10 8月, 2019 1 次提交
-
-
由 Derek Parker 提交于
-
- 02 8月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
* proc: fix stacktraces when a SIGSEGV happens during a cgo call When a SIGSEGV happens in a cgo call (for example as a result of dereferencing a NULL pointer) the stack layout will look like this: (system stack) runtime.fatalthrow (system stack) runtime.throw (system stack) runtime.sigpanic (system stack) offending C function ... other C functions... (system stack) runtime.asmcgocall (goroutine stack) call inside cgo The code in switchStack would switch directly from the runtime.fatalthrow frame to the first frame in the goroutine stack, hiding important information. Disable this switch for runtime.fatalthrow and reintroduce the check for runtime.mstart that existed before this version of the code was implemented in commit 7bec20. This problem was reported in comment: https://github.com/go-delve/delve/issues/935#issuecomment-512182533 * cmd/dlv: actually disable C compiler optimizations when building
-
- 30 7月, 2019 1 次提交
-
-
由 Derek Parker 提交于
* *: Add .cirrus.yml for FreeBSD testing * *: run go mod tidy * service/test: prefer 127.0.0.1 over localhost * dwarf/line: fix TestDebugLinePrologueParser * vendor: rerun go mod vendor
-
- 17 7月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Increases the maximum string length from 64 to 1MB when loading strings for a binary operator, also delays the loading until it's necessary. This ensures that comparison between strings will always succeed in reasonable situations. Fixes #1615
-
- 13 7月, 2019 1 次提交
-
-
由 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
-
- 09 7月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Backports debug/dwarf commit: 535741a69a1300d1fe2800778b99c8a1b75d7fdd CL: https://go-review.googlesource.com/18459 The x/debug/dwarf that we used for dwarf/godwarf/type.go was forked from debug/dwarf long before this commit. Original description: Currently readType simultaneously constructs a type graph and resolves the sizes of the types. However, these two operations are fundamentally at odds: the order we parse a cyclic structure in may be different than the order we need to resolve type sizes in. As a result, it's possible that when readType attempts to resolve the size of a typedef, it may dereference a nil Type field of another typedef retrieved from the type cache that's only partially constructed. To fix this, we delay resolving typedef sizes until the end of the readType recursion, when the full type graph is constructed. Fixes #1601
-
- 01 7月, 2019 2 次提交
-
-
由 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
-
由 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.
-
- 28 6月, 2019 1 次提交
-
-
由 David Chase 提交于
Support for bulk queries makes the DWARF quality checker (github.com/dr2chase/dwarf-goodness/cmd/dwarf-goodness) run much more efficiently (replace quadratic cost with linear).
-
- 26 6月, 2019 1 次提交
-
-
由 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).
-
- 04 6月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Fixes #1568
-
- 09 5月, 2019 2 次提交
-
-
由 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
-
由 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
-
- 03 5月, 2019 1 次提交
-
-
由 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
-
- 26 4月, 2019 1 次提交
-
-
由 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.
-
- 28 3月, 2019 2 次提交
-
-
由 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
-
由 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
-