- 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).
-
- 24 6月, 2019 1 次提交
-
-
由 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).
-
- 18 6月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Allow changing the value of a string variable to a new literal string, which requires calling runtime.mallocgc to allocate the string into the target process. This means that a command like: call f("some string") is now supported. Additionally the command: call s = "some string" is also supported. Fixes #826
-
- 16 6月, 2019 1 次提交
-
-
由 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.
-
- 13 6月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Fixes #1578
-
- 12 6月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Childless compile units would confuse loadDebugInfoMaps. No test because I don't know what causes go to invoke GNU As in such a way that it produces a childless compile unit. Fixes #1572
-
- 05 6月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Without this a client calling an method on a version of Delve that doesn't have that method (for example because it's old) will never get a response back.
-
- 04 6月, 2019 2 次提交
-
-
由 Alessandro Arzilli 提交于
Fixes #1568
-
由 Alessandro Arzilli 提交于
-
- 01 6月, 2019 2 次提交
-
-
由 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
-
由 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.
-
- 31 5月, 2019 1 次提交
-
-
由 Sean Chen 提交于
-
- 30 5月, 2019 4 次提交
-
-
由 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)
-
由 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
-
由 Justin Clift 提交于
-
由 Justin Clift 提交于
-
- 24 5月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Copy the location expression and declaration line of escaped variables when auto-dereferencing them.
-
- 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
-
- 27 4月, 2019 2 次提交
-
-
由 Alessandro Arzilli 提交于
Before doing anything check that the version of Go is compatible with the current version of Delve. This will improve the error message in the case that another change as disruptive as Go1.11 dwarf compression, happens.
-
由 Alessandro Arzilli 提交于
Go 1.12 introduced a change to the internal map representation where empty map cells can be marked with a tophash value of 1 instead of just 0. Fixes #1531
-
- 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.
-
- 30 3月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
When we resolve a numerical value to a symbolic constant also report the numerical value, for clarity. Fixes #1516
-
- 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
-
- 27 3月, 2019 2 次提交
-
-
由 Qais Patankar 提交于
It is "GitHub", not "Github"
-
由 Aya Igarashi 提交于
-
- 21 3月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Adds initial support for plugins, this is only the code needed to keep track of loaded plugins on linux (both native and gdbserial backend). It does not actually implement support for debugging plugins on linux. Updates #865
-
- 19 3月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
The lookup at it.pc-1 is only ever done if fn is not nil and pc != fn.entry. Also when it happens only the File and Line fields are allowed to change.
-
- 28 2月, 2019 1 次提交
-
-
由 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.
-
- 27 2月, 2019 6 次提交
-
-
由 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
-
由 Alessandro Arzilli 提交于
Fixes #1481
-
由 Alessandro Arzilli 提交于
Fixes #1493
-
由 Alessandro Arzilli 提交于
-
由 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.
-
由 Alessandro Arzilli 提交于
Go 1.6 is now unsupported by the Go team and 3 years old and runtimeTypeToDIE can use some simplification.
-
- 22 2月, 2019 3 次提交
-
-
由 Derek Parker 提交于
-
由 chainhelen 提交于
If the user specifies a relative path in a location expression try to match it relative to the path of the executable. Fixes #1474
-
由 Alessandro Arzilli 提交于
Do not mention external debug info files when the problem might just be that the executable was stripped.
-