Commit Graph

18 Commits

Author SHA1 Message Date
Yasushi Saito
c5c41f6352 command/terminal: allow restart to change process args (#1060)
* command/terminal: allow restart to change process args

Add -args flag to "restart" command. For example, "restart -args a b c" will
pass args a b c to the new process.

Add "-c" flag to pass the checkpoint name. This is needed to disambiguate the
checkpoint name and arglist.

Reverted unnecessary changes.

* Applied reviewer comments.

Vendored argv.

Change the syntax of restart. When the target is is in recording mode, it always
interprets the args as a checkpoint. Otherwise, it interprets the args as
commandline args. The flag "-args" is still there, to handle the case in which
the user wants to pass an empty args on restart.

* Add restartargs.go.

Change "restart -args" to "restart -noargs" to clarify that this flag is used to
start a process with an empty arg.
2018-01-18 14:16:11 -08:00
aarzilli
3f2335f289 debugger/locations: locspec "+0" should always evaluate to the current PC
So far we have evaluated the locspec "+0" the same way we evaluate all
"+n" locspecs, this means that we turn the current PC into a file:line
pair, then we turn back the file:line into a PC address.

Normally this is harmless, however all autogenerated code returns the
source position "<autogenerated>:1" which resolves back to the very
first autogenerated instruction in the code.

This messes up the behaviour of the "disassemble" command which uses
the locspec "+0" to figure out what code to disassemble if no arguments
are passed.

We should make +0 always resolve to the current PC (of the given scope)
so that clients can use +0 as a default locspec.
2017-12-18 10:30:53 -08:00
aarzilli
17bd4b52e8 pkg/terminal: -offsets flag for stack command
Prints the frame and frame pointer offsets for each frame.
2017-11-28 11:00:53 -08:00
aarzilli
48288edd18 terminal: add config command
Fixes #927, #644
2017-09-08 10:27:32 -07:00
aarzilli
9ee21686e6 proc: report errors when loading executable on attach
Fixes #940
2017-08-30 11:20:20 -07:00
Alessandro Arzilli
04adb46ccb tests: remove rr trace directory after running tests (#934)
Can't get the trace directory from the server after we disconnect from
it.
2017-08-01 11:14:11 -06:00
aarzilli
558eb0d41a proc: in Next return address could be invalid, ignore errors setting it
Updates #893
2017-07-26 12:50:09 -06:00
aarzilli
a7718bd358 proc: tolerate memory read errors during stacktrace
When there's a error reading the stack trace the call stack itself
could be corrupted and we should return the partial stacktrace that we
have.

Fixes #868
2017-07-26 12:50:09 -06:00
Florin Pățan
32a005de2b Fix various issues detected by megacheck (#880)
* Fix various issues detected by megacheck

I've ran honnef.co/go/tools/cmd/megacheck and fixed a few of the
things that came up there.

* Cleanup using Gogland
2017-06-29 11:15:59 -07:00
Alessandro Arzilli
04c4b019f7 api: add FrameOffset to Stackframe (#864)
Other debuggers can be instructed to decorate the stacktrace with the
value of SP. Our SP equivalent is the frame offset, since we can add it
to the Stackframe structure without incurring into added costs we
should, so that frontends can use it if they want.
2017-06-20 10:39:33 -07:00
Alessandro Arzilli
98a4ff7a9f terminal: bugfix: deref of nil SelectedGoroutine switching goroutines (#829)
If CurrentThread isn't running a goroutine SelectedGoroutine can be
nil, do not blindly dereference it.

Fixes #827
2017-05-08 11:16:14 -07:00
Alessandro Arzilli
a843f7944e proc/gdbserial: mozilla rr support (#804)
Implements #727
2017-05-05 15:17:52 -07:00
aarzilli
e4b609bf2b terminal: better list command
- always print a header with the path to the file being displayed
- always evaluate the linespec argument, even if a scope prefix is present

Fixes #711, #713
2017-04-19 10:06:43 -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
c8d9352522 proc: Implement target.Interface for gdbserver backend 2017-04-18 13:25:11 -07:00
aarzilli
1a4b5a05b2 terminal/command_test: improved TestIssue387
The test in question tries to 'next' over a call to wg.Done, this is
not guaranteed to succeed, if the goroutine gets suspended after
wg.Done has notified the waiting group but before returning to
main.dostuff the program could quit before the goroutine is resumed.
2017-02-22 20:39:28 +01:00
aarzilli
92faa95bf9 proc/stack: use BP when FDE is not available
On Windows we can sometimes encounter threads stopped in locations for
which we do not have entries in debug_frame.
These cases seem to be due to calls to Windows API in the go runtime,
we can still produce a (partial) stack trace in this circumstance by
following frame pointers (starting with BP).
We still prefer debug_frame entries when available since go functions
do not have frame pointers before go1.8.
2017-02-22 20:39:28 +01:00
Derek Parker
53f0d24057 Move top-level packages into pkg 2017-02-08 12:17:19 -08:00