zoukankan      html  css  js  c++  java
  • debug 使用lldb

    http://www.zddhub.com/memo/2015/12/20/lldb-golang-debug/

    go build -gcflags "-N -l" -o test test.go

    MoJetdeMacBook-Pro:Downloads mojet$ lldb test

    (lldb) target create "test"

    Current executable set to 'test' (x86_64).

    (lldb) breakpoint set --file test.go

    error: invalid combination of options for the given command

    (lldb) b test.go:17 

    Breakpoint 1: where = test`main.main + 68 at test.go:17, address = 0x0000000000002134

    (lldb)  b test.go:10

    Breakpoint 2: where = test`main.counting + 43 at test.go:10, address = 0x000000000000206b

    (lldb) b test.go:23

    Breakpoint 3: where = test`main.main + 514 at test.go:23, address = 0x00000000000022f2

    (lldb) br list

    Current breakpoints:

    1: file = 'test.go', line = 17, locations = 1

      1.1: where = test`main.main + 68 at test.go:17, address = test[0x0000000000002134], unresolved, hit count = 0 

     

    2: file = 'test.go', line = 10, locations = 1

      2.1: where = test`main.counting + 43 at test.go:10, address = test[0x000000000000206b], unresolved, hit count = 0 

     

    3: file = 'test.go', line = 23, locations = 1

      3.1: where = test`main.main + 514 at test.go:23, address = test[0x00000000000022f2], unresolved, hit count = 0 

     

    (lldb) run

    error: argdumper exited with error 127

    (lldb) process launch test

    Process 58501 launched: '/Users/mojet/Downloads/test' (x86_64)

    Process 58501 stopped

    * thread #1: tid = 0x4a03e1, 0x0000000000002134 test`main.main + 68 at test.go:17, stop reason = breakpoint 1.1

        frame #0: 0x0000000000002134 test`main.main + 68 at test.go:17

       14  }

       15  

       16  func main() {

    -> 17  msg := "Starting main"

       18  fmt.Println(msg)

       19  bus := make(chan int)

       20  msg = "starting a gorountie"

    (lldb) c

  • 相关阅读:
    分库分表就能无限扩容吗?
    每天数十亿次请求的应用经验分享,值得参考!
    QPS、TPS、并发用户数、吞吐量
    Django优雅集成MongoDB
    Linux apt-get
    Python Tenacity 实现"重试机制"
    Kubernetes 系列(一):Kubernetes 介绍、架构、安装
    MongoDB学习笔记:文档Crud Shell
    ubuntu下快速安装rabbitmq
    Reactor模型详解:单Reactor多线程与主从Reactor多线程
  • 原文地址:https://www.cnblogs.com/studyNT/p/5178542.html
Copyright © 2011-2022 走看看