Rename variable
This commit is contained in:
parent
e0738c417c
commit
d20183a679
@ -38,7 +38,7 @@ func main() {
|
|||||||
run bool
|
run bool
|
||||||
printv bool
|
printv bool
|
||||||
err error
|
err error
|
||||||
dbgproc *proctl.DebuggedProcess
|
dbp *proctl.DebuggedProcess
|
||||||
t = newTerm()
|
t = newTerm()
|
||||||
cmds = command.DebugCommands()
|
cmds = command.DebugCommands()
|
||||||
)
|
)
|
||||||
@ -68,17 +68,17 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer os.Remove(debugname)
|
defer os.Remove(debugname)
|
||||||
|
|
||||||
dbgproc, err = proctl.Launch(append([]string{"./" + debugname}, flag.Args()...))
|
dbp, err = proctl.Launch(append([]string{"./" + debugname}, flag.Args()...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(1, "Could not launch program:", err)
|
die(1, "Could not launch program:", err)
|
||||||
}
|
}
|
||||||
case pid != 0:
|
case pid != 0:
|
||||||
dbgproc, err = proctl.Attach(pid)
|
dbp, err = proctl.Attach(pid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(1, "Could not attach to process:", err)
|
die(1, "Could not attach to process:", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
dbgproc, err = proctl.Launch(flag.Args())
|
dbp, err = proctl.Launch(flag.Args())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(1, "Could not launch program:", err)
|
die(1, "Could not launch program:", err)
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ func main() {
|
|||||||
cmdstr, err := t.promptForInput()
|
cmdstr, err := t.promptForInput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
handleExit(t, dbgproc, 0)
|
handleExit(t, dbp, 0)
|
||||||
}
|
}
|
||||||
die(1, "Prompt for input failed.\n")
|
die(1, "Prompt for input failed.\n")
|
||||||
}
|
}
|
||||||
@ -99,11 +99,11 @@ func main() {
|
|||||||
cmdstr, args := parseCommand(cmdstr)
|
cmdstr, args := parseCommand(cmdstr)
|
||||||
|
|
||||||
if cmdstr == "exit" {
|
if cmdstr == "exit" {
|
||||||
handleExit(t, dbgproc, 0)
|
handleExit(t, dbp, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := cmds.Find(cmdstr)
|
cmd := cmds.Find(cmdstr)
|
||||||
err = cmd(dbgproc, args...)
|
err = cmd(dbp, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Command failed: %s\n", err)
|
fmt.Fprintf(os.Stderr, "Command failed: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user