Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/asm: a flag to dump Prog initialization as Go code #16342

Open
minux opened this issue Jul 13, 2016 · 5 comments
Open

cmd/asm: a flag to dump Prog initialization as Go code #16342

minux opened this issue Jul 13, 2016 · 5 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Proposal Proposal-Accepted
Milestone

Comments

@minux
Copy link
Member

minux commented Jul 13, 2016

When writing code for compiler backends, we sometimes
need to manual create assembly instructions by initializing
cmd/internal/obj.Prog structs directly. Even though
the revamped Addr types makes the task much easier than
it was, the process is still very error-prone and any mistakes
made there is pretty hard to diagnose.

I propose that we add an internal mode to cmd/asm that
instead of dumping .o object file, it prints the required
Prog initialization code to stdout.

I first discussed this with @cherrymui and we both liked the
idea.

Ideally, the new mode should be able to accept instruction
either from stdin, or better, from command line, so it is easier
to use from within an editor. This mode might also serve as
documentation for mapping instructions to Prog.

/cc @robpike @randall77 @ianlancetaylor

@minux minux added the Proposal label Jul 13, 2016
@minux minux added this to the Go1.8Early milestone Jul 13, 2016
@robpike
Copy link
Contributor

robpike commented Jul 13, 2016

Sounds like a good idea to me.

@josharian
Copy link
Contributor

Yes please. Re: reading from stdin, see also josharian@853cbde. It'd be nice to make sure the command line designs for these play nicely together.

@bradfitz bradfitz changed the title proposal: cmd/asm: a flag to dump Prog initialization as Go code cmd/asm: a flag to dump Prog initialization as Go code Aug 29, 2016
@adg
Copy link
Contributor

adg commented Aug 29, 2016

@josharian assigned to you. happy birthday. 😂

@josharian
Copy link
Contributor

Thank you? But you missed by several months... 📅 📅 📅

@cherrymui
Copy link
Member

FYI a while ago I wrote an incomplete CL https://go-review.googlesource.com/c/25390/. You may take it from there if you like :)

@rsc rsc modified the milestones: Unplanned, Go1.8Early Oct 18, 2016
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Proposal Proposal-Accepted
Projects
None yet
Development

No branches or pull requests

7 participants