donkey199024 2018-01-19 16:03
浏览 32

关于GDB Go调试的困惑

I'm a java programer and I'm learning Go. Now I can use GDB simply and I have a doubt, when I debugging a Go program ,I can't check an object(or variable) what it exactly is. e.g. when I debug a java program,I can check everything in an object(or variable).

    public void catTest() {
      Cat cat1=new Cat("Kitty", 2, "white");
      /*AnyThing*/
      cat1.jump();
    }

When I debug this java method using eclipse-debug mode,what in cat1 are obviously in the whole process. Details of Variable cat1

When I debug a go program,I try to check variable w by using command print w or info args.

    func sayhelloName(w http.ResponseWriter, r *http.Request) {
    r.ParseForm()    
    fmt.Println(r.Form)  
    fmt.Println("path", r.URL.Path)    
    fmt.Println("scheme", r.URL.Scheme)    
    fmt.Println(r.Form["url_long"])    
    for k, v := range r.Form {
        fmt.Println("key:", k)        
        fmt.Println("val:", strings.Join(v, ""))    
    }    
    fmt.Fprintf(w, "Hello astaxie!")
}  

I can just get this but not what inside about variable w.

$2 = {tab = 0x81c2e0, data = 0x11156990}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度