1
0
mirror of https://github.com/golang/go synced 2024-11-05 21:46:13 -07:00
Commit Graph

859 Commits

Author SHA1 Message Date
Andrew Gerrand
9d1940bc74 misc/makerelease: use windows installer resources from local goroot
This broke when we renamed the tool, and I missed this fix when I
fixed darwin last week.

LGTM=minux.ma, bradfitz
R=golang-codereviews, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/70670043
2014-03-03 12:50:29 +11:00
Andrew Gerrand
8d2465ab50 go/misc/makerelease: pin go-tour repo to a specific revision
We're about to commit some wide-sweeping changes to the go-tour and I
would rather not include them in Go 1.2.1, which is due in the next
week or so.

Also fix the makerelease tool; it has been broken since it was
renamed from bindist.

LGTM=campoy
R=campoy
CC=golang-codereviews
https://golang.org/cl/68780043
2014-02-28 11:09:26 +11:00
Shenghou Ma
bcf3d55ed9 misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD.
Fix build for 10.6 Darwin builders and OpenBSD builers.

LGTM=jsing
R=golang-codereviews, dave, jsing
CC=golang-codereviews
https://golang.org/cl/67710043
2014-02-23 20:37:43 -05:00
Shenghou Ma
d4a9bbef51 cmd/ld: don't emit unreachable dynimport symbols in ELF symtab.
Fix build for Dragonfly BSD.
Fixes #7318.
Fixes #7367.

LGTM=jsing, iant
R=jsing, iant, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/64340043
2014-02-23 16:20:40 -05:00
Dominik Honnef
cce25c88ce misc/emacs: add support for ff-find-other-file
c-mode classically uses ff-find-other-file to toggle between headers
and implementation. For Go it seemingly makes sense to jump between
implementation and test.

While there's no enforced mapping of file names for tests, the mapping
in this CL seems to be very common at least throughout the standard
library, and ff-find-other-file fails gracefully when the mapping
doesn't apply.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/65750044
2014-02-18 22:23:55 -05:00
Dominik Honnef
0d9b9aafd5 misc/emacs: actually use point argument that is passed to godef--call
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/62600043
2014-02-18 21:51:47 -05:00
Dmitriy Vyukov
bf0d71af29 runtime: more precise mprof sampling
Better sampling of objects that are close in size to sampling rate.
See the comment for details.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/43830043
2014-02-12 22:36:45 +04:00
Dmitriy Vyukov
fa3a2a84cc misc/pprof: support web profiles on windows
LGTM=bradfitz
R=golang-codereviews, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/61260044
2014-02-10 13:52:58 +04:00
Josh Bleecher Snyder
57bc80b5e8 cmd/go, doc/go1.3.txt: misc/benchcmp has been replaced by go tool benchcmp
Fixes #7016.

LGTM=r
R=r
CC=adg, bradfitz, dave, golang-codereviews
https://golang.org/cl/60100043
2014-02-04 11:53:13 -08:00
Ian Lance Taylor
1683dab725 cmd/ld: fix bug with "runtime/cgo" in external link mode
In external link mode the linker explicitly adds the string
constant "runtime/cgo".  It adds the string constant using the
same symbol name as the compiler, but a different format.  The
compiler assumes that the string data immediately follows the
string header, but the linker puts the two in different
sections.  The result is bad string data when the compiler
sees "runtime/cgo" used as a string constant.

The compiler assumption is in datastring in [568]g/gobj.c.
The linker layout is in addstrdata in ld/data.c.  The compiler
assumption is valid for string literals.  The linker is not
creating a string literal, so its assumption is also valid.

There are a few ways to avoid this problem.  This patch fixes
it by only doing the fake import of runtime/cgo if necessary,
and by only creating the string symbol if necessary.

Fixes #7234.

LGTM=dvyukov
R=golang-codereviews, dvyukov, bradfitz
CC=golang-codereviews
https://golang.org/cl/58410043
2014-01-30 09:25:47 -08:00
Russ Cox
abd556ab70 misc/cgo/testtls: make test less flaky
Now it should always fail on ARM.
(The fix is on its way too.)

R=iant, r, dave
CC=golang-codereviews
https://golang.org/cl/55140043
2014-01-21 19:44:51 -05:00
Rowan Worth
c4770b991b runtime: co-exist with NPTL's pthread_cancel.
NPTL uses SIGRTMIN (signal 32) to effect thread cancellation.
Go's runtime replaces NPTL's signal handler with its own, and
ends up aborting if a C library that ends up calling
pthread_cancel is used.

This patch prevents runtime from replacing NPTL's handler.

Fixes #6997.

R=golang-codereviews, iant, dvyukov
CC=golang-codereviews
https://golang.org/cl/47540043
2014-01-09 09:34:04 -08:00
Dominik Honnef
79653e4121 misc/emacs: fontify type switch correctly
Require at least one space after "type" and do not fontify closing
parenthesis of type switch as a type.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/37720050
2014-01-06 11:11:03 -05:00
Dominik Honnef
81cab4c3d3 misc/emacs: minor cleanups
R=adonovan
CC=golang-codereviews
https://golang.org/cl/23290044
2014-01-06 10:48:06 -05:00
Yasuhiro Matsumoto
7413e48d5b misc/vim: Fix broken quote
R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/44960043
2013-12-24 08:40:13 +11:00
ChaiShushan
33580e8305 misc/notepadplus: Fix Function List in Notepad++ 6.5
Since version 6.5, npp change the Function List syntax for User Defined Languages.
We need use userDefinedLangName syntax in association tag in Notepad++ 6.5.

Fix issue 6735.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/22770043
2013-12-18 10:17:38 -08:00
Shenghou Ma
e962f8f1c6 misc/vim: use shiftwidth() instead of &sw if available.
Fixes #6841.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/43010044
2013-12-16 20:05:48 -05:00
Andrew Gerrand
dba08e0615 misc/dist: rename to makerelease
The ambiguity has gone on too long.

R=golang-dev, minux.ma, r, dsymonds
CC=golang-dev
https://golang.org/cl/39920043
2013-12-11 14:47:18 +11:00
Alex Brainman
6ede93498c misc/cgo/testcdefs: rm correct file in test.bash
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/39780043
2013-12-10 12:06:24 +11:00
Alex Brainman
6795687427 cmd/cgo: use __gcc_struct__ for go exported functions
Fixes #6833

R=minux.ma, iant
CC=golang-dev
https://golang.org/cl/35790045
2013-12-10 11:30:12 +11:00
David Symonds
ee261b75e1 misc/vim: send Fmt errors to the quickfix list instead of the location list.
Output from gofmt is a list of errors, so they should appear in the error list.

R=adg
CC=golang-dev
https://golang.org/cl/33760043
2013-11-27 19:32:15 +11:00
David Symonds
74eb115b1c misc/vim: describe how to get gofmt-on-save behaviour.
Fixes #6826.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/31770043
2013-11-25 11:03:47 +11:00
Andrew Gerrand
7cfcd2f87a misc/dist: fix file regexp
This step makes it possible to upload the -osx10.x binaries
separately to their construction (after signing, for example).

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/28160043
2013-11-18 13:30:25 +11:00
David Crawshaw
c4f5421bc7 misc/vim: add a gofmt_command flag for :Fmt
R=dsymonds, dominik.honnef, n13m3y3r, rsc, kamil.kisiel
CC=golang-dev
https://golang.org/cl/22940044
2013-11-12 09:28:07 +11:00
Dominik Honnef
597b9c0d19 misc/emacs: various cleanups
- Use #' for function symbols
- Remove unused variables
- Use declare-function to shut up byte compiler

This is identical to CL 19010044 with one exception: Making sure
it doesn't break on Emacs 22.1

R=adonovan, bradfitz, shendaras
CC=golang-dev
https://golang.org/cl/20100043
2013-11-08 15:23:12 -05:00
Sameer Ajmani
19dda5cd74 emacs: allow users to customize the gofmt command, in particular, to use goimports instead.
R=adonovan
CC=golang-dev
https://golang.org/cl/23680043
2013-11-08 11:31:44 -05:00
Russ Cox
6be1cb8c7a cmd/cgo: fix handling of array of pointers when using clang
Clang does not record the "size" field for pointer types,
so we must insert the size ourselves. We were already
doing this, but only for the case of pointer types.
For an array of pointer types, the setting of the size for
the nested pointer type was happening after the computation
of the size of the array type, meaning that the array type
was always computed as 0 bytes. Delay the size computation.

This bug happens on all Clang systems, not just FreeBSD.
Our test checked that cgo wrote something, not that it was correct.
FreeBSD's default clang rejects array[0] as a C struct field,
so it noticed the incorrect sizes. But the sizes were incorrect
everywhere.

Update testcdefs to check the output has the right semantics.

Fixes #6292.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/22840043
2013-11-07 15:24:51 -05:00
Alan Donovan
75d5c4af71 undo CL 19010044 / dbcd720e5396
bradfitz reports:
> It breaks go-mode on GNU Emacs 22.1.1 as ships with OS X 10.8.6.

««« original CL description
misc/emacs: various cleanups

- Use #' for function symbols
- Remove unused variables
- Use declare-function to shut up byte compiler

R=adonovan
CC=golang-dev
https://golang.org/cl/19010044

»»»

R=bradfitz
CC=golang-dev
https://golang.org/cl/19640043
2013-10-29 22:17:14 -04:00
Dominik Honnef
22b3822da7 misc/emacs: various cleanups
- Use #' for function symbols
- Remove unused variables
- Use declare-function to shut up byte compiler

R=adonovan
CC=golang-dev
https://golang.org/cl/19010044
2013-10-29 13:07:42 -04:00
Dominik Honnef
3b0e6c21ae misc/emacs: support godef-jump on import statements
The newest version of godef supports jumping to a package's source
directory if point is on an import statement.

R=adonovan
CC=golang-dev
https://golang.org/cl/18230043
2013-10-29 11:14:56 -04:00
Andrew Gerrand
e7426010c5 misc/linkcheck: better redirect handling, use meaningful exit code
Prevent linkcheck from following redirects that lead beyond the outside
the root URL.

Return a non-zero exit code when there are problems.

Some minor refactoring for clarity.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14425049
2013-10-25 17:31:02 +03:00
Andrew Gerrand
9b321faae7 misc/dist: use go.tools release branch
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/15450047
2013-10-23 10:34:14 +04:00
Dominik Honnef
580ea8b5fd misc/emacs: handle empty "import ()" in go-goto-imports
R=adonovan
CC=golang-dev
https://golang.org/cl/14454058
2013-10-22 12:35:04 -04:00
Russ Cox
dbe2eacf04 cmd/cgo: fix line number in an error message
Fixes #6563.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14870046
2013-10-18 16:52:44 -04:00
Russ Cox
06ad3b2de1 cmd/cgo: stop using compiler error message text to analyze C names
The old approach to determining whether "name" was a type, constant,
or expression was to compile the C program

        name;

and scan the errors and warnings generated by the compiler.
This requires looking for specific substrings in the errors and warnings,
which ties the implementation to specific compiler versions.
As compilers change their errors or drop warnings, cgo breaks.
This happens slowly but it does happen.
Clang in particular (now required on OS X) has a significant churn rate.

The new approach compiles a slightly more complex program
that is either valid C or not valid C depending on what kind of
thing "name" is. It uses only the presence or absence of an error
message on a particular line, not the error text itself. The program is:

        // error if and only if name is undeclared
        void f1(void) { typeof(name) *x; }

        // error if and only if name is not a type
        void f2(void) { name *x; }

        // error if and only if name is not an integer constant
        void f3(void) { enum { x = (name)*1 }; }

I had not been planning to do this until Go 1.3, because it is a
non-trivial change, but it fixes a real Xcode 5 problem in Go 1.2,
and the new code is easier to understand than the old code.
It should be significantly more robust.

Fixes #6596.
Fixes #6612.

R=golang-dev, r, james, iant
CC=golang-dev
https://golang.org/cl/15070043
2013-10-18 15:56:25 -04:00
Andrew Gerrand
f5d25fd695 misc/dist: build race packages when os suffix present
The "darwin-amd64-osx10.8" target was not matching "darwin-amd64".

R=golang-dev
CC=golang-dev
https://golang.org/cl/14930043
2013-10-18 15:03:41 +09:00
Andrew Gerrand
73d7d12ea6 misc/dist: set default go.tools tag
Fixes #6607.

R=dsymonds
CC=golang-dev
https://golang.org/cl/14830043
2013-10-18 10:51:21 +09:00
Russ Cox
043ace1213 cmd/cgo: fix Xcode 5 incompatibility for #defined expressions
Ensure that clang always exits with a non-zero status by
giving it something that it always warns about (the statement "1;").

Fixes #6128.

R=golang-dev, iant, minux.ma
CC=golang-dev
https://golang.org/cl/14702043
2013-10-15 14:34:46 -04:00
Russ Cox
74f639176d misc/cgo/test: cut out non-standard functions
Otherwise the link fails. Fixes build.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/14483050
2013-10-15 14:25:29 -04:00
Russ Cox
94bd34fe50 misc/cgo/test: fix build (define prototype for alloca)
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/14454063
2013-10-15 13:46:57 -04:00
Russ Cox
56aeec31c6 cmd/cgo: work around bug in clang debug info for builtins like memset
Fixes #6506.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14682044
2013-10-15 12:46:14 -04:00
Ian Lance Taylor
cd61565ffc misc/cgo/test: fix C panic test to work with gccgo
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14611043
2013-10-11 11:24:54 -07:00
Andrew Gerrand
5f3a7aa217 go.tools/misc/dist: copy doc.go from go.tools to go root
This will allow "godoc godoc", "godoc vet", "godoc cover" to work.

Fixes #6527.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/14566049
2013-10-11 10:37:32 +09:00
Yasuhiro Matsumoto
5516349fe7 misc/vim: complete packages in src directory
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14454059
2013-10-11 11:30:03 +11:00
Dominik Honnef
950c284b11 misc/emacs: send correct content-length to the playground
R=adonovan
CC=golang-dev
https://golang.org/cl/14548049
2013-10-10 16:49:19 -04:00
Dominik Honnef
47bb44fd5b misc/emacs: don't treat (foo)(bar) as a function call when preceded by a word character.
Fixes #6531.

R=adonovan
CC=golang-dev
https://golang.org/cl/14523043
2013-10-10 16:30:20 -04:00
Ian Lance Taylor
c774e90208 cmd/go: add any .c/.cc files to the SWIG shared library
Also add the action's object directory to the list of
directories we use to find SWIG shared libraries.

Fixes #6521.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14369043
2013-10-09 10:35:46 -07:00
Ian Lance Taylor
cb30917387 runtime/cgo: mark callback functions as NOSPLIT
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14448044
2013-10-09 08:44:47 -07:00
Russ Cox
0965459bd9 debug/dwarf: handle surprising clang encoding
Fixes a bug in cgo on OS X using clang.
See golang.org/issue/6472 for details.

Fixes #6472.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14575043
2013-10-09 11:08:22 -04:00
Dominik Honnef
989a63eb0b misc/emacs: find unused imports where path and package name differ
The Go compiler emits extra information for this case:

imported and not used: "sandbox/foo_bar" as bar

R=adonovan
CC=golang-dev
https://golang.org/cl/14111043
2013-10-07 13:08:26 -04:00
Yasuhiro Matsumoto
45b830ed31 misc/vim: Autocompletion for :Godoc command
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14259043
2013-10-03 13:32:07 +10:00
Shenghou Ma
a978b1e049 misc/dist: support building statically linked toolchain.
so that we don't need worry about specifying the required
libc version (note: as cmd/go will still be dynamically
linked to libc, we still need to perform the build on OSes
with an old enough libc. But as cmd/go doesn't rely on many
libc symbols, the situation should be significantly better).

Fixes #3564.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14261043
2013-10-02 20:14:54 -04:00
Yasuhiro Matsumoto
fcee50c46e misc/vim: Separate package and package members.
This change allow to godoc:
    :Godoc github.com/mattn/go-gtk/gtk
    :Godoc github.com/mattn/go-gtk/gtk NewWindow
    :Godoc encoding/json
    :Godoc encoding/json Marshal

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14171043
2013-10-02 08:52:51 +10:00
Yasuhiro Matsumoto
d6eada282e misc/vim: "PACKAGE DOCUMENTATION" is not hilighted
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/14018043
2013-09-27 12:57:09 +10:00
Yasuhiro Matsumoto
b128426804 misc/vim: godoc is optional. so should point installation instruction.
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/14017043
2013-09-27 12:35:03 +10:00
Dmitriy Vyukov
39361170d4 misc/pprof: support block profile
Fixes #6347.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13845044
2013-09-23 14:15:20 -07:00
ChaiShushan
e82031618a misc/notepadplus: fix some number syntax highlight issue
notepadplus can only support some normal golang's hex and imaginary numbers.
it can't detect some special number, eg. 1./1.e/1.i/1+0.1i (omit "0" in ".0").

R=golang-dev, gvdschoot
CC=ajstarks, golang-dev
https://golang.org/cl/13401047
2013-09-23 11:35:17 +10:00
Andrew Gerrand
5ec8698862 misc/dist: add 'label' part of distro name, include blog content
This will allow us to cut binaries with names like:
        go1.2rc1.darwin-amd64-osx10.6.pkg
        go1.2rc1.darwin-amd64-osx10.8.pkg

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13629045
2013-09-19 16:51:29 +10:00
Shenghou Ma
db71e1557b cmd/go: fix missing __mingw_fprintf symbol for cgo on windows
Fixes #5986.

R=golang-dev, rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/13261055
2013-09-19 01:20:02 -04:00
Shenghou Ma
9add729a1f cmd/ld: handle duplicate static symbols in COFF and Mach-O files.
Fixes #5740.

R=iant, rsc, luisbebop
CC=gobot, golang-dev
https://golang.org/cl/10345046
2013-09-18 22:27:25 -04:00
Russ Cox
92dfbd3611 cmd/cgo: fix build (missing file from earlier CL)
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/13700045
2013-09-16 14:21:54 -04:00
Russ Cox
647eaed93b cmd/cgo: allow C.malloc(0) always
Because we can, and because it otherwise might crash
the program if we think we're out of memory.

Fixes #6390.

R=golang-dev, iant, minux.ma
CC=golang-dev
https://golang.org/cl/13345048
2013-09-16 14:04:55 -04:00
Andrew Gerrand
73790d407c misc/dist: include cover and vet, add -tool flag to specify go.tools tag
Fixes #6356.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13333052
2013-09-13 10:28:30 +10:00
Russ Cox
71ed6eb25a misc/cgo/test: test of issue 4339
This is not quite what that issue reports,
because this does not involve a DLL.
But I wanted to make sure this much was working.

Update #4339

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13653043
2013-09-11 09:56:38 -04:00
Emil Hessman
b6866f1945 misc/dist: Specify a version for the darwin package.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13383045
2013-09-09 09:36:39 +10:00
Dominik Honnef
b7a609b660 misc/emacs: use built-in buffer-base-buffer instead of own variable
R=adonovan
CC=golang-dev
https://golang.org/cl/13476043
2013-09-06 16:08:11 -04:00
ChaiShushan
640a57c881 misc/notepadplus: add interface to function list and use clang color in comments
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13587043
2013-09-06 11:59:53 -07:00
Aulus Egnatius Varialus
2b44b36487 cgo: enable cgo on dragonfly
Enable cgo for dragonfly/386 and dragonfly/amd64.

R=golang-dev, jsing, iant, bradfitz
CC=golang-dev
https://golang.org/cl/13247046
2013-09-04 15:19:21 -07:00
Ian Lance Taylor
f68c23e2bb cmd/cgo: don't let #cgo directives mess up line numbering
Fixes #5272.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13498046
2013-09-03 21:15:15 -07:00
Emil Hessman
8869cc159e misc/dist: remove Xcode files from the darwin binary distribution
Fixes #6132.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12858049
2013-08-30 10:11:18 +10:00
Brad Fitzpatrick
ccfe1bfd92 misc/pprof: work with either LWP::UserAgent or curl
Use either LWP::UserAgent or curl to make HTTP requests so it
works on Windows (most Perl distros include LWP::UserAgent),
and also on OS X (whose Perl at least sometimes doesn't
include LWP::UserAgent).

Fixes #6273

R=golang-dev, alex.brainman, cldorian
CC=golang-dev
https://golang.org/cl/13330044
2013-08-29 16:42:13 -07:00
Brad Fitzpatrick
2fb8022e58 misc: add linkcheck tool
Fixes #5378

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13247044
2013-08-29 12:08:11 -07:00
Shivakumar GN
daed1fee8b misc/pprof: pprof http used with net/http/pprof not working on windows/amd64
Removed posix assumptions in temporary file generation
Removed curl dependence
Changed opening of svg file

These must now work including symbol resolution.
[1] go tool pprof <prog_name> http://.../debug/pprof/profile
[2] go tool pprof http://.../debug/pprof/profile

Fixes 6177.

R=golang-dev, alex.brainman, bradfitz, kamil.kisiel
CC=golang-dev
https://golang.org/cl/13085043
2013-08-27 10:35:06 -07:00
Alan Donovan
264b73b3f2 misc/emacs: allow users to customize path of 'go' tool.
Some users have multiple Go development trees and invoke the
'go' tool via a wrapper that sets GOROOT and GOPATH based on
the current directory.  Such users should customize go-command
to point to the wrapper script.

R=dominik.honnef
CC=golang-dev
https://golang.org/cl/13233043
2013-08-27 09:47:58 -04:00
Emil Hessman
47ecd52377 misc/xcode: use xcode-select to determine path
If xcode-select is available, use it to determine the path to the
DVTFoundation.xcplugindata file.

Fixes #5997.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12741047
2013-08-20 20:48:29 +10:00
Aaron France
dccf651b24 misc/emacs: Detect stale coverage reports
When the coverage report file is older than the file we're
showing the coverage report for, then we show a simple message
to state this fact.

R=adonovan, dominik.honnef, bradfitz
CC=golang-dev
https://golang.org/cl/12919044
2013-08-19 16:32:00 -04:00
Dominik Honnef
29794b77dd misc/emacs: godef: print the entire description, not just the first line
When identifying structs or interfaces we really want to know
their makeup, not just their name.

R=adonovan
CC=golang-dev
https://golang.org/cl/13042043
2013-08-16 13:03:40 -04:00
Dominik Honnef
0b25ba9ced misc/emacs: allow godef to work in coverage buffers
Jumps to the same file will use the original buffer, not the
coverage buffer. Making it work for the coverage buffer isn't
worth the trouble, especially because it would break as soon as
you jump to a different file and back.

Use error instead of message so it actually terminates

R=adonovan
CC=golang-dev
https://golang.org/cl/13041043
2013-08-16 00:22:38 -04:00
Dominik Honnef
c320cf85d9 misc/emacs: do not use any free variables
R=adonovan
CC=golang-dev
https://golang.org/cl/12744046
2013-08-16 00:06:19 -04:00
Dominik Honnef
5f199f2d5a misc/emacs: when defining prog-mode, define it like GNU Emacs 24 would
Fixes #6156.

R=adonovan
CC=golang-dev
https://golang.org/cl/13035043
2013-08-15 20:40:38 -07:00
Andrew Gerrand
b1d64f20f2 misc/dist: don't copy godoc templates to lib/godoc
They're baked into the godoc binary now.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12751047
2013-08-16 13:14:13 +10:00
Dominik Honnef
3495aa298d misc/emacs: Refactor coverage code into multiple functions
Also fixes color gradient being calculated against the wrong maximum.

R=adonovan
CC=golang-dev
https://golang.org/cl/12968043
2013-08-15 22:37:16 -04:00
Dominik Honnef
3fe9b11cbb misc/emacs: Allow go-coverage to work in existing coverage buffers by reusing previous arguments
R=golang-dev, adonovan, bradfitz
CC=golang-dev
https://golang.org/cl/12721043
2013-08-14 16:03:44 -07:00
ChaiShushan
844bc6c0ac misc/notepadplus: support Calltips
Fixes #5789.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10601043
2013-08-14 13:41:36 +10:00
Alberto García Hierro
c18dc11ef2 cmd/cgo: Add support for C function pointers
* Add a new kind of Name, "fpvar" which stands for function pointer variable
* When walking the AST, find functions used as expressions and create a new Name object for them
* Track functions which are only used in expr contexts, and avoid generating bridge code for them

R=golang-dev, minux.ma, fullung, rsc, iant
CC=golang-dev
https://golang.org/cl/9835047
2013-08-13 12:42:21 -04:00
Dominik Honnef
4a0d06c4c5 misc/emacs: add support for mode=count coverage
Use the same algorithm that go tool cover uses when producing HTML
output to render coverage intensity.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12712043
2013-08-09 14:42:43 -07:00
Dominik Honnef
8a90456349 misc/emacs: clear previous overlays before adding new ones
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12578044
2013-08-09 08:56:15 -07:00
Shivakumar GN
88d544e01d misc/pprof: pprof on windows does not provide demangled names
Fixes #6034.

R=golang-dev, bradfitz, alex.brainman, dan.kortschak
CC=golang-dev
https://golang.org/cl/12311044
2013-08-09 13:42:24 +10:00
Dominik Honnef
6e5f4bab90 misc/emacs: Add support for code coverage output of go test
Renders code coverage as an overlay, replicating the look of the
HTML that go tool cover produces.

Also some cleanups.

R=adonovan, bradfitz
CC=golang-dev
https://golang.org/cl/12684043
2013-08-08 15:54:26 -07:00
ChaiShushan
d3450d85ec misc/notepadplus: fix functionList regex issue
The receiver name is optional. when Method's receiver name messing,
the functionList regex can't match the Method,
e.g. `func (*T) ProtoMessage() {}`.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12530044
2013-08-08 10:57:32 -07:00
Brad Fitzpatrick
d5e97ea2f5 build: change how cmd/api is run in run.bash and run.bat
In prep for Robert's forthcoming cmd/api rewrite which
depends on the go.tools subrepo, we'll need to be more
careful about how and when we run cmd/api.

Rather than implement this policy in both run.bash and
run.bat, this change moves the policy and mechanism into
cmd/api/run.go, which will then evolve.

The plan is in a TODO in run.go.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/12482044
2013-08-07 13:49:37 -07:00
ChaiShushan
7583c14be7 misc/notepadplus: simplify Function List regex
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12508043
2013-08-06 07:57:51 -07:00
Keith Randall
034d5fcc30 runtime: Use old reflect.call implementation from cgo.
Basically a partial rollback of 12053043 until I can
figure out what is really going on.
Fixes bug 6051.

R=golang-dev
CC=golang-dev
https://golang.org/cl/12496043
2013-08-05 17:53:08 -07:00
ChaiShushan
6abbbcdc75 misc/notepadplus: add Function List support
Fixes #6045.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12463043
2013-08-05 08:24:55 -07:00
Keith Randall
9cd570680b runtime: reimplement reflect.call to not use stack splitting.
R=golang-dev, r, khr, rsc
CC=golang-dev
https://golang.org/cl/12053043
2013-08-02 13:03:14 -07:00
Brad Fitzpatrick
b8b48abe0f misc/dist: don't ship cmd/api
cmd/api is a tool to prevent the Go developers from breaking
the Go 1 API promise. It has no utility to end users and
doesn't run on arbitrary packages (it's always been full of
hacks for its bespoke type checker to work on the standard
library)

Robert's in-progress rewrite depends on the go.tools repo for
go/types, so we won't be able to ship this tool later
anyway. Just remove it from binary distributions.

A future change to run.bash can conditionally build & run
cmd/api, perhaps automatically fetching go/types if
necessary. I assume people don't want to vendor go/types into
a private gopath just for cmd/api.

I will need help with run.bat.

R=golang-dev, adg, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/12316043
2013-08-02 10:19:52 -07:00
Andrew Gerrand
87380415e0 misc/dist: include godoc from go.tools
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12075045
2013-08-01 16:48:31 +10:00
Chris Manghane
acd1b6317d misc/dashboard/app, misc/dashboard/builder: delete from main repo; part of move to go.tools
See also https://golang.org/cl/12180043/

R=adg
CC=golang-dev
https://golang.org/cl/12213043
2013-08-01 13:27:27 +10:00
Dmitriy Vyukov
e84d9e1fb3 runtime: do not split stacks in syscall status
Split stack checks (morestack) corrupt g->sched,
but g->sched must be preserved consistent for GC/traceback.
The change implements runtime.notetsleepg function,
which does entersyscall/exitsyscall and is carefully arranged
to not call any split functions in between.

R=rsc
CC=golang-dev
https://golang.org/cl/11575044
2013-07-29 22:22:34 +04:00
Alex Brainman
6db195cae2 misc/dashboard/builder: increase cmdTimeout to 10 minutes
It takes more then 5 minutes to clone go repo
on windows-386 builder now.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12007043
2013-07-29 14:31:21 +10:00
David Symonds
e87af8c43d misc/dashboard: don't update tip tag for release branch commits.
This will mean that sub-repositories won't get built against the
release branch. They are often not compatible because the subrepos
often run ahead of the current release (e.g. go.tools is using
new additions to go/ast, and go.net is using new things in syscall)
so there's little point in checking them against cherrypick commits
when they'll be tested against those commits on tip anyway.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12001043
2013-07-29 12:08:19 +10:00
Dmitriy Vyukov
7da7d71cf4 misc/dashboard: fix typo in comment
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11936045
2013-07-27 13:54:34 +04:00
ChaiShushan
c44e483542 misc/notepadplus: use new User Defined Language system (UDL2)
Add missing single quotation and backslash marks.

Change dot and underscore character keyword type.
"_" is a predeclared identifier, not a operator.
"." is a selector, x.f should be one identifier highlight.
So the fix is to change it.

Fixes #5775.
Fixes #5788.
Fixes #5798.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10480044
2013-07-27 08:12:42 +10:00
Ian Lance Taylor
d9d3debee5 cmd/cgo: gccgo fixes
Don't require a full-scale callback for calls to the special
prologue functions.

Always use a simple wrapper function for C functions, so that
we can handle static functions defined in the import "C"
comment.

Disable a test that relies on gc-specific function names.

Fixes #5905.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11406047
2013-07-25 09:53:57 -04:00
Kevin Klues
f7dfeea90f cmd/cgo: Fix issue with cgo cdefs
The problem is that the cdecl() function in cmd/cgo/godefs.go isn't
properly translating the Go array type to a C array type when an
asterisk follows the [] in the array type declaration (it is perfectly
legal to put the asterisk on either side of the [] in go syntax,
depending on how you set up your pointers).

That said, the cdefs tool is only designed to translate from Go types
generated using the cgo *godefs* tool -- where the godefs tool is
designed to translate gcc-style C types into Go types. In essence, the
cdefs tool translates from gcc-style C types to Go types (via the godefs
tool), then back to kenc-style C types. Because of this, cdefs does not
need to know how to translate arbitraty Go types into C, just the ones
produced by godefs.

The problem is that during this translation process, the logic is
slightly wrong when going from (e.g.):

char *array[10];
to:
array [10]*int8;
back to:
int8 *array[10];

In the current implementation of cdecl(), the translation from the Go
type declaration back to the kenc-style declaration looks for Go
types of the form:

name *[]type;
rather than the actual generated Go type declaration of:
name []*type;

Both are valid Go syntax, with slightly different semantics, but the
latter is the only one that can ever be generated by the godefs tools.
(The semantics of the former are not directly expressible in a
single C statement -- you would have to have to first typedef the array
type, then declare a pointer to that typedef'd type in a separate
statement).

This commit changes the logic of cdecl() to look properly for, and
translate, Go type declarations of the form:
name []*type;

Additionally, the original implementation only allowed for a single
asterisk and a single sized aray (i.e. only a single level of pointer
indirection, and only one set of []) on the type, whereas the patched
version allows for an arbitrary number of both.

Tests are included in misc/cgo/testcdefs and the all.bash script has been
updated to account for these.

R=golang-dev, bradfitz, dave, iant
CC=golang-dev
https://golang.org/cl/11377043
2013-07-24 17:27:42 -07:00
Dominik Honnef
6e37bc1eec misc/emacs: replace our go-goto-opening-parenthesis with backward-up-list
R=adonovan
CC=golang-dev
https://golang.org/cl/11524045
2013-07-24 13:48:04 -04:00
Dominik Honnef
9c6fecc2da misc/emacs: Make godef-jump behave more like find-tag by supporting pop-tag-mark
Push point to the find-tag marker ring to support pop-tag-mark.

Fixes #5804.

R=adonovan
CC=golang-dev
https://golang.org/cl/11457044
2013-07-24 11:20:53 -04:00
Russ Cox
4d17efe81b misc/cgo/test: test recursive internal OS thread lock
This would have failed with CL 11663043.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11480045
2013-07-23 14:43:55 -04:00
Dmitriy Vyukov
9fe4a9ecdd misc/cgo/test: add test for cgo callbacks with different amount of stack space available
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11677043
2013-07-22 21:53:20 +04:00
Dominik Honnef
58ce655fd2 misc/emacs: Add godef-jump-other-window
This will behave like similar "*-other-window" functions in Emacs.

Default key bind is C-x 4 C-c C-j – while awkward, it follows both
the convention for other-window functions and the convention for
not using user- or emacs-reserved keys.

R=golang-dev, adonovan
CC=golang-dev
https://golang.org/cl/10707045
2013-07-17 18:16:44 -04:00
Shenghou Ma
3d236aed9a misc/cgo/test: skip test for issue 3250, the runtime isn't ready yet.
see issue 5885.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10914045
2013-07-15 14:37:36 +08:00
Alexandre Normand
bbb51ae3a9 dist: fix postinstall script for Darwin
The postinstall script causes the installation to fail because the last
step that copies files for Xcode is broken. Two details can cause the
command to fail:
  1. The XCODE_MISC_DIR value has a space. Without quotes in the cp
     command, cp will just complain that this is an invalid syntax.
  2. The source of the cp is a directory with two subdirectories.
     We actually want the files for either Xcode 3 or Xcode 4 to be copied.
     Using xcodebuild -version, we check for the Xcode version and
     select which of xcode/3/* or xcode/4/* should be the source
     of the copy.

Fixes #5874.

R=golang-dev, minux.ma, adg
CC=golang-dev
https://golang.org/cl/10893044
2013-07-15 10:52:38 +10:00
Shenghou Ma
39b5f3a451 misc/cgo/test: relax the threshold in test3250.
Fixes build for some slow FreeBSD/NetBSD/Darwin builder.

R=golang-dev
CC=golang-dev
https://golang.org/cl/11207043
2013-07-12 14:13:59 +08:00
Russ Cox
41fd4f988c misc/cgo/test: make test work with -linkmode=internal
The static func named thread in issue5337.go's C snippet
conflicts with the static func named thread in issue3350.go's C snippet.
I don't know why (they're both static) but I also don't care,
because -linkmode=internal only needs to be able to handle
the cgo in the standard library, and it does.

Change the test to avoid this problem.

Fixes build (after run.bash is fixed to detect the breakage).

R=minux.ma
TBR=minux.ma
CC=golang-dev
https://golang.org/cl/11201043
2013-07-11 23:24:35 -04:00
ChaiShushan
8529d99e1d misc/goplay: use go run x.go instead of go build x.go
when the program is not main package, `go run x.go` can't return the
link error message. so use `go run x.go` in instead `go build x.go`.

Fixes #5865.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11165043
2013-07-12 09:41:10 +10:00
Shenghou Ma
2f1ead7095 runtime: correctly handle signals received on foreign threads
Fixes #3250.

R=rsc
CC=golang-dev
https://golang.org/cl/10757044
2013-07-12 04:39:39 +08:00
Andrew Gerrand
47a89693e9 misc/dist: clean files from GOPATH after building tour
Fixes #5503.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10989043
2013-07-08 11:45:33 +10:00
Yasuhiro Matsumoto
efced7c6e9 misc/vim: Allow multiple GOOS/GOARCH.
R=golang-dev, dsymonds, dominik.honnef
CC=golang-dev
https://golang.org/cl/9293043
2013-07-02 15:24:09 +10:00
David Bürgin
aec6b49aae misc/vim: Add compiler plugin for Go
This change adds a basic compiler plugin for Go. The plugin
integrates "go build" with Vim's ":make" command and the
quickfix list.

Fixes #5751.

R=golang-dev, dsymonds, niklas.schnelle, 0xjnml
CC=golang-dev
https://golang.org/cl/10466043
2013-07-01 16:20:50 +10:00
Charles Lee
d9f5c64f6e misc/emacs: fix godef-jump on Windows.
Fixes #5555.

R=adonovan, dominik.honnef, iant
CC=gobot, golang-dev
https://golang.org/cl/9762045
2013-06-26 13:59:25 -07:00
Dmitriy Vyukov
1579020476 misc/dashboard: show all race builders as "race"
race is more important than arch (moreover race implies x64)
don't know how to test it

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/10484046
2013-06-26 21:20:53 +04:00
ChaiShushan
6db28ee8e0 misc/{bbedit|IntelliJIDEA|kate}: add missing delete predeclared identifier
In general the description should describe what is added or fixed,
not how it was done (the code does this), but in this case the cause
was delete was missing, so the fix is to add it.

Fixes  issue 5765.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/10496043
2013-06-24 13:17:56 -07:00
ChaiShushan
ecdbcaf449 misc/notepadplus: add missing operator keyword
In general the description should describe what is added or fixed,
not how it was done (the code does this), but in this
case the cause were "/ /= ;" was missing,
so the fix is to add it.

Fixes #5761.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/10479043
2013-06-24 14:19:00 +10:00
ChaiShushan
f0f97c1f47 misc/notepadplus: add missing delete keyword
In general the description should describe what is added or fixed, not how it was done (the code does this), but in this case the cause was delete was missing, so the fix is to add it.

Fixes #5759.

R=adg
CC=dave, dominik.honnef, gobot, golang-dev
https://golang.org/cl/10476043
2013-06-24 13:28:10 +10:00
David Bürgin
c1e780c4e4 misc/vim: Added filetype settings for comments.
This basic Vim ftplugin sets the 'comments' and 'commentstring'
settings to sensible values. Future filetype settings for Go
would go in the same file.
The ftplugin was added as misc/vim/ftplugin/go/go.vim, this way
the installation instructions in readme.txt remain valid.
Fixes #5715.

R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/10323043
2013-06-18 14:59:50 +10:00
Josh Hoak
b76ddefee5 misc/vim: Adding flag-guarding for Vim commands
Default behavior is the same as before, but now a user may selectively disable some commands.

Also: deleted the mappings for import.vim.

Tested: by trying the commands for fmt, import and godoc in succession to make sure they still work. Also, ran test.sh in ftplugin/go.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/10124043
2013-06-13 15:07:09 +10:00
Russ Cox
d67e7e3acf runtime: add lr, ctxt, ret to Gobuf
Add gostartcall and gostartcallfn.
The old gogocall = gostartcall + gogo.
The old gogocallfn = gostartcallfn + gogo.

R=dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/10036044
2013-06-12 15:22:26 -04:00
Dmitriy Vyukov
a8ad859c30 runtime: more flexible heap memory mapping on 64-bits
Fixes #5641.

R=golang-dev, dave, daniel.morsing, iant
CC=golang-dev, kcc
https://golang.org/cl/10126044
2013-06-12 18:47:16 +04:00
Shenghou Ma
949228a322 cmd/cgo: use gcc_struct attribute for packed structs to work around GCC PR52991.
Fixes #5603.

R=iant, dave
CC=gobot, golang-dev
https://golang.org/cl/9895043
2013-06-09 22:06:29 +08:00
Shenghou Ma
37c81d5870 misc/pprof: fix html5 doctype declaration
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10099045
2013-06-09 22:01:03 +08:00
Rémy Oudompheng
902ee9ae8f misc/pprof: register cnew and runtime.cnewarray as malloc wrappers.
These functions were introduced by revision 139919984600
and should not show up on profiles for consistency.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10003043
2013-06-05 00:40:49 +02:00
Shenghou Ma
5b097e7951 cmd/cgo: using __typeof__(a->r) instead of putting invalid TYPE in "a->r = (const TYPE)"
Thanks kballard for the hint.
Fixes #4857.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9649045
2013-06-02 22:46:53 +08:00
Anthony Martin
252161cadc misc/dashboard/builder: add environment variables for Plan 9
We require $objtype in make.rc and rc needs $path for finding commands.

Also include $cputype which we may use in the future.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/9905043
2013-05-31 12:18:43 -07:00
Alex Brainman
77d4347bf2 misc/dist: remove lingering ~ file
Fixes #5405.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/9856043
2013-05-30 12:11:17 +10:00
Shenghou Ma
a307c5c9b7 misc/cgo/test: check API compatibility for cgo pseudo-functions
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9826043
2013-05-30 02:59:57 +08:00
Dave Cheney
2ca589d494 misc/cgo/testso: use bash to run test.bash
R=golang-dev, minux.ma, capnm9
CC=golang-dev
https://golang.org/cl/9717043
2013-05-24 07:56:01 -04:00
Ian Lance Taylor
8f7863d638 cmd/cgo: use intgo, not int, for string and slice structures
Fixes #5548.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9643044
2013-05-23 22:51:07 -07:00
Brad Fitzpatrick
3b7dcf074f codereview: close the head tag
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9695045
2013-05-23 14:13:39 -07:00
Dominik Honnef
4e15dbe082 misc/emacs: Do not modify kill ring when programmatically deleting text
Operations like gofmt and go-remove-unused-imports delete entire
lines of text. Previously this put them on the kill-ring,
negatively affecting user experience.

R=adonovan
CC=gobot, golang-dev
https://golang.org/cl/9605043
2013-05-23 10:19:03 -07:00
Shenghou Ma
bea7b51872 cmd/go: fix LDFLAGS handling, enable misc/cgo/testso on Darwin
Fixes #5479.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/9416047
2013-05-22 00:32:03 +08:00
Brad Fitzpatrick
09395daf2e codereview: add khr as a person
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9459046
2013-05-21 09:02:30 -07:00
Shenghou Ma
523b3bc434 misc/dashboard/builder: handle Plan 9 in defaultSuffix()
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9495045
2013-05-21 03:22:52 +08:00
Dave Cheney
c3dbe5d24c misc/dashboard: add go.tools to list of subrepos
R=r, adg, dsymonds
CC=golang-dev
https://golang.org/cl/9535044
2013-05-19 10:04:23 +10:00
Shenghou Ma
af1dd56d1b misc/cgo/test: deflake TestParallelSleep once more
Fixes #5480.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9475043
2013-05-18 02:55:44 +08:00
Rob Pike
9e643ac20e misc/dashboard/codereview: add cshapiro and mpvl to reviewers list.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9104052
2013-05-15 10:25:02 -07:00
Alex Brainman
3de593d94b misc/cgo/test: add missing import
Fixes windows build.

R=golang-dev
CC=golang-dev
https://golang.org/cl/9429043
2013-05-15 15:34:47 +10:00
Shenghou Ma
512ec7036e misc/cgo/test: test for issue 5337.
Test for CL 9226043.

R=golang-dev, dave, iant, bradfitz
CC=golang-dev
https://golang.org/cl/9249043
2013-05-15 12:33:29 +08:00
Dominik Honnef
72b14cbb75 misc/emacs: Add support for methods with unnamed receiver
This fixes fontification, navigation and indentation for methods
of the form `func (Foo) Bar...`

R=adonovan
CC=gobot, golang-dev
https://golang.org/cl/8951043
2013-05-14 20:23:35 -07:00
Bill Thiede
27f7e3b217 misc/vim: test.sh seems to only work on Mac OS X.
cmp(1) on FreeBSD requires two file arguments.  grep -P on Linux (at least
Ubuntu 12.04) is described in the man page as "This is highly
experimental" and doesn't seem to work. On FreeBSD the man page states
"This option  is not supported in FreeBSD."  Needed this to work while
debugging some funky behavior of 'Import' in my local vim setup.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7675043
2013-05-14 09:54:16 -07:00
Shenghou Ma
5b78cee376 runtime: fix stack pointer corruption in runtime.cgocallback_gofunc()
runtime.setmg() calls another function (cgo_save_gm), so it must save
LR onto stack.
Re-enabled TestCthread test in misc/cgo/test.

Fixes #4863.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9019043
2013-04-30 04:13:32 +08:00
Shenghou Ma
8c72b81132 misc/cgo/testso: enable test on windows
Depends on CL 8715043 and CL 8676050.
Fixes #5273.

R=alex.brainman, r
CC=gobot, golang-dev
https://golang.org/cl/8764043
2013-04-23 04:42:04 +08:00
Dave Cheney
de2fcae372 misc/dashboard/builder: always do a native build
https://golang.org/cl/8134043 disabled cgo when cross compiling, this means builders which compile for both amd64 and 386 will be compiling the latter with cgo disabled.

This proposal modifies the builder to mirror the dist tool by always doing a native build.

Tested on my darwin/amd64 builder and confirmed the result when building darwin/386 is a native 386 build with cgo enabled.

R=bradfitz, dsymonds, r, adg
CC=golang-dev
https://golang.org/cl/8842044
2013-04-18 16:42:56 +10:00
David Symonds
67e26fceb5 misc/dashboard/builder: include $USER in build environment.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8821046
2013-04-18 11:04:20 +10:00
Shenghou Ma
a4196bb6c8 misc/cgo/test: fix a gcc warning
See https://code.google.com/p/go/issues/detail?id=5227#c16.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8833044
2013-04-18 02:33:55 +08:00
Rob Pike
1d1142f178 misc/dist/darwin: add execute bit to preinstall
Fixes #5258.

R=golang-dev, iant, minux.ma
CC=golang-dev
https://golang.org/cl/8682043
2013-04-11 13:40:14 -07:00
Andrew Wilkins
d06be395cc cmd/cgo, cmd/go: remove #cgo directive parsing from cmd/cgo
This change removes processing of #cgo directives from cmd/cgo,
pushing the onus back on cmd/go to pass all necessary flags.

Fixes #5224. See comments for rationale.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8610044
2013-04-10 21:41:54 -07:00
Rémy Oudompheng
0e76a943c9 cmd/ld: fix inconsistency in internal linking of common symbols.
Some variables declared in C could end up as undefined symbols
in the final binary and have null address.

Fixes #5114.
Fixes #5227.

R=golang-dev, iant, ajstarks, dave, r
CC=golang-dev
https://golang.org/cl/8602044
2013-04-10 07:15:49 +02:00
Andrew Gerrand
81063812b4 dist: add .exe extension to tour.exe
Fixes #5246.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8558044
2013-04-09 18:17:55 +10:00
Andrew Gerrand
0ccfbea5b0 dist: include js directory in misc/tour in binary distros
R=campoy, dsymonds
CC=golang-dev
https://golang.org/cl/8564043
2013-04-09 17:51:55 +10:00
Dave Cheney
26312afd7b misc/dashboard/builder: add -race builder support
If the build key contains -race, the builder will invoke to the race.{bat,bash} build command. This allows {darwin,linux,windows}-amd64 builders to do race and non race builds in sequence.

R=adg, dvyukov, fullung
CC=golang-dev
https://golang.org/cl/8266046
2013-04-09 12:48:04 +10:00
Jonathan Rudenberg
44c4a0d1c4 misc: update zsh completion
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/8437043
2013-04-07 04:11:12 +08:00
Andrew Gerrand
edca83e23a misc/dist: only build race toolchain where available, fix file upload
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8343046
2013-04-04 14:46:54 +11:00
Andrew Gerrand
5d1c7bd1a6 misc/dist: add -version flag to override version name
Also, don't build the tour when making the source distribution.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8354043
2013-04-04 14:21:19 +11:00
Andrew Gerrand
1b9e36356b misc/dist: don't ship race-enabled commands
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8350044
2013-04-04 12:07:53 +11:00
Andrew Gerrand
57af97f2f4 misc/dist: include race detector packages in binary distributions
Fixes #4596.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8327045
2013-04-04 08:06:29 +11:00
Dominik Honnef
0104cea6c8 misc/emacs: Enable compilation-mode for gofmt error buffer before displaying it.
Some packages, like popwin.el, change display behaviour based on
the buffer's mode, so we should enable compilation-mode before
displaying the buffer.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8155043
2013-03-30 09:54:08 -07:00
Andrey Mirtchovski
06ed730d87 misc/cgo/gmp: fix typo.
R=golang-dev, minux
CC=golang-dev
https://golang.org/cl/8174045
2013-03-30 19:02:14 +08:00
Dave Cheney
5851b974a3 misc/dashboard/codereview: add Rémy to the list of assignees
R=dsymonds, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/8094047
2013-03-30 15:53:44 +11:00
Ian Lance Taylor
30e29ee9b6 cmd/ld: emit TLS relocations during external linking
This CL was written by rsc.  I just tweaked 8l.

This CL adds TLS relocation to the ELF .o file we write during external linking,
so that the host linker (gcc) can decide the final location of m and g.

Similar relocations are not necessary on OS X because we use an alternate
program start-time mechanism to acquire thread-local storage.

Similar relocations are not necessary on ARM or Plan 9 or Windows
because external linking mode is not yet supported on those systems.

On almost all ELF systems, the references we use are like %fs:-0x4 or %gs:-0x4,
which we write in 6a/8a as -0x4(FS) or -0x4(GS). On Linux/ELF, however,
Xen's lack of support for this mode forced us long ago to use a two-instruction
sequence: first we load %gs:0x0 into a register r, and then we use -0x4(r).
(The ELF program loader arranges that %gs:0x0 contains a regular pointer to
that same memory location.) In order to relocate those -0x4(r) references,
the linker must know where they are. This CL adds the equivalent notation
-0x4(r)(GS*1) for this purpose: it assembles to the same encoding as -0x4(r)
but the (GS*1) indicates to the linker that this is one of those thread-local
references that needs relocation.

Thanks to Elias Naur for reminding me about this missing piece and
also for writing the test.

R=r
CC=golang-dev
https://golang.org/cl/7891047
2013-03-27 13:27:35 -07:00
Carl Shapiro
8480e6f476 runtime: ensure forward progress when unwinding an arm stack frame
The arm gentraceback mishandled frame linkage values pointing
to the assembly return function.  This function is special as
its frame size is zero and it contains only one instruction.
These conditions would preserve the frame pointer and result
in an off by one error when unwinding the caller.

Fixes #5124

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8023043
2013-03-26 11:43:09 -07:00
Yasuhiro Matsumoto
d7434816c1 misc/vim: make Godoc command work with "log.Print".
R=dsymonds
CC=golang-dev
https://golang.org/cl/7757043
2013-03-26 17:39:46 +11:00
Carl Shapiro
4cb921bbf1 runtime: store asmcgocall return PC where the ARM unwind expects it
The ARM implementation of runtime.cgocallback_gofunc diverged
from the calling convention by leaving a word of garbage at
the top of the stack and storing the return PC above the
locals.  This change stores the return PC at the top of the
stack and removes the save area above the locals.

Update #5124
This CL fixes first part of the ARM issues and added the unwind test.

R=golang-dev, bradfitz, minux.ma, cshapiro, rsc
CC=golang-dev
https://golang.org/cl/7728045
2013-03-25 14:10:28 -07:00
Dominik Honnef
4ad1a87f85 misc/emacs: Derive mode from prog-mode if possible
R=golang-dev, bradfitz
CC=adonovan, cw, golang-dev, patrick.allen.higgins
https://golang.org/cl/7956044
2013-03-25 08:58:13 -07:00
Oling Cat
80234d5c6b misc/kate: fix multiline raw string syntax highlighting error.
From VisualFC.
Fixes #4862.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/7568043
2013-03-23 15:16:58 -07:00
Dominik Honnef
c7ad7a1af4 misc/emacs: Kill gofmt error buffer if the buffer was formatted correctly already.
R=adonovan, cw, patrick.allen.higgins, bradfitz
CC=golang-dev
https://golang.org/cl/7844045
2013-03-21 20:03:27 -07:00
Ian Lance Taylor
eeb9822457 misc/swig: remove old broken Makefile
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7786046
2013-03-20 08:06:58 -07:00
Robert Griesemer
ddddd70cd2 misc/dashboard: show correct dir name in README
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7909043
2013-03-19 12:49:46 -07:00
Dominik Honnef
24f476409c misc/emacs: Add support for godef
godef[1][2] is a third party tool for printing information about
expressions, especially the location of their definition. This can be
used to implement a "jump to definition" function. Unlike
cross-language solutions like ctags, godef does not require an index,
operates on the Go AST instead of symbols and works across packages,
including the standard library.

This patch implements two new public functions: godef-describe (C-c
C-d) and godef-jump (C-d C-j). godef-describe describes the expression
at point, printing its type, and godef-jump jumps to its definition.

[1]: https://code.google.com/p/rog-go/source/browse/exp/cmd/godef/
[2]: go get code.google.com/p/rog-go/exp/cmd/godef

R=adonovan, cw, patrick.allen.higgins, sameer
CC=golang-dev
https://golang.org/cl/7781043
2013-03-19 11:29:28 -04:00
Joe Poirier
b7b4783622 misc/dist: fix Windows breakage
The files could use some attention on the
Windows side but better to wait until after
the upcoming release.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7621044
2013-03-18 08:56:38 +11:00
David Symonds
247bc72131 misc/dashboard/codereview: better debugging when some fetches fail.
R=rsc
CC=golang-dev
https://golang.org/cl/7836045
2013-03-15 14:45:00 +11:00
David Symonds
b7f29e259d misc/dashboard/codereview: add more people.
I picked everyone who has committed a CL on behalf of someone else in recent times.

R=r, rsc
CC=golang-dev
https://golang.org/cl/7836044
2013-03-15 14:33:00 +11:00
Jeff R. Allen
8c2b6226f7 misc/pprof: fix address lookup regression on Linux
Just use "go tool addr2line" no matter what, since we know
it works for all OSs.

Fixes #4818.

R=rsc, r
CC=golang-dev
https://golang.org/cl/7526047
2013-03-13 09:40:38 -07:00
Dominik Honnef
69eb345727 misc/emacs: Fix indentation for code following multiline function declarations
Correctly indent the body of functions that have been declared
over multiple lines. See http://play.golang.org/p/MHMwNDbFyf for
an example.

Previously, the body of the function would be indented as deep as
the continuation line of the function declaration. Now it gets
indented as deep as the func keyword.

R=adonovan, cw, patrick.allen.higgins
CC=golang-dev
https://golang.org/cl/7628043
2013-03-12 21:37:18 -07:00
Benny Siegert
f878b67b0f misc/bbedit, misc/notepadplus: remove executable bits from files.
R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/7765043
2013-03-12 14:29:25 -07:00
Russ Cox
a25c403b3a cmd/pprof: never use c++filt
The copy of c++filt shipped on OS X is six years old,
and in our case it does far more mangling than it
does demangling. People on non-OS X systems will
have a working nm --demangle, so this won't affect them.

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.8.2
BuildVersion:	12C2034
$ c++filt --version
GNU c++filt 070207 20070207
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
$

$ go tool nm -n revcomp | grep quoteWith
   4f560 T strconv.quoteWith
$ go tool nm -n revcomp | grep quoteWith  | c++filt
   f560 T strconv.quoteWith
$

$ nm -n revcomp | grep quoteWith
000000000004f560 t _strconv.quoteWith
$ nm -n revcomp | grep quoteWith | c++filt
000000000004f560 unsigned short _strconv.quoteWith
$

Fixes #4818.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/7729043
2013-03-11 18:15:23 -04:00
Andrew Gerrand
77d6cf1cd5 misc/dashboard: add go.blog sub-repo to dashboard
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7690043
2013-03-11 11:06:21 +11:00
Dominik Honnef
77ddbf1ff0 misc/emacs: Rewrite gofmt to use own function for applying patch instead of using diff-mode.
Instead of relying on gofmt's diff output (which is a unified
    diff), we manually invoke diff -n and produce an RCS format diff,
    which can easily be parsed in Emacs, with the go--apply-rcs-patch
    function.

    This fixes undocumented issues with the old implementation such as
    skipping over hunks of changes, and it fixes the documented issue
    of not being able to handle file names that include whitespace.

    It can also apply the patch on a buffer that has no file name
    attached at all.

    Last but not least, it greatly simplifies the gofmt function
    itself.

Fixes #4766.
Fixes #4475.

R=adonovan, cw, patrick.allen.higgins, sameer
CC=golang-dev
https://golang.org/cl/7516046
2013-03-07 13:12:37 -05:00
Russ Cox
8aafb44b0b runtime: fix cgo callbacks on windows
Fixes #4955.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/7563043
2013-03-07 09:18:48 -05:00
Alex Brainman
2f23f90dab runtime,misc/cgo/test: disable broken tests so we can test the rest
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7486048
2013-03-06 15:19:01 -05:00
Russ Cox
77deeda717 misc/cgo/test: do not stop on first error
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7529043
2013-03-06 15:03:28 -05:00
Dominik Honnef
cf8434fa31 misc/emacs: Add compatibility for GNU Emacs 23 and XEmacs >=21.5.32
This CL adds compatibility for GNU Emacs 23 (fixing fontification
issues) and XEmacs >=21.5.32 (fixing a lot of issues). Earlier
versions of XEmacs will not be supported because they do not
support POSIX character classes. Because of that, we also make use
of a lot of functions that were added in 21.5.32.

A known and currently unfixable issue with XEmacs is that go-mode
will not always fontify identifiers that use unicode correctly.

All changes for XEmacs are annotated in the diff.

Note: go--position-bytes is not currently used anywhere, but will
be in a future CL.

Fixes #4927.

R=golang-dev, adonovan, cw, patrick.allen.higgins, sameer
CC=golang-dev
https://golang.org/cl/7456051
2013-03-06 14:35:29 -05:00
Dominik Honnef
a969f3c247 misc/emacs: Add tab completion for godoc command, completing from known installed packages
R=golang-dev, adonovan, bradfitz, cw, patrick.allen.higgins, sameer, ugorji
CC=golang-dev
https://golang.org/cl/7373051
2013-03-04 15:31:57 -05:00
Russ Cox
7c68f7876a misc/dashboard/builder: make -fail mode faster
Don't check out the repository if we're just going to fail everything.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7453048
2013-03-04 10:31:01 -05:00
Shenghou Ma
0acda4e87d misc/dashboard/app: make the builders test go.talks and go.exp
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7419048
2013-03-03 03:17:14 +08:00
Tyler Bunnell
65983695fb misc/dist: handle previous installation
The installer package will now detect a previous installation and warn the user
that the previous installation will be deleted. If the user continues, the
installer will delete the previous installation and install the package as
usual.

Fixes #4293.

R=adg
CC=golang-dev
https://golang.org/cl/7427044
2013-02-28 16:09:48 +11:00
Andrew Gerrand
76e4a03352 misc/osx: remove legacy packaging scripts
These are superseded by the tool at misc/dist.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7420044
2013-02-28 10:39:09 +11:00
Dominik Honnef
b302d68ebc misc/emacs: Greatly improve go-mode for Emacs.
The original go-mode is plagued with odd behaviour, lack of
behaviour typical to modes in Emacs and bugs.

This change rewrites great parts of go-mode (basically only
keeping the gofmt and godoc functions).

Additionally it adds new features such as manipulating package
imports.

For more information please see
https://groups.google.com/group/golang-nuts/browse_frm/thread/3a9d6dae3369c0b5/1efe65e2f7afb190

Fixes #3618.
Fixes #4240.
Fixes #4322.
Fixes #4671.
Fixes #4726.

R=golang-dev, fullung, sameer, cw, arthur, proppy, adonovan, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7314113
2013-02-26 13:48:32 -05:00
Dave Cheney
4036d876ea misc/dashboard/builder: various cleanups
* allow commit watcher to be disabled, useful for small slow builders who will never be the first to notice a commit.
* builders always update their local master working copy before cloning a specific revision.
* refactor hg repo operations into a new type, Repo.

R=adg, shanemhansen, luitvd
CC=golang-dev
https://golang.org/cl/7326053
2013-02-21 13:11:58 +11:00
Russ Cox
6c976393ae runtime: allow cgo callbacks on non-Go threads
Fixes #4435.

R=golang-dev, iant, alex.brainman, minux.ma, dvyukov
CC=golang-dev
https://golang.org/cl/7304104
2013-02-20 17:48:23 -05:00
Steven Elliot Harris
43da336b15 misc/emacs: Present "godoc" documentation buffers using view-mode.
Mimic the Emacs convention of presenting read-only files meant
for browsing using view-mode, rather than Fundamental mode
which mistakenly allows editing of the "godoc" content.
Fixes #4322.

R=golang-dev, bradfitz, sameer
CC=golang-dev
https://golang.org/cl/7231055
2013-02-20 14:42:37 -08:00