hpunix下標準c c 的除錯 debug

2021-04-14 02:21:00 字數 2248 閱讀 6359

(1) gdb的除錯方式

(1-1 **顯示命令

..(gdb) li

122         stlocaldataarea         ststlocaldataarea;

#124         /* システム共通変數エリア変數 */

125         stsysvararea            ststsysvararea;

#127         /* フォーマット変換機能に利用した全部のエリア変數 */

128         stnha000jparam          ststnha000jparam;

#130         /* 初期化 */

131         ierr*** = 0;

(gdb)

(1-2 斷點處理命令,

(gdb) b nha400j

breakpoint 1 at 0x400000000000b1d4: file nha400j.c, line 154 from /ngn/ap/hen/bin/./nha000j.

(gdb) b 200

breakpoint 2 at 0x4000000000005138: file nha000j.c, line 200 from /ngn/ap/hen/bin/./nha000j.

(gdb) i b

num type           disp enb address    what

1   breakpoint     keep y   0x400000000000b1d4 in nha400j at nha400j.c:154

2   breakpoint     keep y   0x4000000000005138 in main at nha000j.c:200

(gdb) d 2

(1-3 執行處理命令  , , ,

-- r命令從頭執行程式(run),等同於vc++中的(f5)

-- 如果沒有加斷點,將一直執行到完成。

(gdb) r

starting program: /ngn/ap/hen/bin/./nha000j

breakpoint 2, nha400j (pstparadata=0x800003ffff7f48f8,

pcdrrecord=0x800003ffff7f4a18 "01  01,0491,112233,1,1,1,"...) at nha400j.c:154

154         iret = 0;

-- n命令指單步執行(step over),等同於vc++中的(f10)

(gdb) n

155         iindex = 0;

-- c命令指繼續執行(continue),等同於在斷點停下後,繼續往下執行,vc++中的(f5)

gdb) c

continuing.

breakpoint 4, nha400j (pstparadata=0x800003ffff7f48f8,

pcdrrecord=0x800003ffff7f4a18 "01  01,0490,112233,1,1,"...) at nha400j.c:889

889         if ( nha_err_none == isdperr***  )

(gdb) n

893             iret = nhab00j( acsdpanswer, acsdpoffer, pstparadata, &stsdpout );

-- s命令指單步執行(step in),跟入呼叫的函式,等同於vc++中的(f11)

(gdb) s

nhab00j (    pcsdpanswer=0x800003ffff7f5cf8 "v=0//r//,",

pcsdpoffer=0x800003ffff7f60e8 "v=0//r//) at nhab00j.c:67

67              iret = 0;

(1-4 watch命令

-- p命令可以顯示變數值,或者修改變數的值。

(gdb) p stsdpoffer.imediafieldcnt

$2 = 1

(gdb) p icnt = 5

$3 = 5

(2)圖形化的除錯工具(wdb),除了裝載檔案之外,其他除錯方式和vc++中完全一樣。     

CC(標準)版D碟收藏指南(前言)

標準公司的 發行雖然只有5年時間,但想收藏其全部 已經非常困難,有不少已經絕版,就是在二手市場出價上百美圓也很難買到,對一般人而言,買原版幾乎是不可能,好在d版為國內的碟迷提供了另外的收藏渠道。鑑於標準版 的影響和精品地位,歷史上全美 天視等國內d商也出過很多標準d版,可惜大部分老牌的cc碟早已市面...

標準C C 的DLL編寫

dll也就是動態鏈結庫,使用dll程式設計的好處大家應當都知道了吧,可是怎麼樣來作呢,今天我就來說說。首先,你要確定你要匯出那些個函式,然後你就在你要匯出的函式名前加上下面一句話 輸出函式的字首 define dll export extern c declspec dllexport dll ex...

關於c c 標準庫的記錄

1 itoa 原型 extern char itoa int i 用法 include 功能 把整數i轉換成字串 說明 返回指向轉換後的字串的指標 2 atoi 定義於標頭檔案 int atoi const char str long atol const char str long long at...