ssa: support string and pointer debug info, fix params debugging

This commit is contained in:
Li Jie
2024-09-18 16:42:47 +08:00
parent 4dbfc9483e
commit d85a080f9b
8 changed files with 342 additions and 283 deletions

View File

@@ -28,10 +28,10 @@ type StructWithAllTypeFields struct {
c128 complex128
// slice []int
// arr [3]int
// s string
e E
// pf *StructWithAllTypeFields // resursive
// pi *int
s string
e E
pf *StructWithAllTypeFields // resursive
pi *int
// intr Interface
// m map[string]uint64
// c chan int
@@ -51,6 +51,7 @@ func (s *Struct) Foo(a []int, b string) int {
func FuncWithAllTypeStructParam(s StructWithAllTypeFields) {
println(&s)
println(len(s.s))
}
// Params is a function with all types of parameters.
@@ -72,11 +73,11 @@ func FuncWithAllTypeParams(
c128 complex128,
// slice []int,
// arr [3]int,
// s string,
s string,
e E,
f StructWithAllTypeFields,
// pf *StructWithAllTypeFields,
// pi *int,
pf *StructWithAllTypeFields,
pi *int,
// intr Interface,
// m map[string]uint64,
// c chan int,
@@ -88,7 +89,8 @@ func FuncWithAllTypeParams(
f32, f64, b,
c64, c128,
// slice, arr[0:],
// s, &e, &f, pf, pi, intr, m, c, err,
s,
// &e, &f, pf, pi, intr, m, c, err,
// fn,
)
return 1, errors.New("Some error")
@@ -114,10 +116,10 @@ func main() {
c128: 15 + 16i,
// slice: []int{21, 22, 23},
// arr: [3]int{24, 25, 26},
// s: "hello",
e: E{i: 30},
// pf: &StructWithAllTypeFields{},
// pi: &i,
s: "hello",
e: E{i: 30},
pf: &StructWithAllTypeFields{},
pi: &i,
// intr: &Struct{},
// m: make(map[string]uint64),
// c: make(chan int),
@@ -134,9 +136,10 @@ func main() {
s.i8, s.i16, s.i32, s.i64, s.i, s.u8, s.u16, s.u32, s.u64, s.u,
s.f32, s.f64, s.b,
s.c64, s.c128,
// s.slice, s.arr, s.s,
// s.slice, s.arr,
s.s,
s.e, s,
// s.pf, s.pi,
s.pf, s.pi,
// s.intr, s.m, s.c, s.err,
// s.fn,
)