profile
viewpoint
Alessandro Arzilli aarzilli silence is foo

aarzilli/gdlv 715

GUI frontend for Delve

aarzilli/emacs-textobjects 9

vim-like text objects implementation for emacs

aarzilli/debugger-bibliography 5

Annotated debugger implementation bibliography

aarzilli/go-iconv 4

iconv binding for golang

aarzilli/delve 3

Delve is a debugger for the Go programming language.

aarzilli/badnext 2

finds bad pcln associations in go binaries by comparing cfg derived from source code with cfg derived from disassembly

aarzilli/chade 2

Small character encoding debugging utility

aarzilli/emacs-eclim 2

This project brings some of the great eclipse features to emacs developers. It is based on the eclim project, which provides eclipse features for vim.

push eventaarzilli/delve

aarzilli

commit sha 57e5854329481cc51cff5e5cf6f02e0fccf7eba0

proc/*: move Set/Clear Breakpoint methods to Target

view details

push time in 3 days

issue commentgo-delve/delve

dlv debug kube-apiserver the cpu is very high when execute step by step

In any case you should pass --log --log-output=rpc to delve and post the output.

13567436138

comment created time in 4 days

Pull request review commentgo-delve/delve

proc/*: move Set/Clear Breakpoint methods to Target

 func (bpmap *BreakpointMap) Set(addr uint64, kind BreakpointKind, cond ast.Expr, }  // SetWithID creates a breakpoint at addr, with the specified logical ID.-func (bpmap *BreakpointMap) SetWithID(id int, addr uint64, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) {-	bp, err := bpmap.Set(addr, UserBreakpoint, nil, writeBreakpoint)+func (t *Target) setWithID(id int, addr uint64) (*Breakpoint, error) {

How about setBreakpointWithID?

aarzilli

comment created time in 5 days

issue commentgo-delve/delve

dlv debug kube-apiserver the cpu is very high when execute step by step

How did you "remote debug kube-apiserver" exactly? Did you start it with dlv debug or did you run dlv attach? Did this happen as soon as you ran the local headless instance of delve or after you connected to it? How did you connect to it?

13567436138

comment created time in 5 days

issue closedgo-delve/delve

how to debug program that has stdin parameters input?

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.4.0
Build: $Id: 67422e6f7148fa1efa0eac1423ab5594b223d93b $
  1. What version of Go are you using? (go version)?
go version go1.14.2 darwin/amd64
  1. What operating system and processor architecture are you using?
Macbook pro 2015 Intel Core i5
MacOS 10.15.4
  1. What did you do? I can run my project. Input the command
dlv debug -- --DEBUGER=true --CONFIGPATH=/Users/wwts17/Projects/manager-adapter-serv/etc/config.dev.json go run main.go

I try to use dlv debug my program under my project path

dlv debug -- --DEBUGER=true --CONFIGPATH=/Users/wwts17/Projects/manager-adapter-serv/etc/config.dev.json
(dlv) break main.main
Breakpoint 1 set at 0x1aa6c08 for main.main() ./main.go:8
(dlv)
  1. What did you expect to see? exec debug
  2. What did you see instead?
(dlv) break main.main
Breakpoint 1 set at 0x1aa6c08 for main.main() ./main.go:8
(dlv) c
> [unrecovered-panic] runtime.fatalpanic() /usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/panic.go:1189 (hits goroutine(1):1 total:1) (PC: 0x103ac20)
Warning: debugging optimized function
	runtime.curg._panic.arg: interface {}(string) "open : no such file or directory"
  1184:	// fatalpanic implements an unrecoverable panic. It is like fatalthrow, except
  1185:	// that if msgs != nil, fatalpanic also prints panic messages and decrements
  1186:	// runningPanicDefers once main is blocked from exiting.
  1187:	//
  1188:	//go:nosplit
=>1189:	func fatalpanic(msgs *_panic) {
  1190:		pc := getcallerpc()
  1191:		sp := getcallersp()
  1192:		gp := getg()
  1193:		var docrash bool
  1194:		// Switch to the system stack to avoid any stack growth, which
(dlv)
panic: open : no such file or directory

goroutine 1 [running]:
main/common.init.0()
	/Users/wwts17/Projects/manager-adapter-serv/src/main/common/conf_manager.go:62 +0x310
Process 2366 has exited with status 2
(dlv)

closed time in 5 days

wwts17

PR opened go-delve/delve

proc/*: move Set/Clear Breakpoint methods to Target
proc/*: move Set/Clear Breakpoint methods to Target

+75 -148

0 comment

9 changed files

pr created time in 5 days

create barnchaarzilli/delve

branch : bprefa

created branch time in 5 days

pull request commentgo-delve/delve

proc,proc/native: avoid context switches by executing Continue in ptrace thread

The performance improvement is significant (over twice as fast) but it's also awful.

aarzilli

comment created time in 6 days

PR opened go-delve/delve

proc,proc/native: avoid context switches by executing Continue in ptrace thread
proc,proc/native: avoid context switches by executing Continue in ptrace thread

Avoids a lot of context switches while executing Continue by running
inside the ptrace thread.

Benchmark before:

BenchmarkConditionalBreakpoints-4   	       1	3554266510 ns/op

After:

BenchmarkConditionalBreakpoints-4   	       1	1807164143 ns/op

Fixes #1549

+107 -1

0 comment

5 changed files

pr created time in 6 days

create barnchaarzilli/delve

branch : ptracethread

created branch time in 6 days

pull request commentgo-delve/delve

proc: step into unexported runtime funcs when already inside runtime

I would lean against writing a test for this because it would depend on implementation details of the runtime.

aarzilli

comment created time in 6 days

PR opened go-delve/delve

proc: step into unexported runtime funcs when already inside runtime
proc: step into unexported runtime funcs when already inside runtime

Normally we don't step into unexported runtime functions because the
compiler is free to insert them into the code and they are not relevant
to the user, however if we are already stepping through a runtime
function we should let step into work normally and step into other
runtime functions.

+19 -6

0 comment

1 changed file

pr created time in 6 days

create barnchaarzilli/delve

branch : stepintoruntime

created branch time in 6 days

issue commentgo-delve/delve

how to debug program that has stdin parameters input?

All I'm seeing is a panic in your code.

wwts17

comment created time in 6 days

push eventgo-delve/delve

Derek Parker

commit sha 4a9b3419d13abcc850acf80770f5103191d06a1f

*: v1.4.1 (#2059)

view details

push time in 9 days

PR merged go-delve/delve

*: v1.4.1

Bump version to v1.4.1.

There's a good amount of fixes and optimizations in this release and a some new features as well.

I'm marking the date as tomorrow because that's likely when this will get merged. Also removing some out of date text from the top of the CHANGELOG.

+33 -2

1 comment

2 changed files

derekparker

pr closed time in 9 days

issue closedgo-delve/delve

[bug-report]Failed to set variable

  • dlv
> dlv version
Delve Debugger
Version: 1.4.0
Build: $Id: 67422e6f7148fa1efa0eac1423ab5594b223d93b $
  • go
> go version
go version go1.12.17 windows/amd64
  • windows 64

I'm using dlv to debug go in vscode, It's ok to stop on the break point, but when I want to see a string value, it report error:

Failed to set variable - literal string can not be allocated because function calls are not allowed without using 'call'
Last known immediate stacktrace (goroutine id 5):
	G:/go_workspace/GOPATH/src/model_convert/model-proto3_test.go:50
		model_convert.TestGoModelToProto2
	E:/go1.12/src/testing/testing.go:865
		testing.tRunner
	E:/go1.12/src/runtime/asm_amd64.s:1337
		runtime.goexit

Failed to set variable - literal string can not be allocated because function calls are not allowed without using 'call'
Last known immediate stacktrace (goroutine id 5):
	G:/go_workspace/GOPATH/src/model_convert/model-proto3_test.go:50
		model_convert.TestGoModelToProto2
	E:/go1.12/src/testing/testing.go:865
		testing.tRunner
	E:/go1.12/src/runtime/asm_amd64.s:1337
		runtime.goexit

Here is my launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${workspaceFolder}",
            "env": {
                "GOPATH":"G:\\go_workspace\\GOPATH"
            },
            "args": [],
            "showLog": true
        }
    ]
}

closed time in 9 days

fwhezfwhez

issue commentgo-delve/delve

[bug-report]Failed to set variable

Strings can only be set by injecting a function call, this should be reported to vscode-go.

fwhezfwhez

comment created time in 9 days

Pull request review commentgo-delve/delve

service/dap: Add buildFlags error checking and tests in launch requests

 const (  // BuildFixture will compile the fixture 'name' using the provided build flags. func BuildFixture(name string, flags BuildFlags) Fixture {+	return BuildFixtureWithFlags(name, flags, "")+}++// BuildFixtureWithFlags will compile the fixture 'name' using the provided+// a la carte build flags as well as additional freeform build flags specified as+// a string to be passed as-is to the 'go' command.+func BuildFixtureWithFlags(name string, flags BuildFlags, moreflags string) Fixture {

Do you plan to use this in the future?

polinasok

comment created time in 13 days

push eventaarzilli/delve

Alessandro Arzilli

commit sha bc299a7a30e34996bce67eb2b0145fdcb507e49d

tests: properly check if cgo is enabled for cgo related tests (#2010)

view details

Derek Parker

commit sha 682ee7ffd0da1e3f794b710d77340413c04d40ad

service/debugger: Rename processMutex to targetMutex Fixes a long standing dangling TODO item.

view details

aarzilli

commit sha 55543e2570f2ac2b489f181ac9e8d8b158d0f6e7

Makefile: reduce test timeout when TRAVIS==true Reduces test timeout by one minute so that Go will timeout before Travis-CI and report useful informations about the hang.

view details

aarzilli

commit sha f9b6c43910fbc7e49e46a96cd53a4261e4498b16

proc/native: report trapWaitInternal errors in nativeProcess.stop The process could quit while we are inside stop, we should report the error otherwise the following code will try to send on the closed ptrace channel. Fixes a sporadic error in TestIssue1101.

view details

aarzilli

commit sha 9c24b56f62caffbd072e721b1edd13b1bdb3d621

proc/tests: disable TestIssue414 on linux/386/PIE This test will occasionally hang in SetBreakpoint/WriteMemory

view details

chainhelen

commit sha 37bee98a8821843314b561bc6ab328dfff2aad1b

pkg/config: add `disassemble-flavor` option for config Allow user to specify output syntax flavor of assembly in the disassemble command. Close #415

view details

Min Zhou

commit sha 3e04ad0fada0c3ab57caf58bc024e4c0f9a3e01a

proc: Find executable should follow symbol links. On linux platform, we simply treated `/proc/$pid/exe` as the executable of targeting process when doing `dlv attach`. The `/proc/$pid/exe` is a symbol link of the real executable file. Delve couldn't find the corrsponding external debug file based on the symbol link: ``` could not attach to pid $pid: could not open debug info ``` The fix is to evaluate the symbol links to the actual executable path.

view details

aarzilli

commit sha 6102c31d6d47a9485db150e83bd78d33465887b5

terminal: clarify Ctrl-C options with multiclient servers Fixes #2028

view details

aarzilli

commit sha bb2525a7d59be85bd5e275c1b91a2732db626dd5

proc: keep debugger state consistent if callInjectionProtocol fails pickCurrentThread should always run.

view details

aarzilli

commit sha cf37512aed935c6ce497ca14440d5c80231f0e8a

proc: move g.stackhi/g.stacklo to a struct Mirroring the way this is implemented in the Go runtime and introducing a type that will be useful to support the call injection changes in Go 1.15

view details

aarzilli

commit sha c078223d56d450f4563abe697765b29c37d22d50

proc: use cached packageVars in proc.(*EvalScope).PackageVariables

view details

aarzilli

commit sha 96890bbe1e339267daef61b46c97f1e1c6bfb374

dwarf/op: return register values when they are the only piece When there is a single piece and it's a register value just return it. This is important for clang compiled programs which will use DW_OP_regN to specify the value of the frame base.

view details

aarzilli

commit sha 8f5df19948f801fdc4404f2e2c0d8e57db521fe6

proc: fix findCompileUnitForOffset when plugins are used Splits the compileUnits slice between images so that we can search for an offset inside the debug info of a specific image file.

view details

polinasok

commit sha 2f295f310d543f0d155ca1ea9a8a1e1288afd7b6

service/dap: Add error handlers for unsupported and not-yet-supported requests (#1918) * Add no-op handlers for unsupported requests * Fix whitespace * Add couple of missing unsupported requests * More comments * Separate errors for unsupported and not-yet-implemented requests. * Fix go.mod/sum dependencies Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>

view details

colinnewell

commit sha 99a0468b9bec9adeff8078701fa1e78dee019cf2

cmd,Documentation: Add some simple examples for the list command to the help (#2034)

view details

chainhelen

commit sha 5b7d764b153e6fb0a7f52eee369c6c77041e3a16

gdbserial/gdbserver: optimize the search of debugserver binary (#2005) Unexport `GetDebugServerAbsolutePath` and avoid unnecessary repeated calls. Remove `os.Stat` because `Exec.LookPath` has already used `os.Stat`.And Fix some comments.

view details

Alessandro Arzilli

commit sha 0f83fa66f5ebc17be9349ac51951f78454a1269b

cmd/dlv: make core command limitations more prominent (#2031) Fixes #2026

view details

Alessandro Arzilli

commit sha f559c3c421dcb0777896114673f2f270a2895290

gobuild: pass-through stdout to 'go' command invocation (#2044) When trying to compile tests in a package that does not contain tests 'go' emits an error message on stdout instead of stderr. Let the 'go' command write to stdout too. Fixes #2042

view details

Anders Kaare

commit sha 71a460fc0fe578cc81dab152e3dd2515a9304da1

config: add option for printfile() line count (#2043) The option is "source-list-line-count". It defaults to 5, which was previously hardcoded in printfile(), but now you can change it dynamically, for instance: $ config source-list-line-count 20 $ list

view details

polinasok

commit sha f92afb9c17c49b0b585af4d95d84bcfc1fceef14

service/dap: Adds launch request support for program args (#2040) * Adds launch request support for program args * Combine types of function parameters Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>

view details

push time in 13 days

PR opened go-delve/delve

gdbserial: ensure registers are loaded in SetDX/SetSP/SetPC
gdbserial: ensure registers are loaded in SetDX/SetSP/SetPC

These methods only work if registers have been loaded once after the
last resume, there's probably no code path that calls SetXX before
Thread.Registers but lets make sure it can't happen anyway.

+3 -0

0 comment

1 changed file

pr created time in 16 days

create barnchaarzilli/delve

branch : fixsetreg

created branch time in 16 days

Pull request review commentgo-delve/delve

proc: better support for C pointers

 func readStringValue(mem MemoryReadWriter, addr uintptr, strlen int64, cfg LoadC 		return "", fmt.Errorf("could not read string at %#v due to %s", addr, err) 	} -	retstr := *(*string)(unsafe.Pointer(&val))+	//retstr := *(*string)(unsafe.Pointer(&val)) -	return retstr, nil+	return string(val), nil+}++func readCStringValue(mem MemoryReadWriter, addr uintptr, cfg LoadConfig) (string, bool, error) {+	done := false+	buf := make([]byte, 1)

Done. It's a bit complicated because of pagefaults.

aarzilli

comment created time in 17 days

Pull request review commentgo-delve/delve

proc: better support for C pointers

 func readStringValue(mem MemoryReadWriter, addr uintptr, strlen int64, cfg LoadC 		return "", fmt.Errorf("could not read string at %#v due to %s", addr, err) 	} -	retstr := *(*string)(unsafe.Pointer(&val))+	//retstr := *(*string)(unsafe.Pointer(&val))

Yes.

aarzilli

comment created time in 17 days

push eventaarzilli/delve

aarzilli

commit sha fe36389da0b7edfeb6e90b77e13c3c788f72f98f

proc: better support for C pointers - treat C pointers as arrays - print 'char *' variables as strings

view details

push time in 17 days

push eventaarzilli/delve

aarzilli

commit sha 286e41846ac31fc47d47fb500a0f4f979b399350

vendor: remove github.com/pkg/profile dependency It is only used in benchmarks and 'go test' now has command line options to enable profiling as appropriate (but maybe it didn't in 2014).

view details

push time in 17 days

push eventaarzilli/delve

aarzilli

commit sha 2232f7159c1c160b64a4e66af5f24018f8cf75c8

vendor: remove github.com/pkg/profile dependency It is only used in benchmarks and 'go test' now has command line options to enable profiling as appropriate (but maybe it didn't in 2014).

view details

push time in 17 days

PR opened go-delve/delve

vendor: remove github.com/pkg/profile dependency
vendor: remove github.com/pkg/profile dependency

It is only used in benchmarks and 'go test' now has command line
options to enable profiling as appropriate (but maybe it didn't in
2014).\

+0 -384

0 comment

14 changed files

pr created time in 17 days

push eventaarzilli/delve

aarzilli

commit sha c83296524b911ace48bbcae3896fe38a9d30df4a

vendor: remove github.com/pkg/profile dependency It is only used in benchmarks and 'go test' now has command line options to enable profiling as appropriate (but maybe it didn't in 2014).\

view details

push time in 17 days

create barnchaarzilli/delve

branch : noprofile

created branch time in 17 days

push eventaarzilli/delve

aarzilli

commit sha ad557bb87b14cb3e438b3b86761f55398d1c83e5

proc: better support for C pointers - treat C pointers as arrays - print 'char *' variables as strings

view details

push time in 17 days

push eventaarzilli/delve

colinnewell

commit sha 99a0468b9bec9adeff8078701fa1e78dee019cf2

cmd,Documentation: Add some simple examples for the list command to the help (#2034)

view details

chainhelen

commit sha 5b7d764b153e6fb0a7f52eee369c6c77041e3a16

gdbserial/gdbserver: optimize the search of debugserver binary (#2005) Unexport `GetDebugServerAbsolutePath` and avoid unnecessary repeated calls. Remove `os.Stat` because `Exec.LookPath` has already used `os.Stat`.And Fix some comments.

view details

Alessandro Arzilli

commit sha 0f83fa66f5ebc17be9349ac51951f78454a1269b

cmd/dlv: make core command limitations more prominent (#2031) Fixes #2026

view details

Alessandro Arzilli

commit sha f559c3c421dcb0777896114673f2f270a2895290

gobuild: pass-through stdout to 'go' command invocation (#2044) When trying to compile tests in a package that does not contain tests 'go' emits an error message on stdout instead of stderr. Let the 'go' command write to stdout too. Fixes #2042

view details

Anders Kaare

commit sha 71a460fc0fe578cc81dab152e3dd2515a9304da1

config: add option for printfile() line count (#2043) The option is "source-list-line-count". It defaults to 5, which was previously hardcoded in printfile(), but now you can change it dynamically, for instance: $ config source-list-line-count 20 $ list

view details

polinasok

commit sha f92afb9c17c49b0b585af4d95d84bcfc1fceef14

service/dap: Adds launch request support for program args (#2040) * Adds launch request support for program args * Combine types of function parameters Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>

view details

Alessandro Arzilli

commit sha a33be4466fda916604c638b1ceffd6bd10521f86

vendor: update logrus dependency (#2048) Fixes #2037

view details

Derek Parker

commit sha f96663a243ac3d844a3e43731d7eaf5b1bf3dfab

cmd/dlv: Fix trace output (#2038) * cmd/dlv,debugger: Improve dlv trace and trace command output This patch improves the `dlv trace` subcommand output by reducing the noise that is generated and providing clearer more concise information. Also adds new tests closing a gap in our testing (we previously never really tested this subcommand). This patch also fixes the `dlv trace` REPL command to behave like the subcommand in certain situations. If the tracepoint is for a function, we now show function arguements and return values properly. Also makes the overall output of the trace subcommand clearer. Fixes #2027

view details

Alessandro Arzilli

commit sha 200994bc8f6108cc441fdf110ddb44e0184c1fe0

proc/*: only load floating point registers when needed (#1981) Changes implementations of proc.Registers interface and the op.DwarfRegisters struct so that floating point registers can be loaded only when they are needed. Removes the floatingPoint parameter from proc.Thread.Registers. This accomplishes three things: 1. it simplifies the proc.Thread.Registers interface 2. it makes it impossible to accidentally create a broken set of saved registers or of op.DwarfRegisters by accidentally calling Registers(false) 3. it improves general performance of Delve by avoiding to load floating point registers as much as possible Floating point registers are loaded under two circumstances: 1. When the Slice method is called with floatingPoint == true 2. When the Copy method is called Benchmark before: BenchmarkConditionalBreakpoints-4 1 4327350142 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 3852642917 ns/op Updates #1549

view details

aarzilli

commit sha d55ed9f910e7560cf625d91bf3c4ab80d56a61c3

proc: better support for C pointers - treat C pointers as arrays - print 'char *' variables as strings

view details

push time in 17 days

push eventgo-delve/delve

chainhelen

commit sha e28e3d30d26ab7ade78871dd7cd4a48850bc15f7

[WIP] pkg/proc: avoid target process leaks. (#2018) * pkg/proc: avoid target process leaks. Target process should exit when dlv launch failed. Fix #2017.

view details

push time in 17 days

PR merged go-delve/delve

[WIP] pkg/proc: avoid target process leaks.

Target process should exit when dlv launch failed.

Fix #2017.

+82 -12

14 comments

5 changed files

chainhelen

pr closed time in 17 days

issue closedgo-delve/delve

`dlv exec` leave target process running that was not successfully launch caused by missing debug info

  1. What version of Delve are you using (dlv version)? Delve Debugger Version: 1.4.0 Build: $Id: 67422e6f7148fa1efa0eac1423ab5594b223d93b $

  2. What version of Go are you using? (go version)? go version go1.13.5 linux/amd64

  3. What operating system and processor architecture are you using? linux/amd64

  4. What did you do? dlv exec a stripped binary.

  5. What did you expect to see? dlv exit

  6. What did you see instead? dlv exit with error message could not launch process: could not open debug info but leaving the target process running.

closed time in 17 days

qingyunha

issue closedgo-delve/delve

Is it possible to run a single test by name?

  1. What version of Delve are you using (dlv version)? Delve Debugger Version: 1.4.0 Build: $Id: 67422e6f7148fa1efa0eac1423ab5594b223d93b $

  2. What version of Go are you using? (go version)? go version go1.14 darwin/amd64

I want to run a single test by name (like go test ./... -run TestGetBulkUserData. Is this possible in Delve? A post on SO implies that it is but that command causes an error. I don't see any documentation that answers this.

Closest I got was dlv test --listen=:20000 -- -test.run TestGetBulkUserData, which resulted in:

Type 'help' for list of commands.
(dlv) exit

closed time in 17 days

jcollum

issue commentgo-delve/delve

Is it possible to run a single test by name?

dlv test package -- -test.run TestName

jcollum

comment created time in 17 days

pull request commentgo-delve/delve

terminal/command: Add 'reload' command

I'm sorry I forgot to tell you this yesterday but there is a conflict between your PR and something that has already been merged into master that needs to be solved. You need to do a git rebase.

alexsaezm

comment created time in 17 days

issue commentgo-delve/delve

Function call injection failures on Travis-CI

That error is actually very different, it's coming from a different backend. We should use a different issue for this.

  1. is this error systematic or sporadic?
  2. I've never seen it locally or on Travis-CI so it must be something influenced by kernel version or virtualization environment
  3. The code that's producing that error is pkg/proc/native/threads_linux_amd64.go, the first step would be to decorate restoreRegistersErr to figure out which of the three syscalls is returning EFAULT.

Looking at that function and its sister ptraceGetRegset (in ptrace_linux_amd64.go) I would guess that it's PTRACE_SETFPREGS, but it would be a systematic error, not something that happens once in a while.

aarzilli

comment created time in 18 days

pull request commentgo-delve/delve

pkg/proc: avoid target process leaks.

Your new TestChildProcessExitWhenNoDebugInfo seems to fail systematically on freebsd: https://cirrus-ci.com/task/5833222820986880?command=test

Personally I'm ok with just disabling it on that GOOS.

chainhelen

comment created time in 18 days

Pull request review commentgo-delve/delve

terminal/command: Add 'reload' command

 func (d *Debugger) Restart(rerecord bool, pos string, resetArgs bool, newArgs [] 	} 	var p *proc.Target 	var err error++	if rebuild {+		// We cannot build processes that we don't know how to build. If+		// d.config.Kind is different from ExecutingGeneratedFile that means we+		// didn't build the binary and we are just running it+		if d.config.Kind == ExecutingExistingFile {+			err = gobuild.GoTestBuild(d.processArgs[0], d.config.Packages, d.config.BuildFlags)

This is still wrong:

ExecutingExistingFile, ExecutingOther → it can't be rebuilt at all (either an separately built executable file or a core dump/recording) ExecutingGeneratedFile → it can be rebuilt by GoBuild ExecutingGeneratedTest → it can be rebuilt by GoTestBuild

it doesn't make sense to call GoTestBuild on ExecutingExistingFile and it doesn't make sense to call GoBuild on anything other than ExecutingGeneratedFile.

alexsaezm

comment created time in 18 days

push eventgo-delve/delve

Derek Parker

commit sha f96663a243ac3d844a3e43731d7eaf5b1bf3dfab

cmd/dlv: Fix trace output (#2038) * cmd/dlv,debugger: Improve dlv trace and trace command output This patch improves the `dlv trace` subcommand output by reducing the noise that is generated and providing clearer more concise information. Also adds new tests closing a gap in our testing (we previously never really tested this subcommand). This patch also fixes the `dlv trace` REPL command to behave like the subcommand in certain situations. If the tracepoint is for a function, we now show function arguements and return values properly. Also makes the overall output of the trace subcommand clearer. Fixes #2027

view details

push time in 18 days

issue closedgo-delve/delve

dlv trace duplicate entries (function calls)

  1. What version of Delve are you using (dlv version)?

both master and 1.4.0 ( 37bee98a8821843314b561bc6ab328dfff2aad1b )

  1. What version of Go are you using? (go version)?

go version go1.14.2 linux/amd64

  1. What operating system and processor architecture are you using?

arch linux x64

  1. What did you do?

dlv trace z.go main.

plus: dlv debug z.go

then:

  1. trace main.main
  2. trace main.f
  3. c
  1. What did you expect to see?

main.main() main.f()

each only called once, instead of:

main.main() main.f() main.f() main.main()

  1. What did you see instead?

runtime.main.func1() /usr/lib/go/src/runtime/proc.go:133 (hits goroutine(1):1 total:1) (PC: 0x45812f) Warning: debugging optimized function runtime.main.func1() /usr/lib/go/src/runtime/proc.go:135 (hits goroutine(1):1 total:1) (PC: 0x45815f) Warning: debugging optimized function main() main.main() ./z.go:7 (hits goroutine(1):1 total:1) (PC: 0x45fc9f) f() main.f() ./z.go:3 (hits goroutine(1):1 total:1) (PC: 0x45fc3f) main.f() ./z.go:5 (hits goroutine(1):1 total:1) (PC: 0x45fc79) main.main() ./z.go:10 (hits goroutine(1):1 total:1) (PC: 0x45fcde) Process 436778 has exited with status 0

z.go content:

package main

func f() {
        println("f()")
}

func main() {
        println("main()")
        f()
}

if i run in interactively in the debugger (dlv debug), then it works correctly (no duplicates at the end of function calls):

$ dlv debug z.go 
Type 'help' for list of commands.
(dlv) trace main.main
Tracepoint 1 set at 0x45fc9f for main.main() ./z.go:7
(dlv) trace main.f
Tracepoint 2 set at 0x45fc3f for main.f() ./z.go:3
(dlv) c
main()
> main.main() ./z.go:7 (hits goroutine(1):1 total:1) (PC: 0x45fc9f)
f()
> main.f() ./z.go:3 (hits goroutine(1):1 total:1) (PC: 0x45fc3f)
Process 436873 has exited with status 0

other code works in a similar way: each function is called twice (second time with "incorrect" location, just somewhere at the end of the actual call). library functions and external code is also broken, and i couldn't fix it

i can send more logs, for instance wrapper calls from go-gl etc, they all have dupes i tried to disable GC but it didn't help

closed time in 18 days

zultu

PR merged go-delve/delve

cmd/dlv: Fix trace output

This patch improves the dlv trace subcommand output by reducing the noise that is generated and providing clearer more concise information.

Also adds new tests closing a gap in our testing (we previously never really tested this subcommand).

This patch also fixes the dlv trace REPL command to behave like the subcommand in certain situations. If the tracepoint is for a function, we now show function arguements and return values properly.

Also makes the overall output of the trace subcommand clearer.

+374 -117

1 comment

11 changed files

derekparker

pr closed time in 18 days

Pull request review commentgo-delve/delve

Only load floating point registers when needed

 func (regs *DwarfRegisters) Bytes(idx uint64) []byte {  // Reg returns register idx or nil if the register is not defined. func (regs *DwarfRegisters) Reg(idx uint64) *DwarfRegister {-	if idx >= uint64(len(regs.Regs)) {-		return nil+	if idx >= uint64(len(regs.regs)) {+		if regs.loadMoreCallback != nil {

Done.

aarzilli

comment created time in 19 days

Pull request review commentgo-delve/delve

Only load floating point registers when needed

 func (regs *DwarfRegisters) BP() uint64 {  // AddReg adds register idx to regs. func (regs *DwarfRegisters) AddReg(idx uint64, reg *DwarfRegister) {-	if idx >= uint64(len(regs.Regs)) {+	if idx >= uint64(len(regs.regs)) { 		newRegs := make([]*DwarfRegister, idx+1)-		copy(newRegs, regs.Regs)-		regs.Regs = newRegs+		copy(newRegs, regs.regs)+		regs.regs = newRegs+	}+	regs.regs[idx] = reg+}++// ClearRegisters clears all registers except for PC, SP and BP+func (regs *DwarfRegisters) ClearRegisters() {

General purpose registers usually refers to rax, rbx, etc... this cleans all of them (including xmm, etc) except for PC, SP and BP. It's like this because the only place we need this is in the function call protocol.

However, you are right, this is pretty weird and ugly and I've thought of a way to do it better.

aarzilli

comment created time in 19 days

Pull request review commentgo-delve/delve

Only load floating point registers when needed

 func (regs *DwarfRegisters) Bytes(idx uint64) []byte {  // Reg returns register idx or nil if the register is not defined. func (regs *DwarfRegisters) Reg(idx uint64) *DwarfRegister {-	if idx >= uint64(len(regs.Regs)) {-		return nil+	if idx >= uint64(len(regs.regs)) {+		if regs.loadMoreCallback != nil {+			regs.loadMoreCallback()

Done, see what you think.

aarzilli

comment created time in 19 days

Pull request review commentgo-delve/delve

Only load floating point registers when needed

 type DwarfRegisters struct { 	CFA       int64 	FrameBase int64 	ObjBase   int64-	Regs      []*DwarfRegister+	regs      []*DwarfRegister  	ByteOrder binary.ByteOrder 	PCRegNum  uint64 	SPRegNum  uint64 	BPRegNum  uint64 	LRRegNum  uint64++	FloatLoadError   error // error produced when loading floating point registers+	loadMoreCallback func() }  type DwarfRegister struct { 	Uint64Val uint64 	Bytes     []byte } +// NewDwarfRegisters returns a new DwarfRegisters object.+func NewDwarfRegisters(staticBase uint64, regs []*DwarfRegister, byteOrder binary.ByteOrder, pcRegNum, spRegNum, bpRegNum, lrRegNum uint64) *DwarfRegisters {

I unexported the Regs field so that consumers of DwarfRegisters can't access it directly and have to go through the appropriate methods (that will call loadMoreCallback when needed). Philosophical reasons aside, this also made sure that I converted all accesses to Regs. However now users of DwarfRegisters can't instantiate it because they can't assign to regs.

aarzilli

comment created time in 19 days

push eventaarzilli/delve

colinnewell

commit sha 99a0468b9bec9adeff8078701fa1e78dee019cf2

cmd,Documentation: Add some simple examples for the list command to the help (#2034)

view details

chainhelen

commit sha 5b7d764b153e6fb0a7f52eee369c6c77041e3a16

gdbserial/gdbserver: optimize the search of debugserver binary (#2005) Unexport `GetDebugServerAbsolutePath` and avoid unnecessary repeated calls. Remove `os.Stat` because `Exec.LookPath` has already used `os.Stat`.And Fix some comments.

view details

Alessandro Arzilli

commit sha 0f83fa66f5ebc17be9349ac51951f78454a1269b

cmd/dlv: make core command limitations more prominent (#2031) Fixes #2026

view details

Alessandro Arzilli

commit sha f559c3c421dcb0777896114673f2f270a2895290

gobuild: pass-through stdout to 'go' command invocation (#2044) When trying to compile tests in a package that does not contain tests 'go' emits an error message on stdout instead of stderr. Let the 'go' command write to stdout too. Fixes #2042

view details

Anders Kaare

commit sha 71a460fc0fe578cc81dab152e3dd2515a9304da1

config: add option for printfile() line count (#2043) The option is "source-list-line-count". It defaults to 5, which was previously hardcoded in printfile(), but now you can change it dynamically, for instance: $ config source-list-line-count 20 $ list

view details

polinasok

commit sha f92afb9c17c49b0b585af4d95d84bcfc1fceef14

service/dap: Adds launch request support for program args (#2040) * Adds launch request support for program args * Combine types of function parameters Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>

view details

Alessandro Arzilli

commit sha a33be4466fda916604c638b1ceffd6bd10521f86

vendor: update logrus dependency (#2048) Fixes #2037

view details

aarzilli

commit sha 3ba5faf87ad29027b3a55f44b57ceea7fdc2ac7c

proc/*: only load floating point registers when needed Changes implementations of proc.Registers interface and the op.DwarfRegisters struct so that floating point registers can be loaded only when they are needed. Removes the floatingPoint parameter from proc.Thread.Registers. This accomplishes three things: 1. it simplifies the proc.Thread.Registers interface 2. it makes it impossible to accidentally create a broken set of saved registers or of op.DwarfRegisters by accidentally calling Registers(false) 3. it improves general performance of Delve by avoiding to load floating point registers as much as possible Floating point registers are loaded under two circumstances: 1. When the Slice method is called with floatingPoint == true 2. When the Copy method is called Benchmark before: BenchmarkConditionalBreakpoints-4 1 4327350142 ns/op Benchmark after: BenchmarkConditionalBreakpoints-4 1 3852642917 ns/op Updates #1549

view details

push time in 19 days

push eventaarzilli/gdlv

a

commit sha 6a90a67e486cbfcee94e66382330773f10e1f5cc

miscellaneous improvements to disassembly view - show arguments in a different column - show unreachable instructions as a lighter color - highlight jump targets on hover - jump to jump targets on click

view details

push time in 20 days

pull request commentgo-delve/delve

*: Remove dependency on logrus

@qingyunha that's also acceptable #2048

aarzilli

comment created time in 20 days

PR opened go-delve/delve

vendor: update logrus dependency
vendor: update logrus dependency

Fixes #2037

+1232 -1842

0 comment

47 changed files

pr created time in 20 days

create barnchaarzilli/delve

branch : logrusupdate

created branch time in 20 days

push eventaarzilli/yacco

Alessandro Arzilli

commit sha 33459303e2e3b497e5e4aecd40fcf9c9bc1782f3

Create LICENSE

view details

push time in 20 days

pull request commentaarzilli/yacco

clipboard: fix error handling

Thanks.

d-tsuji

comment created time in 20 days

push eventaarzilli/yacco

d-tsuji

commit sha 254f9a98d1d505348446b01c1572e074b3b2eb18

clipboard: fix error handling

view details

push time in 20 days

PR merged aarzilli/yacco

clipboard: fix error handling

It is a bug fix that does not get the error to check. Or is this method of checking intended?

+2 -1

0 comment

1 changed file

d-tsuji

pr closed time in 20 days

issue closedgo-delve/delve

Question: Is it possible to break on unhandled exceptions in Delve?

Is it possible to break on unhandled exceptions in Delve? How?

closed time in 20 days

siddjain

issue commentgo-delve/delve

Question: Is it possible to break on unhandled exceptions in Delve?

What @chainhelen said.

siddjain

comment created time in 20 days

issue commentgolang/go

cmd/compile: constant inlining happens even when disabling inlining and optimizations

You're right, I was confusing this with a different issue.

dlsniper

comment created time in 23 days

issue closedgo-delve/delve

rewind Command failed: command not available

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?
$ dlv version
Delve Debugger
Version: 1.3.2
Build: $Id: 569ccbd514fc47c8b4c521b142556867ec5e6917 $
  1. What version of Go are you using? (go version)?
$ go version
go version go1.13.3 darwin/amd64
  1. What operating system and processor architecture are you using?
$ uname -a
Darwin WITSC02X6385JGH 18.7.0 Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64
  1. What did you do?

I tried to run the rewind command as documented in https://github.com/go-delve/delve/tree/v1.3.2/Documentation/cli#rewind

  1. What did you expect to see?

Run backwards until breakpoint or program termination.

  1. What did you see instead?
(dlv) rewind
Command failed: command not available

closed time in 23 days

siddjain

issue commentgo-delve/delve

rewind Command failed: command not available

What @dlsniper and @chainhelen said.

siddjain

comment created time in 23 days

issue closedgo-delve/delve

Question: How to prevent the binary file __debug_bin from getting deleted when dlv exits?

When dlv exits it auto-deletes the compiled binary. How can I tell it not to delete the compiled binary - for example, I would like to re-use it for another session.

closed time in 23 days

siddjain

issue commentgo-delve/delve

Question: How to prevent the binary file __debug_bin from getting deleted when dlv exits?

Build it with go and -gcflags="all=-N -l" then debug with dlv exec.

siddjain

comment created time in 23 days

issue commentgolang/go

cmd/compile: constant inlining happens even when disabling inlining and optimizations

@kzhui125 that doesn't have anything to do with this issue and should be reported to GoLand.

dlsniper

comment created time in 23 days

PR opened go-delve/delve

gobuild: pass-through stdout to 'go' command invocation
gobuild: pass-through stdout to 'go' command invocation

When trying to compile tests in a package that does not contain tests
'go' emits an error message on stdout instead of stderr. Let the 'go'
command write to stdout too.

Fixes #2042

+1 -0

0 comment

1 changed file

pr created time in 24 days

issue commentgo-delve/delve

dlv test fails on macOS with "no such file debug.test"

Would it helped if I opened a clean issue on that?

Not necessary.

deitch

comment created time in 24 days

create barnchaarzilli/delve

branch : go-passthrough-stdout

created branch time in 24 days

issue commentgo-delve/delve

dlv test fails on macOS with "no such file debug.test"

You know, one could argue that go test -c should os.Exit(1) and print an error to stderr instead of pretending the -c didn't exist.

deitch

comment created time in 24 days

issue commentgo-delve/delve

dlv test fails on macOS with "no such file debug.test"

The tests are built by GoTestBuild in pkg/gobuild/gobuild which calls gocommand. I see that we are passing Stderr through but that probably doesn't show up because it's on Stdout. Maybe we should pass through Stdout too.

deitch

comment created time in 24 days

Pull request review commentgo-delve/delve

Highlight printed go code syntax on CLI

 type Config struct { 	// expression for its argument. 	ShowLocationExpr bool `yaml:"show-location-expr"` -	// Source list line-number color (3/4 bit color codes as defined-	// here: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)-	SourceListLineColor int `yaml:"source-list-line-color"`+	// Style to be used to highlight source code as defined+	// here: https://godoc.org/github.com/alecthomas/chroma#Style+	SourceCodeStyle string `yaml:"source-code-template"`

Having the ability to specify the base color for the source code was a feature added by someone. I don't use it but I think they probably liked it and I would rather not remove it. I'm not sure how the themes work here, but it seems moot given that there is only one.

bulentkazanci

comment created time in 24 days

Pull request review commentgo-delve/delve

Highlight printed go code syntax on CLI

 func (t *Term) Run() (int, error) { }  // Println prints a line to the terminal.-func (t *Term) Println(prefix, str string) {-	if !t.dumb {-		terminalColorEscapeCode := fmt.Sprintf(terminalHighlightEscapeCode, t.conf.SourceListLineColor)-		prefix = fmt.Sprintf("%s%s%s", terminalColorEscapeCode, prefix, terminalResetEscapeCode)-	}-	fmt.Fprintf(t.stdout, "%s%s\n", prefix, str)+func (t *Term) Println(str string) {+	fmt.Fprintf(t.stdout, "%s\n", str)+}++func (t *Term) PrintHighlightedCode(code string) error {+	err := beni.Highlight(strings.NewReader(code), t.stdout, "Go", t.conf.SourceCodeStyle, "Terminal256")

I don't think you can call this with a chunk of a file and expect it to work, the first line that we print could be inside a comment, for example.

bulentkazanci

comment created time in 24 days

Pull request review commentgo-delve/delve

Highlight printed go code syntax on CLI

 type Config struct { 	// expression for its argument. 	ShowLocationExpr bool `yaml:"show-location-expr"` -	// Source list line-number color (3/4 bit color codes as defined-	// here: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)-	SourceListLineColor int `yaml:"source-list-line-color"`+	// Style to be used to highlight source code as defined+	// here: https://godoc.org/github.com/alecthomas/chroma#Style

I presume the url needs to be changed.

bulentkazanci

comment created time in 24 days

issue commentgo-delve/delve

dlv test fails on macOS with "no such file debug.test"

what happens if you do go test -c -o debug.test .? Does it create a debug.test file?

deitch

comment created time in 24 days

pull request commentgo-delve/delve

*: Remove dependency on logrus

I think 3000 lines of code is a bit much for a logging library. The replacement does almost nothing but it's the almost nothing that we are using. If more features of logrus are needed in the future we can reevaluate its inclusion easily since the impact of this outside of logflags is pretty much nothing.

aarzilli

comment created time in 25 days

push eventaarzilli/delve

aarzilli

commit sha a6af4cc2aa25afe6fee2b7422a032e27823c04a9

*: Remove dependency on logrus We use logrus as a thin layer around fmt.Fprintf, however it introduces a large number of dependencies, including: * two different testing frameworks (testify, ginkgo) * bindings to the application monitoring service "airbrake" * an implementation of the ssh protocol * the entirety of golang.org/x/crypto This commit replace logrus with a copy of the 50 lines of logrus we actually use. Fixes #2037

view details

push time in 25 days

PR opened go-delve/delve

*: Remove dependency on logrus
*: Remove dependency on logrus

We use logrus as a thin layer around fmt.Fprintf, however it introduces
a large number of dependencies, including:

* two different testing frameworks (testify, ginkgo)
* bindings to the application monitoring service "airbrake"
* an implementation of the ssh protocol
* the entirety of golang.org/x/crypto

This commit replace logrus with a copy of the 50 lines of logrus we
actually use.

Fixes #2037

+114 -3688

0 comment

43 changed files

pr created time in 25 days

push eventaarzilli/delve

aarzilli

commit sha 34effb710194483ff61523ecb73400953eb8ec80

*: Remove dependency on logrus We use logrus as a thin layer around fmt.Fprintf, however it introduces a large number of dependencies, including: * two different testing frameworks (testify, ginkgo) * bindings to the application monitoring service "airbrake" * an implementation of the ssh protocol * the entirety of golang.org/x/crypto This commit replace logrus with a copy of the 50 lines of logrus we actually use. Fixes #2037

view details

push time in 25 days

create barnchaarzilli/delve

branch : logrusremove

created branch time in 25 days

issue commentgo-delve/delve

Dependencies in go.mod are out of sync

go-md2man is used by the script that converts corba documentation into md files.

dlsniper

comment created time in 25 days

pull request commentgo-delve/delve

Highlight printed go code syntax on CLI

Delve uses vendored dependencies, if you add dependencies you need to run go mod vendor.

This PR introduces some dubious dependencies that I'd much rather not take:

  • github.com/alecthomas/kong: we already have a command line parser, we don't need another one and I don't see why one should be needed to print syntax highlighting at all
  • github.com/dlclark/regexp2: we already have a regexp library, it's in go's standard library. Also no regexp library at all is needed to parse go.
  • github.com/mitchellh/mapstructure: not sure what this has to do with syntax highlighting at all
  • github.com/danwakefield/fnmatch: this doesn't even document what it does
  • github.com/sergi/go-diff: what do diffs have to do with syntax highlighting?
  • github.com/stretchr/testify: we already have a testing library in the standard library.
  • why does this want to update golang.org/x/sys? why would a syntax highlighting library need to make system calls?
bulentkazanci

comment created time in 25 days

issue commentgo-delve/delve

Syntax highlighting

External highlighters are ok, but chroma has a lot of indirect dependencies.

Ma124

comment created time in 25 days

Pull request review commentgo-delve/delve

pkg/proc: avoid target process leaks.

 func (dbp *nativeProcess) trapWaitInternal(pid int, options trapWaitOptions) (*n 			th.os.delayedSignal = int(status.StopSignal()) 			th.os.running = false 			return th, nil-		} else {-			if err := th.resumeWithSig(int(status.StopSignal())); err != nil {-				if err == sys.ESRCH {-					dbp.postExit()-					return nil, proc.ErrProcessExited{Pid: dbp.pid}-				}-				return nil, err+		} else if err := th.resumeWithSig(int(status.StopSignal())); err != nil {

As far as I am concerned, you shouldn't worry about deepsource errors if they aren't in code you wrote.

chainhelen

comment created time in 25 days

Pull request review commentgo-delve/delve

cmd/dlv: Fix trace output

 type Location struct { 	Line     int       `json:"line"` 	Function *Function `json:"function,omitempty"` 	PCs      []uint64  `json:"pcs,omitempty"`+	// IsFunctionEntry is true if this location+	// represents the location of a function.+	IsFunctionEntry bool

I think this field is misleading: we return Location objects in several places and this is only ever going to be set in the response to FindLocation. Given that it's a thing that is specific to the FindLocation call I think it should be a field inside FindLocationOut.

derekparker

comment created time in 25 days

Pull request review commentgo-delve/delve

cmd/dlv: Fix trace output

 func setBreakpoint(t *Term, ctx callContext, tracepoint bool, argstr string) err  		fmt.Printf("%s set at %s\n", formatBreakpointName(bp, true), formatBreakpointLocation(bp)) 	}++	if tracepoint && shouldSetReturnBreakpoints && locs[0].Function != nil {

We have two possible cases here: (1) the location expression is a regex and returns multiple locations, or (2) it returns a single location. For case (2) this is good but instead of having shouldSetReturnBreakpoints it would be easier to just check locs[0].IsFunctionEntry. For case (1) I guess it should probably be a loop and set the return breakpoints on every function.

derekparker

comment created time in 25 days

Pull request review commentgo-delve/delve

cmd/dlv: Fix trace output

 func setBreakpoint(t *Term, ctx callContext, tracepoint bool, argstr string) err 			return err 		} 	}+	var shouldSetReturnBreakpoints bool 	for _, loc := range locs {+		if loc.IsFunctionEntry {+			shouldSetReturnBreakpoints = true+		} 		requestedBp.Addr = loc.PC 		requestedBp.Addrs = loc.PCs+		requestedBp.LoadArgs = &ShortLoadConfig

Why set this unconditionally?

derekparker

comment created time in 25 days

pull request commentgo-delve/delve

pkg/proc: avoid target process leaks.

I think that's because we are trying to sign the executable and there is no certificate installed. It probably doesn't have anything to do with your failure.

chainhelen

comment created time in a month

issue commentgo-delve/delve

Dependencies in go.mod are out of sync

So they are just dependencies of logrus's tests? I don't think we should add dependencies for the tests of logrus. Alternatively we should remove logrus for having bad taste in dependencies.

dlsniper

comment created time in a month

issue commentgo-delve/delve

Dependencies in go.mod are out of sync

I don't understand why we would be depending on ginkgo or gomega. Or why go mod tidy would result in updating yaml.v2, a direct dependency, to 2.2.4.

dlsniper

comment created time in a month

pull request commentgo-delve/delve

proc: better support for C pointers

No longer WIP.

aarzilli

comment created time in a month

push eventaarzilli/delve

Derek Parker

commit sha 0c9846c0a4fc994e1237b75b6d51b60f5694f8ae

*: Update freebsd image

view details

Darren Rambaud

commit sha bc30b53926f85c03c0e4175910da4bb928f4b999

gdbserial/gdbserver: Dynamically resolve debugserver binary (#1994) * 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

view details

Alessandro Arzilli

commit sha c3a4d726e21d75ffd7c0907b85e428480a9ad9a1

Miscellaneous debug_line improvements (#1999) * dwarf/line: implement DW_LNE_set_discriminator We don't use the discriminator field in any way but we need to at least parse it to support debub_line programs that use it. * dwarf/line: support parsing DWARF4 debug_line sections There is an extra field maximum_operations_per_instruction that is used for VLIW CPUs. We don't support this feature but we have to at least parse the field to not crash.

view details

Derek Parker

commit sha 3e60ae202b7d7c67fe7ea5fffafc92c7e39e4b67

*: Add --tty flag for debug / exec 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.

view details

Derek Parker

commit sha 00aab8d6902d2bc24550ed598ecfc63d04bb5a44

vendor: Update vendor

view details

Darren Rambaud

commit sha b13fe990bdcc7eec790514f2065b1c7f011371c0

cmds/commands: Add --continue flag to attach Add --continue as a valid flag for the attach command by decorating attachCommand with the continueOnStart variable. Fixes #1995

view details

Darren Rambaud

commit sha 49c6498512d18ef4fd4e3a9356a743fcee77fec0

cmd/commands: Update documentation for dlv attach Commit changes after executing gen-usage-docs.go script Related to #1995

view details

aarzilli

commit sha ae846a51f22758e8ce1461982b4376c8c0ab41c7

proc: StepOut remove if condition that is always true

view details

aarzilli

commit sha c534677ececd5b25dffe21264e8f3ce0e858a32e

proc/native: disable async preemption on freebsd

view details

chainhelen

commit sha ad9d13c6719e9f5e2a68a6f9078860ba75add146

proc: Don't set fileFound if there's a compileUnit without line section (#2006) We should not return error directly which set `fileFound` to be true if there's a compileUnit without line section.

view details

Derek Parker

commit sha e5d24a96bf2e6f5672b655a55184a8d9f5490a4a

*: Consolidate service/debugger config Embed the debugger config object in the service config object to avoid needless duplication of fields.

view details

Derek Parker

commit sha c06a1a0252ee164a4a775c587396945ab771c498

service/debugger: Fix checking for CI

view details

Alessandro Arzilli

commit sha bc299a7a30e34996bce67eb2b0145fdcb507e49d

tests: properly check if cgo is enabled for cgo related tests (#2010)

view details

Derek Parker

commit sha 682ee7ffd0da1e3f794b710d77340413c04d40ad

service/debugger: Rename processMutex to targetMutex Fixes a long standing dangling TODO item.

view details

aarzilli

commit sha 55543e2570f2ac2b489f181ac9e8d8b158d0f6e7

Makefile: reduce test timeout when TRAVIS==true Reduces test timeout by one minute so that Go will timeout before Travis-CI and report useful informations about the hang.

view details

aarzilli

commit sha f9b6c43910fbc7e49e46a96cd53a4261e4498b16

proc/native: report trapWaitInternal errors in nativeProcess.stop The process could quit while we are inside stop, we should report the error otherwise the following code will try to send on the closed ptrace channel. Fixes a sporadic error in TestIssue1101.

view details

aarzilli

commit sha 9c24b56f62caffbd072e721b1edd13b1bdb3d621

proc/tests: disable TestIssue414 on linux/386/PIE This test will occasionally hang in SetBreakpoint/WriteMemory

view details

chainhelen

commit sha 37bee98a8821843314b561bc6ab328dfff2aad1b

pkg/config: add `disassemble-flavor` option for config Allow user to specify output syntax flavor of assembly in the disassemble command. Close #415

view details

Min Zhou

commit sha 3e04ad0fada0c3ab57caf58bc024e4c0f9a3e01a

proc: Find executable should follow symbol links. On linux platform, we simply treated `/proc/$pid/exe` as the executable of targeting process when doing `dlv attach`. The `/proc/$pid/exe` is a symbol link of the real executable file. Delve couldn't find the corrsponding external debug file based on the symbol link: ``` could not attach to pid $pid: could not open debug info ``` The fix is to evaluate the symbol links to the actual executable path.

view details

aarzilli

commit sha 6102c31d6d47a9485db150e83bd78d33465887b5

terminal: clarify Ctrl-C options with multiclient servers Fixes #2028

view details

push time in a month

push eventaarzilli/gdlv

a

commit sha 484188002065dd80fb7f01f67ee7b06af9930a6f

Update nucular/gio - updated gio - fixes bug where recentering listing sometimes doesn't work (because a single pixel of the current line is somehow visible) - fixes bug where copying from the scrollback didn't work - fixes crash with inconsistent selection in richtext widgets

view details

a

commit sha 5cfd87355c6239ee489f6d5318928228f17beb05

Version 1.4

view details

a

commit sha 68b5f4f9983466d81ad1bc98da2de47084113d54

Update nucular

view details

push time in a month

push eventaarzilli/nucular

aarzilli

commit sha 1370bfe9ca4cca1b4af0ca6b5e3baaed50715bbe

richtext: fix crash with inconsistent selection (again)

view details

push time in a month

push eventaarzilli/delve

Lukas Spieß

commit sha eac6ebed036980909dfa234838883bf7372d5be0

Use proper spelling of Xcode (#1984)

view details

aarzilli

commit sha 7dedf1ed558ec37a462af3675eb6d65eb6d4dc1e

proc: simplify next/step/stepout condition code Adds a library of utility functions to generated breakpoint conditions for next, step and stepout.

view details

aarzilli

commit sha 3a72646782ea0c39946b12b214933027afd7c615

Documentation: add modules mode note to install documentation 1. Adds a note to the documentation describing how to use 'go get' in modules mode 2. Removes the '-u' option which, when 'go get' is used incorrectly will make 'go' try to compile Delve with unsupported dependencies 3. Removed obsolete note about Go 1.5 vendor experiment. Fixes #1988

view details

Derek Parker

commit sha 0c9846c0a4fc994e1237b75b6d51b60f5694f8ae

*: Update freebsd image

view details

Darren Rambaud

commit sha bc30b53926f85c03c0e4175910da4bb928f4b999

gdbserial/gdbserver: Dynamically resolve debugserver binary (#1994) * 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

view details

Alessandro Arzilli

commit sha c3a4d726e21d75ffd7c0907b85e428480a9ad9a1

Miscellaneous debug_line improvements (#1999) * dwarf/line: implement DW_LNE_set_discriminator We don't use the discriminator field in any way but we need to at least parse it to support debub_line programs that use it. * dwarf/line: support parsing DWARF4 debug_line sections There is an extra field maximum_operations_per_instruction that is used for VLIW CPUs. We don't support this feature but we have to at least parse the field to not crash.

view details

Derek Parker

commit sha 3e60ae202b7d7c67fe7ea5fffafc92c7e39e4b67

*: Add --tty flag for debug / exec 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.

view details

Derek Parker

commit sha 00aab8d6902d2bc24550ed598ecfc63d04bb5a44

vendor: Update vendor

view details

Darren Rambaud

commit sha b13fe990bdcc7eec790514f2065b1c7f011371c0

cmds/commands: Add --continue flag to attach Add --continue as a valid flag for the attach command by decorating attachCommand with the continueOnStart variable. Fixes #1995

view details

Darren Rambaud

commit sha 49c6498512d18ef4fd4e3a9356a743fcee77fec0

cmd/commands: Update documentation for dlv attach Commit changes after executing gen-usage-docs.go script Related to #1995

view details

aarzilli

commit sha ae846a51f22758e8ce1461982b4376c8c0ab41c7

proc: StepOut remove if condition that is always true

view details

aarzilli

commit sha c534677ececd5b25dffe21264e8f3ce0e858a32e

proc/native: disable async preemption on freebsd

view details

chainhelen

commit sha ad9d13c6719e9f5e2a68a6f9078860ba75add146

proc: Don't set fileFound if there's a compileUnit without line section (#2006) We should not return error directly which set `fileFound` to be true if there's a compileUnit without line section.

view details

Derek Parker

commit sha e5d24a96bf2e6f5672b655a55184a8d9f5490a4a

*: Consolidate service/debugger config Embed the debugger config object in the service config object to avoid needless duplication of fields.

view details

Derek Parker

commit sha c06a1a0252ee164a4a775c587396945ab771c498

service/debugger: Fix checking for CI

view details

Alessandro Arzilli

commit sha bc299a7a30e34996bce67eb2b0145fdcb507e49d

tests: properly check if cgo is enabled for cgo related tests (#2010)

view details

Derek Parker

commit sha 682ee7ffd0da1e3f794b710d77340413c04d40ad

service/debugger: Rename processMutex to targetMutex Fixes a long standing dangling TODO item.

view details

aarzilli

commit sha 55543e2570f2ac2b489f181ac9e8d8b158d0f6e7

Makefile: reduce test timeout when TRAVIS==true Reduces test timeout by one minute so that Go will timeout before Travis-CI and report useful informations about the hang.

view details

aarzilli

commit sha f9b6c43910fbc7e49e46a96cd53a4261e4498b16

proc/native: report trapWaitInternal errors in nativeProcess.stop The process could quit while we are inside stop, we should report the error otherwise the following code will try to send on the closed ptrace channel. Fixes a sporadic error in TestIssue1101.

view details

aarzilli

commit sha 9c24b56f62caffbd072e721b1edd13b1bdb3d621

proc/tests: disable TestIssue414 on linux/386/PIE This test will occasionally hang in SetBreakpoint/WriteMemory

view details

push time in a month

Pull request review commentgo-delve/delve

cmd/dlv: make core command limitations more prominent

+package main++// List packages used by _scirpts

I don't know. Maybe it's just been broken for a while and we didn't notice.

aarzilli

comment created time in a month

push eventaarzilli/delve

Min Zhou

commit sha 3e04ad0fada0c3ab57caf58bc024e4c0f9a3e01a

proc: Find executable should follow symbol links. On linux platform, we simply treated `/proc/$pid/exe` as the executable of targeting process when doing `dlv attach`. The `/proc/$pid/exe` is a symbol link of the real executable file. Delve couldn't find the corrsponding external debug file based on the symbol link: ``` could not attach to pid $pid: could not open debug info ``` The fix is to evaluate the symbol links to the actual executable path.

view details

aarzilli

commit sha 6102c31d6d47a9485db150e83bd78d33465887b5

terminal: clarify Ctrl-C options with multiclient servers Fixes #2028

view details

aarzilli

commit sha bb2525a7d59be85bd5e275c1b91a2732db626dd5

proc: keep debugger state consistent if callInjectionProtocol fails pickCurrentThread should always run.

view details

aarzilli

commit sha cf37512aed935c6ce497ca14440d5c80231f0e8a

proc: move g.stackhi/g.stacklo to a struct Mirroring the way this is implemented in the Go runtime and introducing a type that will be useful to support the call injection changes in Go 1.15

view details

aarzilli

commit sha c078223d56d450f4563abe697765b29c37d22d50

proc: use cached packageVars in proc.(*EvalScope).PackageVariables

view details

aarzilli

commit sha 96890bbe1e339267daef61b46c97f1e1c6bfb374

dwarf/op: return register values when they are the only piece When there is a single piece and it's a register value just return it. This is important for clang compiled programs which will use DW_OP_regN to specify the value of the frame base.

view details

aarzilli

commit sha 8f5df19948f801fdc4404f2e2c0d8e57db521fe6

proc: fix findCompileUnitForOffset when plugins are used Splits the compileUnits slice between images so that we can search for an offset inside the debug info of a specific image file.

view details

polinasok

commit sha 2f295f310d543f0d155ca1ea9a8a1e1288afd7b6

service/dap: Add error handlers for unsupported and not-yet-supported requests (#1918) * Add no-op handlers for unsupported requests * Fix whitespace * Add couple of missing unsupported requests * More comments * Separate errors for unsupported and not-yet-implemented requests. * Fix go.mod/sum dependencies Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>

view details

aarzilli

commit sha 06d50417e9fddc8dda467b1d0493d405b94fb8af

cmd/dlv: make core command limitations more prominent Fixes #2026

view details

push time in a month

Pull request review commentgo-delve/delve

terminal/command: Add 'reload' command

 func (d *Debugger) Restart(rerecord bool, pos string, resetArgs bool, newArgs [] 	} 	var p *proc.Target 	var err error++	if rebuild {+		// We cannot restart processes that we don't know how to build. If+		// d.config.Kind is different from ExecutingGeneratedFile that means we+		// didn't build the binary and we are just running it+		if d.config.Kind == ExecutingExistingFile {+			return nil, fmt.Errorf("cannot restart process Delve did not create")+		}+		err := gobuild.GoBuild(d.processArgs[0], d.config.Packages, d.config.BuildFlags)

This should call GoTestBuild if Kind == ExecutingGeneratedTest.

alexsaezm

comment created time in a month

Pull request review commentgo-delve/delve

terminal/command: Add 'reload' command

 func startServer(name string, buildFlags protest.BuildFlags, t *testing.T) (clie 		Debugger: debugger.Config{ 			Backend:        testBackend, 			CheckGoVersion: true,+			Packages:       []string{fixture.Source},+			BuildFlags:     "", // build flags can be an empty string here because the only test that uses it, does not set special flags.+			Kind:           debugger.ExecutingGeneratedTest,

This should say ExecutingGeneratedFile, it doesn't really matter but for consistency that's what they are.

alexsaezm

comment created time in a month

Pull request review commentgo-delve/delve

terminal/command: Add 'reload' command

 func TestRunWithInvalidPath(t *testing.T) { 		APIVersion:  2, 		Debugger: debugger.Config{ 			Backend: testBackend,+			Kind:    debugger.ExecutingGeneratedTest,

Also ExecutingGeneratedFile.

alexsaezm

comment created time in a month

more