当前位置: 首页>>代码示例>>Golang>>正文


Golang runtime.Breakpoint函数代码示例

本文整理汇总了Golang中runtime.Breakpoint函数的典型用法代码示例。如果您正苦于以下问题:Golang Breakpoint函数的具体用法?Golang Breakpoint怎么用?Golang Breakpoint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Breakpoint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestConvertToTheNumber10

func TestConvertToTheNumber10(t *testing.T) {
	runtime.Breakpoint()
	i := convertToTheNumber10(5)
	if i != 10 {
		t.Fatalf("Expected %d to equal 10", i)
	}
}
开发者ID:adennis4,项目名称:talks,代码行数:7,代码来源:example_test.go

示例2: warnIfNotClosed

func (e *Entry) warnIfNotClosed() {
	if e.e != nil {
		log.Printf("precache: Entry(%p) leaked! (Getter: %v)", e, e.e.g)
		runtime.Breakpoint()
		e.Close()
	}
}
开发者ID:BenLubar,项目名称:precache,代码行数:7,代码来源:entry.go

示例3: main

func main() {
	i1 := 1
	i2 := 2
	p1 := &i1
	runtime.Breakpoint()
	fmt.Printf("%d %d %v\n", i1, i2, p1)
}
开发者ID:rdterner,项目名称:delve,代码行数:7,代码来源:testvariables3.go

示例4:

func ext۰runtime۰Breakpoint(fr *Frame, args []Value) Value {
	// If tracehook is DefaultTraceHook, should we run a PrintStack
	// and leave?
	TraceHook(fr, &fr.block.Instrs[0], ssa2.TRACE_CALL)
	runtime.Breakpoint()
	return nil
}
开发者ID:rocky,项目名称:ssa-interp,代码行数:7,代码来源:external.go

示例5: main

func main() {
	i1 := 1
	i2 := 2
	p1 := &i1
	runtime.Breakpoint()
	fmt.Println(i1, i2, p1)
}
开发者ID:puyox,项目名称:delve,代码行数:7,代码来源:testvariables3.go

示例6: test

func test() {
	fmt.Print("aaa")
	runtime.Breakpoint()
	fmt.Print("bbb")
	fmt.Print("bb")
	fmt.Print("bb2")
	fmt.Print("bbb")
}
开发者ID:ezioruan,项目名称:go4fun,代码行数:8,代码来源:demo.go

示例7: main

func main() {
	var i *int
	fmt.Println(4 * *2)
	fmt.Println(i)
	changeSample(&i)
	runtime.Breakpoint()
	fmt.Println(*i)
}
开发者ID:kavehmz,项目名称:garbage,代码行数:8,代码来源:tmp12.go

示例8: main

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		runtime.Breakpoint()
		msg := "hello, world!"
		header := w.Header().Get("Content-Type")
		w.Write([]byte(msg + header))
	})
	http.ListenAndServe(":9191", nil)
}
开发者ID:RJAugust,项目名称:delve,代码行数:9,代码来源:testnextnethttp.go

示例9: main

func main() {
	fn1 := afunction
	var o someStruct
	fn2 := o.structfunc
	fn3 := func(s string) {
		fmt.Println("inline", s)
	}
	runtime.Breakpoint()
	fmt.Println(fn1, fn2, fn3, o)
}
开发者ID:catgatp,项目名称:delve,代码行数:10,代码来源:locationsprog2.go

示例10: main

func main() {
	b := B{A: A{-314}, C: &C{"hello"}, a: A{42}, ptr: &A{1337}}
	runtime.Breakpoint()
	fmt.Println(b)
	fmt.Println(b.val)
	fmt.Println(b.A.val)
	fmt.Println(b.a.val)
	fmt.Println(b.ptr.val)
	fmt.Println(b.C.s)
	fmt.Println(b.s)
}
开发者ID:puyox,项目名称:delve,代码行数:11,代码来源:testvariables4.go

示例11: main

func main() {
	flag.Parse()
	f, err := os.Create(*cpuprofile)
	if err != nil {
		log.Fatal(err)
	}
	runtime.Breakpoint()
	pprof.StartCPUProfile(f)
	defer pprof.StopCPUProfile()
	Print("aaaaaaaaaaaaaaaaaaa")
}
开发者ID:yc7369,项目名称:gostudy,代码行数:11,代码来源:profiletest.go

示例12: gcd

// GCD. We assume positive numbers
func gcd(a int, b int) int {
	// Make: a <= b
	if a > b {
		a, b = b, a
	}

	if a <= 0 {
		return -1
	}

	runtime.Breakpoint()
	if a == 1 || b-a == 0 {
		return a
	}
	return gcd(b-a, a)
}
开发者ID:rocky,项目名称:ssa-interp,代码行数:17,代码来源:gcdBrkpt.go

示例13: main

func main() {
	n :=
		append +
			bool +
			byte +
			complex +
			complex64 +
			complex128 +
			cap +
			close +
			delete +
			error +
			false +
			float32 +
			float64 +
			imag +
			int +
			int8 +
			int16 +
			int32 +
			int64 +
			len +
			make +
			new +
			nil +
			panic +
			print +
			println +
			real +
			recover +
			rune +
			string +
			true +
			uint +
			uint8 +
			uint16 +
			uint32 +
			uint64 +
			uintptr +
			iota
	if n != NUM*(NUM-1)/2 {
		fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2)
		runtime.Breakpoint() // panic is inaccessible
	}
}
开发者ID:RajibTheKing,项目名称:gcc,代码行数:45,代码来源:rename.go

示例14: foobar

func foobar(baz string, bar FooBar) {
	var (
		a1   = "foofoofoofoofoofoo"
		a2   = 6
		a3   = 7.23
		a4   = [2]int{1, 2}
		a5   = []int{1, 2, 3, 4, 5}
		a6   = FooBar{Baz: 8, Bur: "word"}
		a7   = &FooBar{Baz: 5, Bur: "strum"}
		a8   = FooBar2{Bur: 10, Baz: "feh"}
		a9   = (*FooBar)(nil)
		a10  = a1[2:5]
		a11  = [3]FooBar{{1, "a"}, {2, "b"}, {3, "c"}}
		a12  = []FooBar{{4, "d"}, {5, "e"}}
		a13  = []*FooBar{{6, "f"}, {7, "g"}, {8, "h"}}
		b1   = true
		b2   = false
		neg  = -1
		i8   = int8(1)
		u8   = uint8(255)
		u16  = uint16(65535)
		u32  = uint32(4294967295)
		u64  = uint64(18446744073709551615)
		up   = uintptr(5)
		f32  = float32(1.2)
		c64  = complex(float32(1), float32(2))
		c128 = complex(float64(2), float64(3))
		i32  = [2]int32{1, 2}
		f    = barfoo
		ms   = Nest{0, &Nest{1, &Nest{2, &Nest{3, &Nest{4, nil}}}}} // Test recursion capping
		ba   = make([]int, 200, 200)                                // Test array size capping
	)

	runtime.Breakpoint()
	barfoo()
	fmt.Println(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, b1, b2, baz, neg, i8, u8, u16, u32, u64, up, f32, c64, c128, i32, bar, f, ms, ba, p1)
}
开发者ID:RJAugust,项目名称:delve,代码行数:37,代码来源:testvariables.go

示例15: Error

func (c *common) Error(args ...interface{}) {
	header("Error")
	fmt.Println(args...)
	runtime.Breakpoint()
	hadError = true
}
开发者ID:joao-parana,项目名称:tardisgo,代码行数:6,代码来源:testing.go


注:本文中的runtime.Breakpoint函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。