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

  • 相关阅读:
    hdu 4027 Can you answer these queries?
    hdu 4041 Eliminate Witches!
    hdu 4036 Rolling Hongshu
    pku 2828 Buy Tickets
    hdu 4016 Magic Bitwise And Operation
    pku2886 Who Gets the Most Candies?(线段树+反素数打表)
    hdu 4039 The Social Network
    hdu 4023 Game
    苹果官方指南:Cocoa框架(2)(非原创)
    cocos2d 中 CCNode and CCAction
  • 原文地址:https://www.cnblogs.com/studyNT/p/5178542.html
Copyright © 2011-2022 走看看