1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00

[dev.cc] cmd/asm: set the flags to production settings (turn off debug)

Set -S to false and add -debug to control the other debugging print.

Change-Id: I864866c3d264a33e6dd0ce12a86a050a5fe0f875
Reviewed-on: https://go-review.googlesource.com/3453
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Rob Pike 2015-01-28 15:41:12 -08:00
parent 29428e322d
commit 36e5f4d53f
3 changed files with 8 additions and 4 deletions

View File

@ -11,6 +11,7 @@ import (
"cmd/asm/internal/addr"
"cmd/asm/internal/arch"
"cmd/asm/internal/flags"
"cmd/asm/internal/lex"
"cmd/internal/obj"
)
@ -140,7 +141,9 @@ func (p *Parser) append(prog *obj.Prog, doLabel bool) {
p.pendingLabels = p.pendingLabels[0:0]
}
prog.Pc = int64(p.pc)
fmt.Println(p.histLineNum, prog)
if *flags.Debug {
fmt.Println(p.histLineNum, prog)
}
}
// asmText assembles a TEXT pseudo-op.

View File

@ -14,8 +14,9 @@ import (
)
var (
OutputFile = flag.String("o", "", "output file; default foo.6 for /a/b/c/foo.s on arm64 (unused TODO)")
PrintOut = flag.Bool("S", true, "print assembly and machine code") // TODO: set to false
Debug = flag.Bool("debug", false, "dump instructions as they are parsed")
OutputFile = flag.String("o", "", "output file; default foo.6 for /a/b/c/foo.s on amd64")
PrintOut = flag.Bool("S", false, "print assembly and machine code")
TrimPath = flag.String("trimpath", "", "remove prefix from recorded source file paths (unused TODO)")
)

View File

@ -54,7 +54,7 @@ func main() {
var ok bool
pList.Firstpc, ok = parser.Parse()
if !ok {
log.Print("FAIL TODO")
log.Fatalf("asm: assembly of %s failed", flag.Arg(0))
os.Exit(1)
}
obj.Writeobjdirect(ctxt, output)