* Extend the "frame" command to set the current frame.
Command
frame 3
sets up so that subsequent "print", "set", "whatis" command
will operate on frame 3.
frame 3 print foo
continues to work.
Added "up", "down". They move the current frame up or down.
Implementation note:
This changes removes "scopePrefix" mode from the terminal/command.go and instead
have the command examine the goroutine/frame value to see if it is invoked in a
scoped context.
* Rename Command.Frame -> Command.frame.
* 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.
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.
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
* 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
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.
- 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
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.
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.