Skip to content

Commit 7ec0d2b

Browse files
committed
*: mark riscv64 port as experimental
Delete non-working prologue detection code and mark port as experimental. Updates go-delve#3832
1 parent 75c41f2 commit 7ec0d2b

File tree

4 files changed

+20
-44
lines changed

4 files changed

+20
-44
lines changed

Diff for: _scripts/make.go

+18-13
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ func NewMakeCommands() *cobra.Command {
5151
envflags = append(envflags, "GOOS="+OS)
5252
}
5353
if len(envflags) > 0 {
54-
executeEnv(envflags, "go", "build", "-ldflags", "-extldflags -static", tagFlags(), buildFlags(), DelveMainPackagePath)
54+
executeEnv(envflags, "go", "build", "-ldflags", "-extldflags -static", tagFlags(false), buildFlags(), DelveMainPackagePath)
5555
} else {
56-
execute("go", "build", "-ldflags", "-extldflags -static", tagFlags(), buildFlags(), DelveMainPackagePath)
56+
execute("go", "build", "-ldflags", "-extldflags -static", tagFlags(false), buildFlags(), DelveMainPackagePath)
5757
}
5858
if runtime.GOOS == "darwin" && os.Getenv("CERT") != "" && canMacnative() && !isCodesigned("./dlv") {
5959
codesign("./dlv")
@@ -70,7 +70,7 @@ func NewMakeCommands() *cobra.Command {
7070
Use: "install",
7171
Short: "Installs delve",
7272
Run: func(cmd *cobra.Command, args []string) {
73-
execute("go", "install", tagFlags(), buildFlags(), DelveMainPackagePath)
73+
execute("go", "install", tagFlags(false), buildFlags(), DelveMainPackagePath)
7474
if runtime.GOOS == "darwin" && os.Getenv("CERT") != "" && canMacnative() && !isCodesigned(installedExecutablePath()) {
7575
codesign(installedExecutablePath())
7676
}
@@ -293,16 +293,21 @@ func prepareMacnative() string {
293293
return "macnative"
294294
}
295295

296-
func tagFlags() string {
296+
func tagFlags(isTest bool) string {
297297
var tags []string
298298
if mactags := prepareMacnative(); mactags != "" {
299299
tags = append(tags, mactags)
300300
}
301-
if runtime.GOOS == "windows" && runtime.GOARCH == "arm64" {
302-
tags = append(tags, "exp.winarm64")
303-
}
304-
if runtime.GOOS == "linux" && runtime.GOARCH == "ppc64le" {
305-
tags = append(tags, "exp.linuxppc64le")
301+
if isTest {
302+
if runtime.GOOS == "windows" && runtime.GOARCH == "arm64" {
303+
tags = append(tags, "exp.winarm64")
304+
}
305+
if runtime.GOOS == "linux" && runtime.GOARCH == "ppc64le" {
306+
tags = append(tags, "exp.linuxppc64le")
307+
}
308+
if runtime.GOOS == "linux" && runtime.GOARCH == "riscv64" {
309+
tags = append(tags, "exp.linuxriscv64")
310+
}
306311
}
307312
if Tags != nil && len(*Tags) > 0 {
308313
tags = append(tags, *Tags...)
@@ -462,11 +467,11 @@ func testCmdIntl(testSet, testRegex, testBackend, testBuildMode string) {
462467
}
463468

464469
if len(testPackages) > 3 {
465-
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(), testPackages, backendFlag, buildModeFlag)
470+
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(true), testPackages, backendFlag, buildModeFlag)
466471
} else if testRegex != "" {
467-
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(), testPackages, "-run="+testRegex, backendFlag, buildModeFlag)
472+
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(true), testPackages, "-run="+testRegex, backendFlag, buildModeFlag)
468473
} else {
469-
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(), testPackages, backendFlag, buildModeFlag)
474+
executeq(env, "go", "test", testFlags(), buildFlags(), tagFlags(true), testPackages, backendFlag, buildModeFlag)
470475
}
471476
}
472477

@@ -505,7 +510,7 @@ func inpath(exe string) bool {
505510

506511
func allPackages() []string {
507512
r := []string{}
508-
for _, dir := range strings.Split(getoutput("go", "list", "-mod=vendor", tagFlags(), "./..."), "\n") {
513+
for _, dir := range strings.Split(getoutput("go", "list", "-mod=vendor", tagFlags(true), "./..."), "\n") {
509514
dir = strings.TrimSpace(dir)
510515
if dir == "" || strings.Contains(dir, "/vendor/") || strings.Contains(dir, "/_scripts") {
511516
continue

Diff for: pkg/proc/native/support_sentinel_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build linux && !amd64 && !arm64 && !386 && !(ppc64le && exp.linuxppc64le) && !riscv64
1+
//go:build linux && !amd64 && !arm64 && !386 && !(ppc64le && exp.linuxppc64le) && !(riscv64 && exp.linuxriscv64)
22

33
// This file is used to detect build on unsupported GOOS/GOARCH combinations.
44

Diff for: pkg/proc/riscv64_arch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func RISCV64Arch(goos string) *Arch {
2626
altBreakpointInstruction: riscv64BreakInstruction,
2727
breakInstrMovesPC: false,
2828
derefTLS: false,
29-
prologues: prologuesRISCV64,
29+
prologues: nil,
3030
fixFrameUnwindContext: riscv64FixFrameUnwindContext,
3131
switchStack: riscv64SwitchStack,
3232
regSize: riscv64RegSize,

Diff for: pkg/proc/riscv64_disasm.go

-29
Original file line numberDiff line numberDiff line change
@@ -116,35 +116,6 @@ func resolveCallArgRISCV64(inst *riscv64asm.Inst, instAddr uint64, currentGorout
116116
return &Location{PC: pc, File: file, Line: line, Fn: fn}
117117
}
118118

119-
// Possible stacksplit prologues are inserted by stacksplit in
120-
// $GOROOT/src/cmd/internal/obj/riscv/obj.go.
121-
var prologuesRISCV64 []opcodeSeq
122-
123-
func init() {
124-
var tinyStacksplit = opcodeSeq{uint64(riscv64asm.ADDI)}
125-
var smallStacksplit = opcodeSeq{}
126-
var bigStacksplit = opcodeSeq{uint64(riscv64asm.LUI),
127-
uint64(riscv64asm.ADDIW),
128-
uint64(riscv64asm.BLTU),
129-
uint64(riscv64asm.LUI),
130-
uint64(riscv64asm.ADDIW),
131-
uint64(riscv64asm.ADD)}
132-
133-
var unixGetG = opcodeSeq{uint64(riscv64asm.LD)}
134-
var tailPrologues = opcodeSeq{uint64(riscv64asm.BLTU),
135-
uint64(riscv64asm.JAL),
136-
uint64(riscv64asm.JAL)}
137-
138-
prologuesRISCV64 = make([]opcodeSeq, 0, 3)
139-
for _, stacksplit := range []opcodeSeq{tinyStacksplit, smallStacksplit, bigStacksplit} {
140-
prologue := make(opcodeSeq, 0, len(unixGetG)+len(stacksplit)+len(tailPrologues))
141-
prologue = append(prologue, unixGetG...)
142-
prologue = append(prologue, stacksplit...)
143-
prologue = append(prologue, tailPrologues...)
144-
prologuesRISCV64 = append(prologuesRISCV64, prologue)
145-
}
146-
}
147-
148119
type riscv64ArchInst riscv64asm.Inst
149120

150121
func (inst *riscv64ArchInst) Text(flavour AssemblyFlavour, pc uint64, symLookup func(uint64) (string, uint64)) string {

0 commit comments

Comments
 (0)