Commit Graph

16 Commits

Author SHA1 Message Date
Evgeny L
4064d6acc0 Flag to set working directory (#650)
* proc: Add `wd` to Launch

This change adds the `wd` arg which specify working directory of the
program.

Fixes #295

* service/debugger: Add `Wd` field to debugger.Config

This change adds the `Wd` field which specify working directory of the
program launched by debugger.

Fixes #295

* service: Add `Wd` to service.Config

This change adds the `Wd` field which specify working directory of the
program debugger will launch.

Fixes #295

* cmd/dlv: Add `Wd` flag

This change adds `Wd` flag which specify working directory of the
program which launched by debugger.

Fixes #295

* only set the Linux working directory if it is set,
stub out param in darwin and windows

* set working directory for Windows
https://godoc.org/golang.org/x/sys/windows#CreateProcess
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

* Windows workingDir must be an *uint16

* attempt to chdir on darwin via @yuntan

* proc/exec_darwin.c: fix working directory for darwin

* Add tests to check if working directory works.
* Fix darwin implementation of fork/exec, which paniced if
  child fork returned.

* cmd, service: rename Wd to WorkingDir
2016-11-01 12:58:42 -07:00
Alessandro Arzilli
f6e8fb37a4 proc: changed windows backend to deal with simultaneous breakpoints (#598)
* proc: changed windows backend to deal with simultaneous breakpoints

* bugfix: forgot to add windowsPrologue3 to the prologues list in e4c7df1

* Tolerate errors returned by Stacktrace in TestStacktraceGoroutine.

* bugfix: proc: propagate debug events we don't cause back to the target process

Fixes: #594

* proc: fixed TestStepConcurrentPtr

Implementation of nextInProgress was wrong.
2016-10-21 21:51:34 -07:00
Alex Brainman
4d8daeb1a8 proc: implement detach on windows (#615) 2016-09-12 11:16:41 -07:00
Alex Brainman
f09ef23f9e proc: implement attach on windows
Updates #363
2016-08-12 12:30:01 +10:00
Alessandro Arzilli
372869c9e1 proc: Back to using vendored golang.org/x/debug/ (#585)
Patch https://go-review.googlesource.com/23085 has been merged so we
can go back to using golang.org/x/debug/.
2016-07-05 11:58:11 -07:00
aarzilli
da910cc3bd proc: disabled TestUnsupportedArch on go1.7
See: https://github.com/golang/go/issues/16180
2016-07-03 09:02:21 +02:00
aarzilli
51c39ed171 proc: detect when Launching non-executable files
This provides a better error message when the user tries to run dlv
debug on a directory that does not contain a main package, when `dlv
exec` is used with a source file.

Additionally the architecture of the executable is checked as suggested
by @alexbrainman in #443.

Fixes #509
2016-06-30 09:39:18 +02:00
Derek Parker
0fded288b5 all: Fix typos 2016-05-29 22:13:52 +02:00
Alessandro Arzilli
9bc6ad4f46 Go 1.7 compatibility (#524)
* tests: update to cope with go1.7 SSA compiler

* de-vendored golang.org/x/debug/dwarf

We need our own tweaked version

* dwarf/debug/dwarf: always use the entry's name attribute

Using the name attribute leads to better type names as well as fixes
inconsistencies between 1.5, 1.6 and 1.7.

* proc: Updated loadInterface to work with go1.7

go1.7 changed the internal representation of types, removing the string
field from runtime._type.
Updated loadInterface to use the new str field.
2016-05-29 12:20:09 -07:00
Matias Lahti
60946a759c proc: Fix command-line arguments on Windows (#501)
* proc: add tests for command-line arguments

adds tests to make sure command-line arguments are passed to Launch() properly

* proc_windows: pass command-line arguments to CreateProcess()

build command-line arguments according to how the standard library does it and pass the command line along to the actual syscall on Windows.

see discussion in #479

* proc: better testing of cmd-line arguments

* proc_windows: fix a possible error-case with passing just 1 argument

previously, the command line pointer passed to sys.CreateProcess was empty, if we had 0 parameters (len(cmd) == 1, as cmd[0] is the executable, so no cmdlineGo would be created, while with any argument it would as len(cmd) > 1). This might cause problems down the road, so make sure we include the command line every time, even if it seems to work without.

* proc: improve testing of command-line arguments

test that arguments with spaces are passed on correctly and DRY failure/success condition checking in the args test
2016-04-21 14:20:38 -07:00
Alex Brainman
8d4d0871cf proc: replace cgo with syscalls on windows
Unrelated to conversion, I have also changed (*Thread).readMemory
to return only first count bytes of memory just as advised
by ReadProcessMemory.

Fixes #409
Fixes #412
Fixes #416
2016-02-19 15:55:20 +11:00
Luke Hoban
e2c455dd89 [proc] ContinueDebugEvent after EXIT_PROCESS on Windows
Fixes #398.
2016-02-05 14:53:02 -08:00
Derek Parker
1bda586115 proc: step now goes to next line, including funcs
This patch modifies the `step` command to step to the next source line,
stepping into any function encountered along the way.

Fixes #360
2016-01-24 15:48:36 -08:00
aarzilli
54f1c9b3d4 proc: replace debug/dwarf with golang.org/x/debug/dwarf
Typedefs that resolve to slices are not recorded in DWARF as typedefs
but instead as structs in a way that there is no way to know they
are really slices using debug/dwarf.
Using golang.org/x/debug/dwarf instead this problem is solved and
as a bonus some types are printed with a nicer names: (struct string
→ string, struct []int → []int, etc)

 Fixes #356 and #293
2016-01-24 15:41:41 -08:00
aarzilli
b1640238ce dwarf/frame: detecting dwarf section endianness 2016-01-24 15:41:41 -08:00
Luke Hoban
bddb712a6b Add support for Windows.
Fixes #198.
2016-01-20 19:06:31 -08:00