Commit Graph

49 Commits

Author SHA1 Message Date
Joe Shaw
bb95d534a6 terminal/command: add list command to display source
Without arguments, `list` displays source around the current context.  A
linespec argument can be taken to display source around that location.

Fixes #58
2015-08-14 08:51:31 -05:00
Derek Parker
e68e760a9f service/debugger: Remove newline at end of error 2015-08-13 18:19:16 -05:00
aarzilli
fd08e96b24 Fix: rpc.(*RPCClient).EvalVariableFor
Original implementation was passing the wrong argument.
2015-08-09 20:37:11 -05:00
aarzilli
8e8d2660ef Improve commands which take a location spec
Breakpoints, tracepoints, etc.. take a location spec as input. This
patch improves the expressiveness of that API. It allows:

* Breakpoint at line
* Breakpoint at function (handling package / receiver smoothing)
* Breakpoint at address
* Breakpoint at file:line
* Setting breakpoint based off regexp
2015-08-08 14:41:48 -05:00
Derek Parker
d06abe3f2f Debugger.Restart: Preserve breakpoints
Fixes #188
2015-08-02 00:08:48 -05:00
aarzilli
a0115e3a15 bugfix: Issue #170 (partial) set function breakpoints on the first instruction
the entry point of a function is the beginning of the prologue, which can be run multiple times for each invocation of a function if the stack needs to be expanded or the scheduler needs to be run.
2015-07-28 08:16:20 -05:00
aarzilli
a353735715 Breakpoints are hit multiple times or skipped sometimes (tests) 2015-07-28 08:13:46 -05:00
aarzilli
efb5ef97c7 bugfix: rpc.(*RPCClient).AttachedToExistingProcess calling the wrong function, this would result in the terminal frontend always killing a process it was attached to 2015-07-25 21:26:37 -05:00
Derek Parker
3cee10d8bc Implement 'trace' subcommand
Allows a user to execute `dlv trace [regexp]` and Delve will execute the
program and output information on functions matching [regexp].
2015-07-12 15:20:12 -05:00
Derek Parker
40284111d4 Kill process outright if manually forked 2015-07-11 01:43:47 -05:00
Derek Parker
c1e7f8c45a Do not ask to kill process we spawned 2015-07-07 09:04:03 -05:00
aarzilli
5a35e8e6ff Fix: Bug in StackTrace RPC plumbing 2015-07-04 08:05:37 -05:00
Derek Parker
2f7612d4af Add command to restart process
Fixes #95
2015-07-03 15:35:22 -05:00
Derek Parker
d2b8d57053 Return exit status with DebuggerState 2015-07-03 15:28:46 -05:00
Derek Parker
dcfa1aea2b Properly return ProcessExitedError upon process death 2015-07-01 21:36:13 -05:00
Derek Parker
6b99c5f519 Cleanup tracepoint commit
* Cleanup comments
* Cleanup naming in certain instances
* Modify stacktrace to return current location
2015-06-30 22:16:52 -05:00
aarzilli
3a96d8eed7 trace command 2015-06-29 21:16:55 +02:00
aarzilli
358fb75fc6 Return helpful error when attaching to a process is impossible 2015-06-27 23:21:26 -05:00
Derek Parker
29ed169848 Return error when invoking Delve with invalid path
Fixes #154
2015-06-26 23:05:15 -05:00
Derek Parker
72b81c0c6b Ensure process is stopped before detaching in tests 2015-06-24 18:33:38 -05:00
Derek Parker
7c8fd02685 Remove HTTP server/client in favor of JSON-RPC
Instead of maintaining two separate client / server implementations,
maintain only the more lightweight JSON-RPC service. The reasoning
behind the merging of the original HTTP service was ease of tooling, in
other words low barrier of entry for external clients (editor
integrations, etc...).

I believe the JSON-RPC solution still satisfies that constraint while
have the advantage of being a more lightweight solution. HTTP, while
highly supported in most modern languages, carries with it too many
features we would never take advantage of. The RPC architecture seems
a more natural approach.

The infrastructure set up during the initial HTTP service implementation
was leveraged in the JSON-RPC implementation, so if any of those
original authors are reading this commit message: thank you for that
work, it was not in vain even if though the original HTTP service is not
being removed.
2015-06-24 08:08:48 -05:00
Derek Parker
48bb398c4b Properly report process exits 2015-06-21 21:11:47 -05:00
Derek Parker
687dc4172d Introduce JSON-RPC service 2015-06-21 21:11:30 -05:00
Derek Parker
6e538119d2 Refactor: Rename breakpoint methods
s/Break/SetBreakpoint/
s/Clear/ClearBreakpoint/
s/BreakByLocation/SetBreakpointByLocation/
2015-06-20 18:01:06 -05:00
Derek Parker
102d4c89ae s/DebuggedProcess/Process/ 2015-06-20 17:54:52 -05:00
Derek Parker
d265fa764f Update Debugger documentation 2015-06-20 17:50:24 -05:00
aarzilli
07473f04c5 Implement stack command
Finishes #63 #64
2015-06-20 15:29:33 -05:00
Giulio Iotti
256c83b17b Implement regs command to print registers values, fixes #62 2015-06-19 14:27:01 -05:00
Derek Parker
37235bba7f Store hardware/software breakpoints in same struct 2015-06-17 18:14:56 -05:00
Derek Parker
e4fc5e32c2 Refactor: Use thread-locked goroutine for ptrace ops
Previously either the terminal client or the debugger service would
either lock main goroutine to a thread or provide a locked goroutine to
run _all_ DebuggedProcess functions in. This is unnecessary because only
ptrace functions need to be run from the same thread that originated the
PT_ATTACH request.

Here we use a specific thread-locked goroutine to service any ptrace
request. That goroutine is also responsible for the initial spawning /
attaching of the process, since it must be responsible for the PT_ATTACH
request.
2015-06-13 12:57:42 -05:00
Derek Parker
e5233e7262 Rename: s/ThreadContext/Thread/ 2015-06-12 14:51:23 -05:00
Derek Parker
bfca6114d4 Rename package proctl -> proc 2015-06-12 14:49:23 -05:00
Derek Parker
a71f218e35 Rename: s/BreakPoint/Breakpoint/ 2015-06-12 14:48:18 -05:00
Derek Parker
98e7089dd3 Move list of hardware breakpoints onto arch struct
Hardware breakpoints are by definition architecture dependant. Move them
off the DebuggedProcess struct and onto the associated arch struct.
2015-06-12 14:30:59 -05:00
Derek Parker
fe19f3f20c Rename: s/EvalSymbol/EvalVariable/ 2015-06-12 14:04:14 -05:00
Derek Parker
c7dc57d44f Detach from process in tests
Prevents leaving around a bunch of zombie processes
2015-05-27 17:38:53 -05:00
Derek Parker
49667f2302 Rename thread.Process -> thread.dbp
Process is an incorrect name for the DebuggedProcess struct that the
thread is "a part" of. Also, no need to export that field.
2015-05-27 12:16:45 -05:00
Derek Parker
efc5003cdd Compile fixtures on demand, only once 2015-05-15 09:23:58 -05:00
Derek Parker
228587f6ba Specify log visibility with NewServer 2015-05-08 17:26:09 -05:00
Derek Parker
819c476aa9 Do not attempt to automatically read locals/args 2015-05-08 16:43:03 -05:00
Dan Mace
ecb8e8a42a Consolidate test support/setup
Add a test support package which allows shared test functionality
for both the unit and integration tests.

Tests importing the proctl/test package will gain access to a special
test entrypoint which precompiles fixtures and makes them available
to tests.
2015-05-04 17:44:40 -05:00
Derek Parker
794d5b1e19 Revert errors.New change 2015-05-04 17:31:13 -05:00
Dan Mace
064462e5b5 Support a headless server mode
Add a -headless flag which runs only the debugger server until
a SIGINT is received.
2015-05-02 14:42:47 -05:00
Dan Mace
ca2508af6b Suppress output of HTTP error from client
Introduce a client error type which preserves HTTP error information
but which doesn't render the HTTP details by default.
2015-05-02 14:38:38 -05:00
Derek Parker
1ad66660a1 Prefer errors.New for unformatted errors 2015-05-01 16:27:29 -05:00
Derek Parker
6cadeb41fc Pass kill signal to ptrace_detach 2015-05-01 15:50:29 -05:00
Derek Parker
9040ec1af1 Only detach if not killing process 2015-05-01 15:14:58 -05:00
Dan Mace
3ffbe2d7b7 Precompile fixtures 2015-04-29 21:05:41 -05:00
Dan Mace
2954e03a20 Introduce client/server separation
Refactor to introduce client/server separation, including a typed
client API and a HTTP REST server implementation.

Refactor the terminal to be an API consumer.
2015-04-29 21:05:41 -05:00