summaryrefslogtreecommitdiff
path: root/src/pkg/debug/proc/proc.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
committerRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
commit828334dd95ce8e4bf3662bd5c89d7c417f0741d0 (patch)
treefd7e0c9961bc3af2ddf105e9cc1943f2509ac584 /src/pkg/debug/proc/proc.go
parenteb5cdfd67ff6d32df4c4c27840eaee027c5e3512 (diff)
downloadgolang-828334dd95ce8e4bf3662bd5c89d7c417f0741d0.tar.gz
- fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
Diffstat (limited to 'src/pkg/debug/proc/proc.go')
-rw-r--r--src/pkg/debug/proc/proc.go40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/pkg/debug/proc/proc.go b/src/pkg/debug/proc/proc.go
index 084228b24..0719ebef3 100644
--- a/src/pkg/debug/proc/proc.go
+++ b/src/pkg/debug/proc/proc.go
@@ -151,18 +151,14 @@ type Process interface {
// stop.
type Stopped struct{}
-func (c Stopped) String() string {
- return "stopped";
-}
+func (c Stopped) String() string { return "stopped" }
// Breakpoint is a stop cause resulting from a thread reaching a set
// breakpoint.
type Breakpoint Word
// PC returns the program counter that the program is stopped at.
-func (c Breakpoint) PC() Word {
- return Word(c);
-}
+func (c Breakpoint) PC() Word { return Word(c) }
func (c Breakpoint) String() string {
return "breakpoint at 0x" + strconv.Uitob64(uint64(c.PC()), 16);
@@ -173,13 +169,9 @@ func (c Breakpoint) String() string {
type Signal string
// Signal returns the signal being delivered to the thread.
-func (c Signal) Name() string {
- return string(c);
-}
+func (c Signal) Name() string { return string(c) }
-func (c Signal) String() string {
- return c.Name();
-}
+func (c Signal) String() string { return c.Name() }
// ThreadCreate is a stop cause returned from an existing thread when
// it creates a new thread. The new thread exists in a primordial
@@ -189,13 +181,9 @@ type ThreadCreate struct {
thread Thread;
}
-func (c *ThreadCreate) NewThread() Thread {
- return c.thread;
-}
+func (c *ThreadCreate) NewThread() Thread { return c.thread }
-func (c *ThreadCreate) String() string {
- return "thread create";
-}
+func (c *ThreadCreate) String() string { return "thread create" }
// ThreadExit is a stop cause resulting from a thread exiting. When
// this cause first arises, the thread will still be in the list of
@@ -207,26 +195,18 @@ type ThreadExit struct {
}
// Exited returns true if the thread exited normally.
-func (c *ThreadExit) Exited() bool {
- return c.exitStatus != -1;
-}
+func (c *ThreadExit) Exited() bool { return c.exitStatus != -1 }
// ExitStatus returns the exit status of the thread if it exited
// normally or -1 otherwise.
-func (c *ThreadExit) ExitStatus() int {
- return c.exitStatus;
-}
+func (c *ThreadExit) ExitStatus() int { return c.exitStatus }
// Signaled returns true if the thread was terminated by a signal.
-func (c *ThreadExit) Signaled() bool {
- return c.exitStatus == -1;
-}
+func (c *ThreadExit) Signaled() bool { return c.exitStatus == -1 }
// StopSignal returns the signal that terminated the thread, or "" if
// it was not terminated by a signal.
-func (c *ThreadExit) StopSignal() string {
- return c.signal;
-}
+func (c *ThreadExit) StopSignal() string { return c.signal }
func (c *ThreadExit) String() string {
res := "thread exited ";