helloworld12
V2EX  ›  问与答

golang Stack Traces 的时候,如何把参数的值也一起捕获

  •  
  •   helloworld12 · Sep 7, 2018 · 1210 views
    This topic created in 2809 days ago, the information mentioned may be changed or developed.

    看了这篇文章,懂得了怎么分析崩溃时的信息了

    但是还是不够,我并不是想分析,而是想知道具体的崩溃时的各个变量的值

    Panic: Want stack trace
    
    goroutine 1 [running]:
    main.Example(0x2080c3f50, 0x2, 0x4, 0x425c0, 0x5, 0xa)
            /Users/bill/Spaces/Go/Projects/src/github.com/goinaction/code/
            temp/main.go:9 +0x64
    main.main()
            /Users/bill/Spaces/Go/Projects/src/github.com/goinaction/code/
            temp/main.go:5 +0x85
    
    goroutine 2 [runnable]:
    runtime.forcegchelper()
            /Users/bill/go/src/runtime/proc.go:90
    runtime.goexit()
            /Users/bill/go/src/runtime/asm_amd64.s:2232 +0x1
    
    goroutine 3 [runnable]:
    runtime.bgsweep()
            /Users/bill/go/src/runtime/mgc0.go:82
    runtime.goexit()
            /Users/bill/go/src/runtime/asm_amd64.s:2232 +0x1
    

    譬如上面这种信息,如何在获得这个的同时,捕获每个函数的具体值,而不是只有他们的指针地址,或者长度?

    Supplement 1  ·  Sep 7, 2018
    譬如上面这种信息,如何在获得这个的同时,捕获每个函数参数的具体值,而不是只有他们的指针地址,或者长度?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3228 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 00:35 · PVG 08:35 · LAX 17:35 · JFK 20:35
    ♥ Do have faith in what you're doing.