net: handle single-line non-\n-terminated files correctly in readLine

Fixes issue 6646.

R=rsc, bradfitz
CC=golang-dev
https://codereview.appspot.com/15960047

Committer: Russ Cox <rsc@golang.org>
runtime: relax preemption assertion during stack split

The case can happen when starttheworld is calling acquirep
to get things moving again and acquirep gets preempted.
The stack trace is in golang.org/issue/6644.

It is difficult to build a short test case for this, but
the person who reported issue 6644 confirms that this
solves the problem.

Fixes issue 6644.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/18740044
cmd/cgo: stop using -fno-eliminate-unused-debug-types

This flag was added in January 2010, in CL 181102, to fix issue 497.
(Numbers were just shorter back then.) The fix was for OS X machines
and the llvm-gcc frontend.

In July 2011 we had to change the way we get enum values, because
there were no flags available to force Xcode's llvm-gcc to include the
enum names and values in DWARF debug output.

We now use clang, not llvm-gcc, on OS X machines.
Earlier versions of clang printed a warning about not knowing the flag.
Newer versions of clang now make that an error.

That is:
 - The flag was added for OS X machines.
 - The flag is no longer necessary on OS X machines.
 - The flag now breaks some OS X machines.

Remove it.

I have run the original program from issue 497 successfully
without the flag on both OS X and Linux machines.

Fixes issue 6678.

R=golang-dev, minux.ma
CC=golang-dev
https://codereview.appspot.com/18850043
doc: update front page summary text

R=rsc
CC=golang-dev
https://codereview.appspot.com/18080045
debug/dwarf: add DWARF 4 form constants

Some versions of clang generate DWARF 4-format attributes
even when using -gdwarf-2. We don't care much about the
values, but we do need to be able to parse past them.

This fixes a bug in Go 1.2 rc2 reported via private mail using
a near-tip version of clang.

R=golang-dev, iant, dvyukov
CC=golang-dev
https://codereview.appspot.com/18460043
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://codereview.appspot.com/18230043

Committer: Alan Donovan <adonovan@google.com>
cmd/gc: silence clang warning

This code is only built when you run 'make' in cmd/gc,
not in all.bash.

R=golang-dev, jsing, iant
CC=golang-dev
https://codereview.appspot.com/19160043
os: do not return Lstat errors from Readdir

This CL restores the Go 1.1.2 semantics for os.File's Readdir method.

The code in Go 1.1.2 was rewritten mainly because it looked buggy.
This new version attempts to be clearer but still provide the 1.1.2 results.

The important diff is not this CL's version against tip but this CL's version
against Go 1.1.2.

Go 1.1.2:

        names, err := f.Readdirnames(n)
        fi = make([]FileInfo, len(names))
        for i, filename := range names {
                fip, err := Lstat(dirname + filename)
                if err == nil {
                        fi[i] = fip
                } else {
                        fi[i] = &fileStat{name: filename}
                }
        }
        return fi, err

This CL:

        names, err := f.Readdirnames(n)
        fi = make([]FileInfo, len(names))
        for i, filename := range names {
                fip, lerr := lstat(dirname + filename)
                if lerr != nil {
                        fi[i] = &fileStat{name: filename}
                        continue
                }
                fi[i] = fip
        }
        return fi, err

The changes from Go 1.1.2 are stylistic, not semantic:
1. Use lstat instead of Lstat, for testing (done before this CL).
2. Make error handling in loop body look more like an error case.
3. Use separate error variable name in loop body, to be clear
   we are not trying to influence the final return result.

Fixes issue 6656.
Fixes issue 6680.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/18870043
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://codereview.appspot.com/19010044

Committer: Alan Donovan <adonovan@google.com>
net/http/httputil: fix DumpRequestOut with ContentLength & false body param

Fixes issue 6471

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/14920050
encoding/xml: fix doc comment

The tag is ",chardata" not "chardata".

Fixes issue 6631.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/19300046
time: correct path to time zone zip file on Unix

Most Unix systems have their own time zone data,
so we almost never get far enough in the list to
discover that we cannot fall back to the zip file.
Adjust testing to exercise the final fallback.

Plan 9 and Windows were already correct
(and are the main users of the zip file).

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/19280043
A+C: Jakob Borg (individual CLA).

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/19510043
database/sql: Fix typos in doc

R=golang-dev
CC=bradfitz, golang-dev
https://codereview.appspot.com/17590043

Committer: Brad Fitzpatrick <bradfitz@golang.org>
database/sql: document Result methods

Fixes issue 5110

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/19280046
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://codereview.appspot.com/19010044

Committer: Alan Donovan <adonovan@google.com>
»»»

R=bradfitz
CC=golang-dev
https://codereview.appspot.com/19640043
cmd/cgo: accept extra leading _ on __cgodebug_data for all object formats

The current Windows build breakage appears to be because
the Windows code should be looking for __cgodebug_data
not ___cgodebug_data. Dodge the question everywhere by
accepting both.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/19780043
doc/go1.2.html: stack sizes, thread limits

R=golang-dev, minux.ma, adg, rsc
CC=golang-dev
https://codereview.appspot.com/19600043
doc/go1.2.html: delete repeated word
TBR=rsc

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/19840043
cmd/5l, runtime: make ARM integer division profiler-friendly

The implementation of division constructed non-standard
stack frames that could not be handled by the traceback
routines.

CL 13239052 left the frames non-standard but fixed them
for the specific case of a divide-by-zero panic.
A profiling signal can arrive at any time, so that fix
is not sufficient.

Change the division to store the extra argument in the M struct
instead of in a new stack slot. That keeps the frames bog standard
at all times.

Also fix a related bug in the traceback code: when starting
a traceback, the LR register should be ignored if the current
function has already allocated its stack frame and saved the
original LR on the stack. The stack copy should be used, as the
LR register may have been modified.

Combined, these make the torture test from issue 6681 pass.

Fixes issue 6681.

R=golang-dev, r, josharian
CC=golang-dev
https://codereview.appspot.com/19810043