- 11 4月, 2020 1 次提交
-
-
由 Derek Parker 提交于
This flag allows users on UNIX systems to set the tty for the program being debugged by Delve. This is useful for debugging command line applications which need access to their own TTY, and also for controlling the output of the debugged programs so that IDEs may open a dedicated terminal to show the output for the process.
-
- 10 4月, 2020 1 次提交
-
-
由 Darren Rambaud 提交于
* gdbserial/gdbserver: Dynamically resolve debugserver binary Instead of hardcoding the absolute path to the Command Line Tools (CLT) binary, will attempt to resolve the path at the $PATH, or at the Xcode bundle. If none are available, will fallback to the default CLT location. Fixes #986 * gdbserial/gdbserver: Log outgoing executed commands Add logging to capture the executable and associated arguments used in LLDBLaunch and LLDBAttach Related to #986 * gdbserial/gdbserver: Add unit tests for helper function Define unit tests for helper function. Setup each test to temporarily make PATH variable, and file system changes, and subsequently revert them. Related to #986 * gdbserial/gdbserver: Lazily load function Lazily obtain absolute path to avoid increasing load times. Remove flaky tests. Related to #986
-
- 05 4月, 2020 1 次提交
-
-
由 aarzilli 提交于
Adds a library of utility functions to generated breakpoint conditions for next, step and stepout.
-
- 03 4月, 2020 1 次提交
-
-
由 Derek Parker 提交于
Fixes #1310
-
- 01 4月, 2020 4 次提交
-
-
由 aarzilli 提交于
-
由 aarzilli 提交于
The test was always flaky because we can't fully control the state of all goroutines in the target program, Go 1.14's asynchronous preemption exacerbates the problem. See for example: https://travis-ci.com/github/go-delve/delve/jobs/302407282 This commit relaxes the checks made by the test to avoid irrelevante flakiness.
-
由 aarzilli 提交于
Avoids constructing: 1. name of runtime.curg fields while executing parseG 2. the location expression while evaluating any variable. Benchmark before: BenchmarkConditionalBreakpoints-4 1 4953889884 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 4419775128 ns/op Updates #1549
-
由 aarzilli 提交于
Under some circumstances (methods with non-pointer receivers or from embedded fields called through an interface) the compiler will autogenerate wrapper functions. This commit changes next, step and stepout to skip all autogenerated wrappers. Fixes #1908
-
- 31 3月, 2020 1 次提交
-
-
由 Alessandro Arzilli 提交于
Replace the interface type Arch with a struct with the same functionality.
-
- 29 3月, 2020 1 次提交
-
-
由 Derek Parker 提交于
-
- 28 3月, 2020 1 次提交
-
-
由 Derek Parker 提交于
Also cleanup some typos.
-
- 26 3月, 2020 2 次提交
-
-
由 Derek Parker 提交于
-
由 Derek Parker 提交于
-
- 25 3月, 2020 1 次提交
-
-
由 Alessandro Arzilli 提交于
Allows Delve clients to stop a recording midway by sending a Command('halt') request. This is implemented by changing debugger.New to start recording the process on a separate goroutine while holding the processMutex locked. By locking the processMutex we ensure that almost all RPC requests will block until the recording is done, since we can not respond correctly to any of them. API calls that do not require manipulating or examining the target process, such as "IsMulticlient", "SetApiVersion" and "GetState(nowait=true)" will work while we are recording the process. Two other internal changes are made to the API: both GetState and Restart become asynchronous requests, like Command. Restart because this way it can be interrupted by a StopRecording request if the rerecord option is passed. GetState because clients need a call that will block until the recording is compelted and can also be interrupted with a StopRecording. Clients that are uninterested in allowing the user to stop a recording can ignore this change, since eventually they will make a request to Delve that will block until the recording is completed. Clients that wish to support this feature must: 1. call GetState(nowait=false) after connecting to Delve, before any call that would need to manipulate the target process 2. allow the user to send a StopRecording request during the initial GetState call 3. allow the user to send a StopRecording request during any subsequent Restart(rerecord=true) request (if supported). Implements #1747
-
- 24 3月, 2020 2 次提交
-
-
由 Derek Parker 提交于
Reset the timer once we start executing the code paths we actually care to measure, since the setup and continue steps can be relatively expensive. Also, disable recording on benchmarks. This seems less useful, and also cuts out a lot of noise when benchmarks are run.
-
由 Derek Parker 提交于
This patch moves out unrelated types, variables and functions from proc.go into a place where they make more sense.
-
- 21 3月, 2020 2 次提交
-
-
由 Alessandro Arzilli 提交于
When switching to the goroutine stack the stack iterator registers might not have any entry for the BP register, make sure to add it instead of just trying to change it.
-
由 Alessandro Arzilli 提交于
Instead of rescanning debug_info every time we want to read a function (either to find inlined calls or its variables) cache the tree of dwarf.Entry that we would generate and use that. Benchmark before: BenchmarkConditionalBreakpoints-4 1 5164689165 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 4817425836 ns/op Updates #1549
-
- 20 3月, 2020 3 次提交
-
-
由 Derek Parker 提交于
-
由 Alessandro Arzilli 提交于
Add logging for Issue #1927. The bug happens during the call to api.ConvertThread, returning an error will not suffice since ConvertThread will not surface it. Updates #1927
-
由 Alessandro Arzilli 提交于
Inserts a call to ClearAllGCache into stepInstructionOut so that cached goroutine state is not inconsistent after an injected function call.\ Fixes #1925
-
- 19 3月, 2020 3 次提交
-
-
由 Derek Parker 提交于
-
由 chainhelen 提交于
If we call one expression which is the fake method of meanless string, `delve` will panic. Strengthen the inspection of boundary conditions when supporting function calls on non-struct types. Update: #1871
-
由 Derek Parker 提交于
* *: Fix go vet struct complaints * *: Fix struct vet issue on linux * *: Ignore proc/native in go vet check We have to do some unsafe pointer manipulation that will never make go vet happy within the proc/native package. Ignore it for runs of go vet.
-
- 12 3月, 2020 1 次提交
-
-
由 Alessandro Arzilli 提交于
* proc: move defer breakpoint code into a function Moves the code that sets a breakpoint on the first deferred function, used by both next and StepOut, to its function. * proc: implement reverse step/next/stepout When the direction of execution is reversed (on a recording) Step, Next and StepOut will behave similarly to their forward version. However there are some subtle interactions between their behavior, prologue skipping, deferred calls and normal calls. Specifically: - when stepping backwards we need to set a breakpoint on the first instruction after each CALL instruction, once this breakpoint is reached we need to execute a single StepInstruction operation to reverse step into the CALL. - to insure that the prologue is skipped reverse next needs to check if it is on the first instruction after the prologue, and if it is behave like reverse stepout. - there is no reason to set breakpoints on deferred calls when reverse nexting or reverse stepping out, they will never be hit. - reverse step out should generally place its breakpoint on the CALL instruction that created the current stack frame (which will be the CALL instruction immediately preceding the instruction at the return address). - reverse step out needs to treat panic calls and deferreturn calls specially. * service,terminal: implement reverse step, next, stepout
-
- 11 3月, 2020 3 次提交
-
-
由 Alessandro Arzilli 提交于
Benchmark before: BenchmarkConditionalBreakpoints-4 1 7031242832 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 5282482841 ns/op Conditional breakpoint evaluation latency: 0.70ms -> 0.52ms Updates #1549
-
由 Alessandro Arzilli 提交于
* proc,proc/*: move SelectedGoroutine to proc.Target, remove PostInitializationSetup moves SelectedGoroutine, SwitchThread and SwitchGoroutine to proc.Target, merges PostInitializationSetup with NewTarget. * proc,proc/*: add StopReason field to Target Adds a StopReason field to the Target object describing why the target process is currently stopped. This will be useful for the DAP server (which needs to report this reason in one of its requests) as well as making pull request #1785 (reverse step) conformant to the new architecture. * proc: collect NewTarget arguments into a struct
-
由 chainhelen 提交于
Implement debugging function for 386 on linux with reference to AMD64. There are a few remaining problems that need to be solved in another time. 1. The stacktrace of cgo are not exactly as expected. 2. Not implement `core` for now. 3. Not implement `call` for now. Can't not find `runtime·debugCallV1` or similar function in $GOROOT/src/runtime/asm_386.s. Update #20
-
- 10 3月, 2020 1 次提交
-
-
由 Alessandro Arzilli 提交于
* proc/native/linux: only set breakpoints on threads that receive SIGTRAP * proc/native/linux: do not call (*Thread).Stopped inside (*Process).stop (*Thread).Stopped is slow because it needs to open, read and parse a file in /proc, we don't actually need to do that, we can just rely on the value of Thread.os.running. Benchmark before: BenchmarkConditionalBreakpoints-4 1 12476166303 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 10403533675 ns/op Conditional breakpoint evaluation: 1.24ms -> 1ms Updates #1549
-
- 06 3月, 2020 1 次提交
-
-
由 Derek Parker 提交于
-
- 03 3月, 2020 1 次提交
-
-
由 a 提交于
Disables async preemption on macOS Fixes #1905
-
- 01 3月, 2020 1 次提交
-
-
由 Josh Stone 提交于
This change adds `ProcessVmRead` and `ProcessVmWrite` wrappers around the syscalls `process_vm_readv` and `process_vm_writev`, available since Linux 3.2. These follow the same permission model as `ptrace`, but they don't actually require being attached, which means they can be called directly from any thread in the debugger. They also use `iovec` to write entire blocks at once, rather than having to peek/poke each `uintptr`. These wrappers are used in `Thread.ReadMemory` and `WriteMemory`, still falling back to `ptrace` if that fails for any reason. Notably, `process_vm_writev` respects memory protection, so it can't modify read-only memory like `ptrace`. This frequently occurs when writing breakpoints in read-only `.text`, so to avoid a lot of wasted `EFAULT` calls, we only try `process_vm_writev` for larger writes.
-
- 26 2月, 2020 1 次提交
-
-
由 chainhelen 提交于
-
- 25 2月, 2020 3 次提交
-
-
由 Alessandro Arzilli 提交于
Adds an optional scope prefix to the `regs` command which allows printing registers for any stack frame (as long as they were somehow saved). Issue #1838 is not yet to be closed since we are still not recovering the registers of a segfaulting frame. Updates #1838
-
由 Alessandro Arzilli 提交于
As we rearrange the code and the Go compiler changes the error message returned by the compiler on unsupported architectures will change too, making it un-googlable. Since the error message tends to be rather obscure too this regularly confuses newbies. This is an effort to make the error message for unsupported GOOS/GOARCH combinations the same across all unsupported combinations and to make it more user friendly. Directories containing Go source code are supposed to contain a single package. This property happens to be checked by cmd/go itself so it will happen even before the syntax is fully checked and therefore has a high probability of being the first (and only) error message being print. Here we take advantage of this by adding to the pkg/proc/native directory a file with a bad package line that only gets compiled in on unsupported GOOS/GOARCH combinations. At present the error message for compiling Delve on unsupported systems will be: service/debugger/debugger.go:21:2: found packages native (proc.go) and your_operating_system_and_architecture_combination_is_not_supported_by_delve (support_sentinel.go) in $PATH_TO_DELVE/pkg/proc/native
-
由 chainhelen 提交于
Avoid always showing `no G executing on thread 0` when ErrNoGoroutine on g0 stack in GetG.
-
- 21 2月, 2020 1 次提交
-
-
由 Alessandro Arzilli 提交于
Go 1.8 has been out of date for a while and the code to support it is potentially dangerous if a future version of Go removes the runtime types from debug_info and also changes their representation.
-
- 20 2月, 2020 2 次提交
-
-
由 Derek Parker 提交于
Removes the restriction that the DWARF type for the receiver of a method must be a TypeDef. This seems reasonable in practice, but it turns out Go DWARF does not consider ``` type X int ``` to be a typedef. This patch also allows for calling a method where the receiver is not used or passed in, such as: ``` func (_ X) Method() { println("why") } ```
-
由 chainhelen 提交于
Avoid panic if start addr is greater than end addr when disasm.
-
- 18 2月, 2020 1 次提交
-
-
由 ossdev07 提交于
* proc/native: optimize native.status through buffering (#1865) Benchmark before: BenchmarkConditionalBreakpoints-4 1 15649407130 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 14586710018 ns/op Conditional breakpoint evaluation 1.56ms -> 1.45ms Updates #1549 * proc/core: Review Comments Incorporated Signed-off-by: Nossdev07 <ossdev@puresoftware.com> Co-authored-by: NAlessandro Arzilli <alessandro.arzilli@gmail.com>
-