Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1462)

Issue 5367043: code review 5367043: godefs: delete, replaced by cgo -godefs (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by rsc
Modified:
13 years, 4 months ago
Reviewers:
CC:
golang-dev, bradfitz, r, dave_cheney.net, iant
Visibility:
Public.

Description

godefs: delete, replaced by cgo -godefs Godefs was a C program that ran gcc and then parsed the stabs debugging information in the resulting object file to generate C or Go code for bootstrapping as part of package runtime or package syscall. Cgo does the same work, but using the dwarf debugging information. Add -godefs and -cdefs options to cgo that mimic godefs's output, albeit with different input (a Go program, not a C program). This has been a "nice to have" for a while but was forced by Apple removing stabs debugging output from their latest compilers. Fixes issue 835. Fixes issue 2338.

Patch Set 1 #

Patch Set 2 : diff -r 41fb9e7d3027 https://go.googlecode.com/hg #

Patch Set 3 : diff -r d946ec1f09f6 https://go.googlecode.com/hg #

Patch Set 4 : diff -r daa8c6dc4c42 https://go.googlecode.com/hg/ #

Total comments: 18

Patch Set 5 : diff -r 9870fbad1533 https://go.googlecode.com/hg #

Total comments: 5

Patch Set 6 : diff -r bf9901c10e5e https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+513 lines, -1589 lines) Patch
M src/cmd/Makefile View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M src/cmd/cgo/Makefile View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/cgo/ast.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/cgo/gcc.go View 1 2 3 4 5 13 chunks +168 lines, -22 lines 0 comments Download
A src/cmd/cgo/godefs.go View 1 2 3 4 1 chunk +285 lines, -0 lines 0 comments Download
M src/cmd/cgo/main.go View 1 2 3 4 5 chunks +57 lines, -31 lines 0 comments Download
M src/cmd/cgo/out.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
R src/cmd/godefs/Makefile View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
R src/cmd/godefs/a.h View 1 2 3 1 chunk +0 lines, -104 lines 0 comments Download
R src/cmd/godefs/doc.go View 1 2 3 1 chunk +0 lines, -99 lines 0 comments Download
R src/cmd/godefs/main.c View 1 2 3 1 chunk +0 lines, -609 lines 0 comments Download
R src/cmd/godefs/stabs.c View 1 2 3 1 chunk +0 lines, -456 lines 0 comments Download
R src/cmd/godefs/test.sh View 1 2 3 1 chunk +0 lines, -45 lines 0 comments Download
R src/cmd/godefs/testdata.c View 1 2 3 1 chunk +0 lines, -52 lines 0 comments Download
R src/cmd/godefs/testdata_darwin_386.golden View 1 2 3 1 chunk +0 lines, -38 lines 0 comments Download
R src/cmd/godefs/testdata_darwin_amd64.golden View 1 2 3 1 chunk +0 lines, -38 lines 0 comments Download
R src/cmd/godefs/testdata_linux_arm.golden View 1 2 3 1 chunk +0 lines, -38 lines 0 comments Download
R src/cmd/godefs/util.c View 1 2 3 1 chunk +0 lines, -36 lines 0 comments Download

Messages

Total messages: 14
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 4 months ago (2011-11-09 05:25:14 UTC) #1
bradfitz
http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/gcc.go File src/cmd/cgo/gcc.go (right): http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/gcc.go#newcode354 src/cmd/cgo/gcc.go:354: // Turn decimal into hex, just for consistency You ...
13 years, 4 months ago (2011-11-09 05:34:25 UTC) #2
rsc
On Wed, Nov 9, 2011 at 00:34, <bradfitz@golang.org> wrote: > Your other CL's diff had ...
13 years, 4 months ago (2011-11-09 05:39:37 UTC) #3
r
i haven't absorbed all this yet http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/gcc.go File src/cmd/cgo/gcc.go (right): http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/gcc.go#newcode27 src/cmd/cgo/gcc.go:27: "utf8" these aren't ...
13 years, 4 months ago (2011-11-09 05:49:04 UTC) #4
rsc
On Wed, Nov 9, 2011 at 00:49, <r@golang.org> wrote: > src/cmd/cgo/godefs.go:174: fmt.Fprintf(&out, "#pragma pack on\n") ...
13 years, 4 months ago (2011-11-09 05:53:44 UTC) #5
r
yay! hjdicks. i'm all teary-eyed. -rob
13 years, 4 months ago (2011-11-09 05:54:45 UTC) #6
dave_cheney.net
This looks pretty awesome, but where does it leave Linux/arm. Will we have to regenerate ...
13 years, 4 months ago (2011-11-09 06:00:05 UTC) #7
rsc
On Wed, Nov 9, 2011 at 00:59, Dave Cheney <dave@cheney.net> wrote: > This looks pretty ...
13 years, 4 months ago (2011-11-09 15:14:39 UTC) #8
iant
FYI http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/godefs.go File src/cmd/cgo/godefs.go (right): http://codereview.appspot.com/5367043/diff/2002/src/cmd/cgo/godefs.go#newcode163 src/cmd/cgo/godefs.go:163: // On first type definition, emit all the ...
13 years, 4 months ago (2011-11-09 16:09:38 UTC) #9
rsc
PTAL I have addressed Rob's and Ian's comments.
13 years, 4 months ago (2011-11-09 20:36:02 UTC) #10
r
LGTM the comments definitely help http://codereview.appspot.com/5367043/diff/12003/src/cmd/cgo/gcc.go File src/cmd/cgo/gcc.go (right): http://codereview.appspot.com/5367043/diff/12003/src/cmd/cgo/gcc.go#newcode1448 src/cmd/cgo/gcc.go:1448: // godefsFields rewrites field ...
13 years, 4 months ago (2011-11-09 21:27:41 UTC) #11
iant
LGTM http://codereview.appspot.com/5367043/diff/12003/src/cmd/cgo/gcc.go File src/cmd/cgo/gcc.go (right): http://codereview.appspot.com/5367043/diff/12003/src/cmd/cgo/gcc.go#newcode616 src/cmd/cgo/gcc.go:616: // the xxx. In *godefs mode, rewriteRef replaces ...
13 years, 4 months ago (2011-11-09 21:43:42 UTC) #12
rsc
On Wed, Nov 9, 2011 at 16:27, <r@golang.org> wrote: > i'd still like to see ...
13 years, 4 months ago (2011-11-09 22:18:16 UTC) #13
rsc
13 years, 4 months ago (2011-11-11 00:08:10 UTC) #14
*** Submitted as http://code.google.com/p/go/source/detail?r=700ff7ef684f ***

godefs: delete, replaced by cgo -godefs

Godefs was a C program that ran gcc and then parsed the
stabs debugging information in the resulting object file to
generate C or Go code for bootstrapping as part of
package runtime or package syscall.

Cgo does the same work, but using the dwarf debugging
information.  Add -godefs and -cdefs options to cgo that
mimic godefs's output, albeit with different input
(a Go program, not a C program).

This has been a "nice to have" for a while but was forced
by Apple removing stabs debugging output from their
latest compilers.

Fixes issue 835.
Fixes issue 2338.

R=golang-dev, bradfitz, r, dave, iant
CC=golang-dev
http://codereview.appspot.com/5367043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b