當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。