Index: gcc/testsuite/go.test/go-test.exp =================================================================== --- gcc/testsuite/go.test/go-test.exp (revision 171716) +++ gcc/testsuite/go.test/go-test.exp (working copy) @@ -123,6 +123,9 @@ global target_triplet switch -glob $target_triplet { + "alpha*-*-*" { + set goarch "alpha" + } "arm*-*-*" - "ep9312*-*-*" - "strongarm*-*-*" - Index: libgo/configure =================================================================== --- libgo/configure (revision 171716) +++ libgo/configure (working copy) @@ -633,6 +633,8 @@ LIBGO_IS_M68K_TRUE LIBGO_IS_ARM_FALSE LIBGO_IS_ARM_TRUE +LIBGO_IS_ALPHA_FALSE +LIBGO_IS_ALPHA_TRUE LIBGO_IS_386_FALSE LIBGO_IS_386_TRUE GOOS @@ -10898,7 +10900,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10901 "configure" +#line 10903 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11004,7 +11006,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11007 "configure" +#line 11009 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13267,6 +13269,7 @@ is_386=no +is_alpha=no is_arm=no is_m68k=no is_mips=no @@ -13278,6 +13281,10 @@ is_x86_64=no GOARCH=unknown case ${host} in + alpha*-*-*) + is_alpha=yes + GOARCH=alpha + ;; arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*) is_arm=yes GOARCH=arm @@ -13375,6 +13382,14 @@ LIBGO_IS_386_FALSE= fi + if test $is_alpha = yes; then + LIBGO_IS_ALPHA_TRUE= + LIBGO_IS_ALPHA_FALSE='#' +else + LIBGO_IS_ALPHA_TRUE='#' + LIBGO_IS_ALPHA_FALSE= +fi + if test $is_arm = yes; then LIBGO_IS_ARM_TRUE= LIBGO_IS_ARM_FALSE='#' @@ -14492,6 +14507,10 @@ as_fn_error "conditional \"LIBGO_IS_386\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${LIBGO_IS_ALPHA_TRUE}" && test -z "${LIBGO_IS_ALPHA_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_ALPHA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBGO_IS_ARM_TRUE}" && test -z "${LIBGO_IS_ARM_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 Index: libgo/syscalls/syscall_linux_alpha.go =================================================================== --- libgo/syscalls/syscall_linux_alpha.go (revision 0) +++ libgo/syscalls/syscall_linux_alpha.go (revision 0) @@ -0,0 +1,15 @@ +// syscall_linux_alpha.go -- GNU/Linux ALPHA specific support + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package syscall + +func (r *PtraceRegs) PC() uint64 { + return r.Pc; +} + +func (r *PtraceRegs) SetPC(pc uint64) { + r.Pc = pc; +} Index: libgo/configure.ac =================================================================== --- libgo/configure.ac (revision 171716) +++ libgo/configure.ac (working copy) @@ -134,6 +134,7 @@ dnl N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch). is_386=no +is_alpha=no is_arm=no is_m68k=no is_mips=no @@ -145,6 +146,10 @@ is_x86_64=no GOARCH=unknown case ${host} in + alpha*-*-*) + is_alpha=yes + GOARCH=alpha + ;; arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*) is_arm=yes GOARCH=arm @@ -205,6 +210,7 @@ ;; esac AM_CONDITIONAL(LIBGO_IS_386, test $is_386 = yes) +AM_CONDITIONAL(LIBGO_IS_ALPHA, test $is_alpha = yes) AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes) AM_CONDITIONAL(LIBGO_IS_M68K, test $is_m68k = yes) AM_CONDITIONAL(LIBGO_IS_MIPS, test $is_mips = yes) Index: libgo/go/debug/proc/regs_linux_alpha.go =================================================================== --- libgo/go/debug/proc/regs_linux_alpha.go (revision 0) +++ libgo/go/debug/proc/regs_linux_alpha.go (revision 0) @@ -0,0 +1,209 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package proc + +import ( + "os" + "strconv" + "syscall" +) + +type alphaRegs struct { + syscall.PtraceRegs + setter func(*syscall.PtraceRegs) os.Error +} + +var names = [...]string{ + "r0", + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "r7", + "r8", + "r19", + "r20", + "r21", + "r22", + "r23", + "r24", + "r25", + "r26", + "r27", + "r28", + "hae", + "trap_a0", + "trap_a1", + "trap_a2", + "ps", + "pc", + "gp", + "r16", + "r17", + "r18", +} + +func (r *alphaRegs) PC() Word { return Word(r.Pc) } + +func (r *alphaRegs) SetPC(val Word) os.Error { + r.Pc = uint64(val) + return r.setter(&r.PtraceRegs) +} + +func (r *alphaRegs) Link() Word { + panic("No link register") +} + +func (r *alphaRegs) SetLink(val Word) os.Error { + panic("No link register") +} + +func (r *alphaRegs) SP() Word { return Word(r.Ps) } + +func (r *alphaRegs) SetSP(val Word) os.Error { + r.Ps = uint64(val) + return r.setter(&r.PtraceRegs) +} + +func (r *alphaRegs) Names() []string { return names[0:] } + +func (r *alphaRegs) Get(i int) Word { + switch i { + case 0: + return Word(r.R0) + case 1: + return Word(r.R1) + case 2: + return Word(r.R2) + case 3: + return Word(r.R3) + case 4: + return Word(r.R4) + case 5: + return Word(r.R5) + case 6: + return Word(r.R6) + case 7: + return Word(r.R7) + case 8: + return Word(r.R8) + case 9: + return Word(r.R19) + case 10: + return Word(r.R20) + case 11: + return Word(r.R21) + case 12: + return Word(r.R22) + case 13: + return Word(r.R23) + case 14: + return Word(r.R24) + case 15: + return Word(r.R25) + case 16: + return Word(r.R26) + case 17: + return Word(r.R27) + case 18: + return Word(r.R28) + case 19: + return Word(r.Hae) + case 20: + return Word(r.Trap_a0) + case 21: + return Word(r.Trap_a1) + case 22: + return Word(r.Trap_a2) + case 23: + return Word(r.Ps) + case 24: + return Word(r.Pc) + case 25: + return Word(r.Gp) + case 26: + return Word(r.R16) + case 27: + return Word(r.R17) + case 28: + return Word(r.R18) + } + panic("invalid register index " + strconv.Itoa(i)) +} + +func (r *alphaRegs) Set(i int, val Word) os.Error { + switch i { + case 0: + r.R0 = uint64(val) + case 1: + r.R1 = uint64(val) + case 2: + r.R2 = uint64(val) + case 3: + r.R3 = uint64(val) + case 4: + r.R4 = uint64(val) + case 5: + r.R5 = uint64(val) + case 6: + r.R6 = uint64(val) + case 7: + r.R7 = uint64(val) + case 8: + r.R8 = uint64(val) + case 9: + r.R19 = uint64(val) + case 10: + r.R20 = uint64(val) + case 11: + r.R21 = uint64(val) + case 12: + r.R22 = uint64(val) + case 13: + r.R23 = uint64(val) + case 14: + r.R24 = uint64(val) + case 15: + r.R25 = uint64(val) + case 16: + r.R26 = uint64(val) + case 17: + r.R27 = uint64(val) + case 18: + r.R28 = uint64(val) + case 19: + r.Hae = uint64(val) + case 20: + r.Trap_a0 = uint64(val) + case 21: + r.Trap_a1 = uint64(val) + case 22: + r.Trap_a2 = uint64(val) + case 23: + r.Ps = uint64(val) + case 24: + r.Pc = uint64(val) + case 25: + r.Gp = uint64(val) + case 26: + r.R16 = uint64(val) + case 27: + r.R17 = uint64(val) + case 28: + r.R18 = uint64(val) + default: + panic("invalid register index " + strconv.Itoa(i)) + } + return r.setter(&r.PtraceRegs) +} + +func newRegs(regs *syscall.PtraceRegs, setter func(*syscall.PtraceRegs) os.Error) Regs { + res := alphaRegs{} + res.PtraceRegs = *regs + res.setter = setter + return &res +}