- 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 1 次提交
-
-
由 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.
-
- 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
-
- 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 4 次提交
-
-
由 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 提交于
Go 1.6 is now unsupported by the Go team and 3 years old and runtimeTypeToDIE can use some simplification.
-
- 22 2月, 2019 1 次提交
-
-
由 Alessandro Arzilli 提交于
Do not mention external debug info files when the problem might just be that the executable was stripped.
-
- 21 2月, 2019 1 次提交
-
-
由 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.
-
- 29 1月, 2019 1 次提交
-
-
由 aarzilli 提交于
Fixes #1471
-
- 15 1月, 2019 1 次提交
-
-
由 Derek Parker 提交于
This file should be located elsewhere (on the OSX host, I believe) and as such does not beed to be checked in here. Fixes #1460
-
- 08 1月, 2019 2 次提交
-
-
由 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.
-
由 aarzilli 提交于
The allg cache was corrupted when the count parameter was actually reached. Fix the bug and add a test for this.
-
- 05 1月, 2019 1 次提交
-
-
由 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.
-
- 04 1月, 2019 1 次提交
-
-
由 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.
-
- 04 12月, 2018 2 次提交
-
-
由 aarzilli 提交于
When casting an integer into a struct pointer we make a fake pointer variable that doesn't have an address, maybeDereference and structMember should still work on this kind of Variable. Fixes #1432
-
由 aarzilli 提交于
PTRACE_GETREGSET was added in Linux 2.6.34, running this request in an older kernel will report EIO, as documented on the manpage. Fixes #1197
-
- 30 11月, 2018 2 次提交
-
-
由 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.
-
由 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
-
- 27 11月, 2018 1 次提交
-
- 22 11月, 2018 2 次提交
-
-
由 aarzilli 提交于
Minidumps are the windows equivalent of unix core files. This commit updates pkg/proc/core so that it can open and read windows minidumps. Updates #794
-
由 aarzilli 提交于
Move windows register handling code to winutil package in preparation for using it in proc/core to read minidump files.
-
- 21 11月, 2018 3 次提交
-
-
由 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.
-
由 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.
-
由 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.
-
- 20 11月, 2018 2 次提交
-
-
由 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
-
由 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
-
- 16 11月, 2018 2 次提交
-
-
由 Derek Parker 提交于
-
由 Derek Parker 提交于
This patch is a slight refactor to share more code used for genericprocess initialization. There will always be OS/backend specificinitialization, but as much as can be shared should be to preventduplicating of any logic (setting internal breakpoints, loading bininfo,etc).
-
- 10 11月, 2018 1 次提交
-
-
由 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`.
-
- 09 11月, 2018 3 次提交
-
-
由 Derek Parker 提交于
Adds a config file option to allow specifying a list of directories to search in when looking for seperate external debug info files. Fixes #1353
-
由 Derek Parker 提交于
-
由 Derek Parker 提交于
-
- 07 11月, 2018 1 次提交
-
-
由 aarzilli 提交于
Make code in core.go OS and architecture agnostic in preparation for adding Windows minidump support.
-
- 23 10月, 2018 1 次提交
-
-
由 aarzilli 提交于
The linux version of proc/native and proc/core contained largely overlapping implementations of the register handling code, deduplicate it by moving it into proc/linutil.
-