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

  • 相关阅读:
    django 标签的使用
    django(models)视图与html 简单的操作
    Django 简单的使用
    安全性测试计划
    常用缩写
    ADB 基本命令整理
    kindle升级测试
    虚拟机的类加载机制
    垃圾收集器与内存分配策略之篇三:理解GC日志和垃圾收集器参数总结
    垃圾收集器与内存分配策略之篇二:垃圾收集器
  • 原文地址:https://www.cnblogs.com/studyNT/p/5178542.html
Copyright © 2011-2022 走看看