dbx 常用命令

來源:互聯網
上載者:User

基於AIX 6.1平台的dbx(建議您直接查看官網協助)

啟動調試
命令 說明
dbx [pro] 調試未啟動的程式pro
dbx -a [pid] 調試正在啟動並執行進程(進程號為pid)
detach 退出調試該程式(但不退出dbx), 讓程式繼續執行
quit 退出dbx
調試過程中的命令斷點
命令 說明
cont 從當前斷點繼續執行, 直到下一個斷點(如有下一個斷點的話)
delete 刪除斷點. 如
刪除第1個斷點(斷點編號可通過'status'尋找):
(dbx) delete 1
status 顯示當前所有斷點
stop in function
stop at "file":line
設定斷點. 如
在函數myfunc處設定斷點:
(dbx) stop in myfunc
在源檔案main.c的第100行設定斷點:
(dbx) stop at "main.c":100
use + [path] 增加程式的源碼搜尋路徑, 如use + ../src/os
顯示代碼
命令 說明
list 顯示當前執行的代碼, 如
顯示當前檔案的10到20行代碼:
(dbx) list 10,20
use + [path] 增加程式的源碼搜尋路徑, 如use + ../src/os
多線程
命令 說明
thread 顯示當前所有線程, 如
(dbx) thread thread  state-k     wchan            state-u    k-tid mode held scope function $t1     wait      0xf1000f0a1004a540 blocked  77922367   k   no   sys                    >$t2     run                          running  62128185   k   no   sys  __fd_select        $t3     wait                         running  76873903   k   no   sys  

顯示線程1的詳細資料:

(dbx) thread info 1 thread  state-k     wchan            state-u    k-tid mode held scope function $t1     wait      0xf1000f0a1004a540 blocked  77922367   k   no   sys                         general:         pthread addr = 0x00000001100aa2f8         size         = 0x488         vp addr      = 0x00000001100ac548         size         = 0x330         thread errno = 0         start pc     = 0x100002b04         joinable     = yes         pthread_t    = 1      scheduler:         kernel       =         user         = 1 (other)         nice         = 60      event :         event        = 0x0         cancel       = enabled, deferred, not pending      stack storage:         base         = 0xfffffff00000000         size         = 0xfffff910         limit        = 0xffffffffffff910         sp           = 0xffffffffffff610

References:

IBM AIX 6.1 Information Center: dbx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.