Skip to content

Commit

Permalink
Merge pull request #18 from LiusCraft/gopmod-debug
Browse files Browse the repository at this point in the history
feat: support  debug for gop project
  • Loading branch information
xushiwei authored Feb 1, 2024
2 parents 0289735 + 1a31baa commit dc16c8e
Show file tree
Hide file tree
Showing 59 changed files with 7,747 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ localtests
*.iml
.teamcity/target
.vscode
.DS_Store
9 changes: 9 additions & 0 deletions _fixtures/goptest/a.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

func a() {
println("a")
}

func Ab() {
println("ab")
}
40 changes: 40 additions & 0 deletions _fixtures/goptest/b.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"fmt"
c "gop-sample/cpkag"
ab "gop-sample/cpkag/b"
ss "gop-sample/cpkag/b/ss"
k "gop-sample/cpkag/k"
myutils "gop-sample/cpkag/utils"
g "gop-sample/gpkag"
rootutils "gop-sample/utils"

remote "github.com/liuscraft/testgomod/utils"
)

bb := 3
Ab()
ab.Ab()
ab.Ac()
ss.Ab()
ss.Bs()
fmt.Println(bb)
k.K()
k.Kk()
k.Ab()
remote.TestCsgo()
myutils.TestCsgo()
rootutils.TestCsgo()

a()
c.P()
c.Gg()
g.G()
fmt.Println("b")
fmt.Println("b")
fmt.Println("b")
fmt.Println("b")
fmt.Println("b")
fmt.Println("b")
fmt.Println("b")
8 changes: 8 additions & 0 deletions _fixtures/goptest/b_test.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import (
c "gop-sample/cpkag"
"testing"
)

func TestC(t *testing.T) {
c.P()
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/b/ab.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ab

func Ab() {
println("ab")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/b/ac.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ab

func Ac() {
println("ac")
}
8 changes: 8 additions & 0 deletions _fixtures/goptest/cpkag/b/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ab

import "fmt"
//line cpkag/b/ab.gop:3:1
func Ab() {
//line cpkag/b/ab.gop:4:1
fmt.Println("ab")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/b/ss/b.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ss

func Bs() {
println("bs")
}
13 changes: 13 additions & 0 deletions _fixtures/goptest/cpkag/b/ss/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package ss

import "fmt"
//line cpkag/b/ss/b.gop:3:1
func Bs() {
//line cpkag/b/ss/b.gop:4:1
fmt.Println("bs")
}
//line cpkag/b/ss/ss.gop:3:1
func Ab() {
//line cpkag/b/ss/ss.gop:4:1
fmt.Println("ab")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/b/ss/ss.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ss

func Ab() {
println("ab")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/c.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cpkag

func P() {
println("c")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/gg.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cpkag

func Gg(){
println("gg")
}
8 changes: 8 additions & 0 deletions _fixtures/goptest/cpkag/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cpkag

import "fmt"
//line cpkag/gg.gop:3:1
func Gg() {
//line cpkag/gg.gop:4:1
fmt.Println("gg")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/cpkag/k/c.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package k

func K() {
println("k")
}
13 changes: 13 additions & 0 deletions _fixtures/goptest/cpkag/k/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package k

import "fmt"
//line cpkag/k/k.gop:3:1
func Kk() {
//line cpkag/k/k.gop:4:1
fmt.Println("kk")
}
//line cpkag/k/k.gop:7:1
func Ab() {
//line cpkag/k/k.gop:8:1
fmt.Println("ab")
}
9 changes: 9 additions & 0 deletions _fixtures/goptest/cpkag/k/k.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package k

func Kk() {
println("kk")
}

func Ab() {
println("ab")
}
7 changes: 7 additions & 0 deletions _fixtures/goptest/cpkag/utils/csgo.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package utils

import "fmt"

func TestCsgo() {
fmt.Println("my testcsgo")
}
8 changes: 8 additions & 0 deletions _fixtures/goptest/cpkag/utils/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package utils

import "fmt"
//line cpkag/utils/csgo.gop:5:1
func TestCsgo() {
//line cpkag/utils/csgo.gop:6:1
fmt.Println("my testcsgo")
}
5 changes: 5 additions & 0 deletions _fixtures/goptest/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module gop-sample

go 1.19

require github.com/liuscraft/testgomod v1.0.0
2 changes: 2 additions & 0 deletions _fixtures/goptest/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/liuscraft/testgomod v1.0.0 h1:OIi5azk6+mETGBp7Imhoj3zNLJrvoWlpMEl3dEN5EMg=
github.com/liuscraft/testgomod v1.0.0/go.mod h1:TFipFjRKhMQLTuF3Ey9qjsBD5z+Zij6w91fOC7vSZtQ=
5 changes: 5 additions & 0 deletions _fixtures/goptest/gop.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module gop-sample

go 1.21

gop 1.1
74 changes: 74 additions & 0 deletions _fixtures/goptest/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package main

import (
"fmt"
"gop-sample/cpkag"
ab "gop-sample/cpkag/b"
"gop-sample/cpkag/b/ss"
"gop-sample/cpkag/k"
"gop-sample/cpkag/utils"
"gop-sample/gpkag"
utils1 "gop-sample/utils"
utils2 "github.com/liuscraft/testgomod/utils"
)
//line a.gop:3:1
func a() {
//line a.gop:4:1
fmt.Println("a")
}
//line a.gop:7:1
func Ab() {
//line a.gop:8:1
fmt.Println("ab")
}
//line b.gop:16
func main() {
//line b.gop:16:1
bb := 3
//line b.gop:17:1
Ab()
//line b.gop:18:1
ab.Ab()
//line b.gop:19:1
ab.Ac()
//line b.gop:20:1
ss.Ab()
//line b.gop:21:1
ss.Bs()
//line b.gop:22:1
fmt.Println(bb)
//line b.gop:23:1
k.K()
//line b.gop:24:1
k.Kk()
//line b.gop:25:1
k.Ab()
//line b.gop:26:1
utils2.TestCsgo()
//line b.gop:27:1
utils.TestCsgo()
//line b.gop:28:1
utils1.TestCsgo()
//line b.gop:30:1
a()
//line b.gop:31:1
cpkag.P()
//line b.gop:32:1
cpkag.Gg()
//line b.gop:33:1
gpkag.G()
//line b.gop:34:1
fmt.Println("b")
//line b.gop:35:1
fmt.Println("b")
//line b.gop:36:1
fmt.Println("b")
//line b.gop:37:1
fmt.Println("b")
//line b.gop:38:1
fmt.Println("b")
//line b.gop:39:1
fmt.Println("b")
//line b.gop:40:1
fmt.Println("b")
}
11 changes: 11 additions & 0 deletions _fixtures/goptest/gop_autogen2_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main_test

import (
"testing"

"github.com/liuscraft/testgomod/utils"
)

func TestCsgo1(t *testing.T) {
utils.TestCsgo()
}
11 changes: 11 additions & 0 deletions _fixtures/goptest/gop_autogen_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"gop-sample/cpkag"
"testing"
)
//line b_test.gop:6:1
func TestC(t *testing.T) {
//line b_test.gop:7:1
cpkag.P()
}
7 changes: 7 additions & 0 deletions _fixtures/goptest/gpkag/g.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package gpkag

import "fmt"

func G() {
fmt.Println("g")
}
7 changes: 7 additions & 0 deletions _fixtures/goptest/utils/csgo.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package utils

import "fmt"

func TestCsgo() {
fmt.Println("root testcsgo")
}
16 changes: 16 additions & 0 deletions _fixtures/goptest/utils/csgo_test.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package utils

import "testing"

func TestCsgo2(t *testing.T) {
tests := []struct {
name string
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
TestCsgo()
})
}
}
8 changes: 8 additions & 0 deletions _fixtures/goptest/utils/gop_autogen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package utils

import "fmt"
//line utils/csgo.gop:5:1
func TestCsgo() {
//line utils/csgo.gop:6:1
fmt.Println("root testcsgo")
}
19 changes: 19 additions & 0 deletions _fixtures/goptest/utils/gop_autogen_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package utils

import "testing"
//line utils/csgo_test.gop:5:1
func TestCsgo2(t *testing.T) {
//line utils/csgo_test.gop:6:1
tests := []struct {
name string
}{}
for
//line utils/csgo_test.gop:11:1
_, tt := range tests {
//line utils/csgo_test.gop:12:1
t.Run(tt.name, func(t *testing.T) {
//line utils/csgo_test.gop:13:1
TestCsgo()
})
}
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/go-delve/gore v0.11.6
github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62
github.com/google/go-dap v0.11.0
github.com/goplus/mod v0.12.3
github.com/hashicorp/golang-lru v1.0.2
github.com/mattn/go-colorable v0.1.13
github.com/mattn/go-isatty v0.0.20
Expand All @@ -27,6 +28,7 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/qiniu/x v1.13.2 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect
Expand Down
Loading

0 comments on commit dc16c8e

Please sign in to comment.