Commit Graph

98 Commits

Author SHA1 Message Date
Alessandro Arzilli
a90893f532 path/to/binary is the required argument (#847 fixed) (#884)
* cmd: include replay command in docs even if rr is not installed.

* path/to/binary is the required argument

Replaces #847
2017-06-20 10:36:07 -07:00
Alessandro Arzilli
a843f7944e proc/gdbserial: mozilla rr support (#804)
Implements #727
2017-05-05 15:17:52 -07:00
Hyang-Ah Hana Kim
c67986ed7d cmd/dlv: fix race in test (#805)
% go test -race -v -short

=== RUN   TestBuild
==================
WARNING: DATA RACE
Write at 0x00c4201379a0 by goroutine 9:
  os.(*file).close()
      /usr/local/go/src/os/file_unix.go:143 +0x10a
  os.(*File).Close()
      /usr/local/go/src/os/file_unix.go:132 +0x55
  os/exec.(*Cmd).closeDescriptors()
      /usr/local/go/src/os/exec/exec.go:263 +0x67
  os/exec.(*Cmd).Wait()
      /usr/local/go/src/os/exec/exec.go:448 +0x2b8
  github.com/derekparker/delve/cmd/dlv.TestBuild.func1()
      /home/kbuilder/go/src/github.com/derekparker/delve/cmd/dlv/dlv_test.go:82 +0x8e
  github.com/derekparker/delve/cmd/dlv.TestBuild()
      /home/kbuilder/go/src/github.com/derekparker/delve/cmd/dlv/dlv_test.go:104 +0xb6a
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:657 +0x107

Previous read at 0x00c4201379a0 by goroutine 12:
  os.(*File).Read()
      /usr/local/go/src/os/file.go:98 +0x70
  bufio.(*Scanner).Scan()
      /usr/local/go/src/bufio/scan.go:207 +0x539
  github.com/derekparker/delve/cmd/dlv.TestBuild.func2()
      /home/kbuilder/go/src/github.com/derekparker/delve/cmd/dlv/dlv_test.go:93 +0x38

Change-Id: I09d188dbf964fe4af0b33b6a8fcfe51396176b7e
2017-04-26 12:03:26 -07:00
aarzilli
86a59c52a6 terminal: bugfix: tolerate spurious spaces after command prefixes
Expressions such as:

 frame 0    list
 frame   0   list
 on abreakpoint     print x
 goroutine    1    frame     0     list

should all execute correctly

Fixes #712
2017-04-19 09:58:36 -07:00
aarzilli
329bc7e69d dlv_test: fix test on macOS for new Makefile 2017-04-18 13:25:11 -07:00
aarzilli
c8d9352522 proc: Implement target.Interface for gdbserver backend 2017-04-18 13:25:11 -07:00
aarzilli
c1879472a1 proc: implement target.Interface for core files 2017-04-18 13:25:11 -07:00
Derek Parker
01a1b35620 cmd/dlv: Use Printf over Println
Fixes #783
2017-04-06 15:32:44 -07:00
Hyang-Ah Hana Kim
ab7367ed2b Minor fixes to make some tests build and run (#752)
* cmd/dlv: fall back to go env GOPATH when GOPATH envvar is unset.

Since Go 1.8, GOPATH environment variable has a default value if the
environment variable is unset so not setting GOPATH is perfectly ok.
Depend on `go env` command to query Go related environment variable.

* build: update references to moved packages
2017-03-13 10:59:34 -07:00
aarzilli
1a68f8d351 proc/windows: handle delayed events
Sometimes windows will send us events about breakpoints we have
already removed from the code despite the fact that we go to great
lengths to avoid this already.

Change waitForDebugEvent to check that when we receive a breakpoint
event the corresponding memory actually contains an INT 3
instruction, if it doesn't ignore the event and restart the thread.
2017-02-22 20:39:28 +01:00
Jason Biegel
cd2a875459 Add flag support documentation (#740) 2017-02-16 11:05:48 -08:00
Derek Parker
53f0d24057 Move top-level packages into pkg 2017-02-08 12:17:19 -08:00
aarzilli
ee6d2734c9 tests: fix TestBuild on macOS, windows 2016-12-17 10:53:30 +01:00
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
5d78c04e62 dlv: bugfix: Allow quoting in build flags argument (#639)
Allows quoted substrings in build-flags flag. This fixes a build
problem on windows where the default build flags must contain a space.

Fixes #634 and #638
2016-09-25 08:26:59 -07:00
Koichi Shiraishi
2fad5abe74 cmd: Support space separate flags for build-flags (#619)
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2016-09-12 11:13:21 -07:00
aarzilli
80336e57e0 Replaced net/rpc with custom version
This version preserves the order of requests, allows the
client to switch between API versions and introduces a
way to send notifications to the client (see TODO item at:
proc/proc_linux.go:325).

Fixes #523, #571
2016-07-02 12:16:06 +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
Nan Xiao
7f6d7e214d dlv/cmds: Add missing periods in help output. (#547) 2016-05-25 12:13:16 -07:00
Derek Parker
93d82ca8d2 dlv/cmds: Improve subcommand help output 2016-05-20 20:32:16 +02:00
Nan Xiao
709e308339 terminal: Display subcommads in alphabetic order. (#539)
For better user experience, display subcommands in alphaetic order.
2016-05-20 10:22:10 -07:00
visualfc
f7e403abcf dlv: Headless mode print listener address info (#487)
* Headless mode print listener address info

* if Headless && Addr == localhost:0 print address

* update listen flag changed check

* terminal: headless print API server listening address
2016-04-24 10:27:02 -07:00
Alessandro Arzilli
473b66387c proc: Improvements to Variable printing (#444)
* service/api: Removed unused fields of service/api.Function

* proc/eval: Set return variable name to input expression

* all: fine-grained control of loadValue for better variable printing

Makes proc.(*Variable).loadValue loading parameters configurable
through one extra argument of type LoadConfig.
This interface is also exposed through the API so clients can control
how much of a variable delve should read.
2016-04-24 10:15:39 -07:00
Alessandro Arzilli
af4798e2a9 service,terminal: APIv2 plus method to select API version (#460)
New API version with better backwards compatibility plus mechanism to
select the API version that a headless instance should use.

Adds service/test/cmd/typecheckrpc.go to type check the RPC interface.
2016-04-18 12:20:20 -07:00
Sam Zaydel
26ce16f1db docs: Changed word from singular to plural form to better fit context. (#491) 2016-04-08 14:12:38 -07:00
Hubert Krauze
37f124817d dlv: Misc refactors 2016-03-17 15:32:30 -07:00
aarzilli
5ba9bcd740 terminal: Mechanism to handle command prefixes
Implements extensible mechanism to specify which commands accept
prefixes (goroutine, frame, on) instead of hardcoding them in
a switch.

Implements #240
2016-02-28 13:38:05 +01:00
Derek Parker
63a660820e docs: Move wiki docs into Documentation dir
Going forward, all documentation should be placed in the Documentation
directory in the root of the project. This switch allows maintainers to
approve updates to documentation before they are committed, as opposed
to the pre-existing wiki which anybody could modify.

Currently the Documentation directory includes docs on building, usage,
and minimal docs around the API. This is just the initial commit, and
documentation will continue to improve over time.

Some changes have been made (and will continue to be made) to `cmd/dlv` to
ensure we can auto-generate documentation for all commands from the
newly provided script `scripts/gen-usage-docs.go`, which can be invoked
via `go run scripts/gen-usage-docs.go`.

Additionally, version has been split into its own package. This was a
bit of housekeeping related to the changes made the `cmd/dlv`.
2016-02-19 10:47:46 -08:00
aarzilli
c277b27157 cmd/dlv: add flag to make headless server accept multiple clients 2016-02-17 20:09:50 +01:00
Derek Parker
8f85b6cbae dlv: Take package name in certain commands
This patch allows certain commands (`debug`, `test`, and `trace`) to
take an argument specifying a package name. This allows a user to
specify a package other than that of the current package in the working
directory.

If a package name is not specified, the behavior remains the same, as in
Delve will look in the current working directory for a `main` package to
compile.

Fixes #423
2016-02-16 09:55:34 -08:00
aarzilli
3ca1dd35ca cmd/dlv: bugfix: trace disables terminal echo
Fixes #397
2016-02-04 08:55:38 +01:00
Derek Parker
94a265f098 dlv: Misc refactors
Mainly just cleans up the code in cmd/dlv/main.go
2016-02-01 09:50:37 +01:00
Derek Parker
8a1f36a1ce dlv: Flag to print stacktrace on trace subcommand 2016-02-01 09:28:25 +01:00
aarzilli
ae6a5f503c cmd/dlv/main: trace subcommand shows duplicate entries
The tracepoint should be set on the function's first line, not the
function's entry point to avoid function prologue weirdness.

Fixes #389
2016-01-31 13:35:18 +01:00
Derek Parker
975a114c0f trace: Fix panic calling trace without arg 2016-01-31 11:14:58 +01:00
Derek Parker
6774a6c782 all: Bump to version 0.11.0-alpha 2016-01-26 11:11:55 -08:00
Vorn Mom
1bfae45b07 terminal/command: Fixed 'test' command on Windows
This change addresses a Windows-specifc issue with the 'test' command. On
Windows, 'go test' generate executables with a '.exe' filename extention,
but the current implementation attaches to a filename without the
extention.
2016-01-24 15:37:58 -08:00
Luke Hoban
bddb712a6b Add support for Windows.
Fixes #198.
2016-01-20 19:06:31 -08:00
Derek Parker
0188dc2c8b misc: cleanup and documentation 2016-01-10 02:10:51 -08:00
aarzilli
708cf2f290 service,terminal: propagating simultaneous breakpoints 2016-01-09 08:44:25 +01:00
Derek Parker
d4bfd25a28 cmd/trace: Shorten file paths in output
Export the function to shorten file paths from the terminal package so
that it can be used in the `trace` subcommand.
2015-12-28 08:46:12 +01:00
Derek Parker
6d68d1aefa cmd/trace: Fix nil pointer panic in trace subcommand 2015-12-27 18:36:54 -08:00
Derek Parker
0abc772023 build: Add git sha to version output 2015-12-15 08:38:22 +01:00
aarzilli
50b5fc92e2 Changed api.Variable to have a machine readable value
The new contents of api.Variable are documented in
proc/variables.go.

Implements #243
2015-10-28 18:28:58 -07:00
Derek Parker
2b4fef44a5 dlv: Add option to provide build flags
Fixes #253
2015-10-18 10:41:34 -07:00
Quentin Perez
065984f42c Fix 2 x panic: runtime error: index out of range 2015-10-09 10:45:37 +02:00
Derek Parker
db95b67b23 all: Bump to version 0.10.0-alpha 2015-10-04 11:17:46 -07:00
aarzilli
eb2bc2a7ee terminal: Implements init file and source command
The 'source' command reads the file specified as argument and executes
it as a list of delve commands.
Additionally a flag '--init' can be passed to delve specifying a file
containing a list of commands to execute on startup.

Issue #96
2015-10-04 10:32:38 -07:00
Derek Parker
7f3ae73471 Version: Bump to 0.9.0-alpha 2015-09-20 00:13:23 -05:00
Derek Parker
1094c32f14 Bump version to 0.8.1-alpha 2015-09-05 17:27:06 -05:00