How to runtime debug shared libraries?

后端 未结 6 1651
时光说笑
时光说笑 2020-12-07 16:52

Can anyone tell me how to do runtime debugging on shared libraries?

I need to runtime-debug a function in my shared library, but its called by another program. How c

6条回答
  •  孤街浪徒
    2020-12-07 17:06

    It has been a long time since I had to use dbx on AIX, and I faced this problem too. Installing gdb was not an option for me.

    dbx  /path/to/your/program
    (dbx) run [args to your program]
    (dbx) set $ignoreonbptrap           # I kept hitting a trace/bpt trap
    (dbx) set $deferevents              # allows setting bp in not loaded shared library
    (dbx) set $repeat                   # useful, repeat commands with  tjust like gdb
    (dbx) stop in MySharedLibraryFunc   # defers breakpoint
    (dbx) cont
    

提交回复
热议问题