debug/pe, cgo: add windows support

R=rsc, mattn
CC=golang-dev
https://golang.org/cl/1976045
This commit is contained in:
Wei Guangjing 2010-11-01 17:52:26 -04:00 committed by Russ Cox
parent e198a5086a
commit 035696c59a
10 changed files with 407 additions and 1 deletions

View file

@ -12,6 +12,7 @@ import (
"debug/dwarf"
"debug/elf"
"debug/macho"
"debug/pe"
"flag"
"fmt"
"go/ast"
@ -504,7 +505,9 @@ func (p *Package) gccDebug(stdin []byte) *dwarf.Data {
var err os.Error
if f, err = elf.Open(gccTmp); err != nil {
if f, err = macho.Open(gccTmp); err != nil {
fatal("cannot parse gcc output %s as ELF or Mach-O object", gccTmp)
if f, err = pe.Open(gccTmp); err != nil {
fatal("cannot parse gcc output %s as ELF or Mach-O or PE object", gccTmp)
}
}
}