proc,terminal: Ensure correct exit status (#2543)

Ensure that any command executed after the process we are trying to
debug prints a correct and consistent exit status.

Previously the exit code was being lost after the first time we printed
that a process has exited. Additionally, certain commands would print
the PID of the process and other would not. This change makes everything
more correct and consistent.
This commit is contained in:
Derek Parker
2021-06-22 04:35:13 -07:00
committed by GitHub
parent d3f4a8d443
commit 42ecbd4413
7 changed files with 49 additions and 8 deletions

View File

@ -26,6 +26,10 @@ type Process interface {
// the `proc` package.
// This is temporary and in support of an ongoing refactor.
type ProcessInternal interface {
// Valid returns true if this Process can be used. When it returns false it
// also returns an error describing why the Process is invalid (either
// ErrProcessExited or ErrProcessDetached).
Valid() (bool, error)
// Restart restarts the recording from the specified position, or from the
// last checkpoint if pos == "".
// If pos starts with 'c' it's a checkpoint ID, otherwise it's an event
@ -87,10 +91,6 @@ type Info interface {
// ResumeNotify specifies a channel that will be closed the next time
// ContinueOnce finishes resuming the target.
ResumeNotify(chan<- struct{})
// Valid returns true if this Process can be used. When it returns false it
// also returns an error describing why the Process is invalid (either
// ErrProcessExited or ErrProcessDetached).
Valid() (bool, error)
BinInfo() *BinaryInfo
EntryPoint() (uint64, error)