GDB 除錯技巧(不斷更新中 )

2021-07-29 18:15:48 字數 1230 閱讀 6469

方法: 在函式前面加類名以及作用域運算子

eg : break a::func //break 到類a的func函式

程式如下:

除錯過程如下:

[kiosk@localhost mess]$ gdb gdb_test

gnu gdb (gdb) red hat enterprise linux 7.6

.1-94.el7

license gplv3+: gnu gpl version 3

or later .org/licenses/gpl.html>

this is free software: you are free to change and redistribute it.

there is no warranty, to the extent permitted by law. type "show copying"

and"show warranty" for details.

this gdb was configured as "x86_64-redhat-linux-gnu".

for bug reporting instructions, please see:

.gnu

.org/software/gdb/bugs/>...

reading symbols from /home/kiosk/practice/mess/gdb_test...done.

(gdb) b a::func //備註:break 到 a::func()位置處

breakpoint 1 at 0x4008fa: file gdb_test.cpp, line 13.

(gdb) b b::func //備註:break 到 b::func()位置處

breakpoint 2 at 0x400924: file gdb_test.cpp, line 20.

(gdb)

Python技巧 不斷更新中

1.讀取檔案的內容 filepath 檔案路徑 lambda f f.read f.close file filepath 0 2.將內容寫入到檔案中 lambda f,d f.write d f.close file r d a.txt w 要寫入的資料 3.根據正規表示式過濾資料夾中的檔案 im...

Python細緻技巧總結(不斷更新)

print str n 1 動態語言能用type 動態建立類,靜態語言不行 3.字串轉數字一 python中字串轉換成數字 方法1 類中進行匯入 import string str 555 num string.atoi str num即為str轉換成的數字 轉換為浮點數 string.atof s...

Python常用技巧工具 不斷更新

雙星 放在字典的前面可以讓你將字典的內容作為命名引數傳遞給函式。字典的鍵是引數的名字,鍵的值作為引數的值傳遞給函式 dictionary defsomefunction a b print a b return these do the same thing somefunction a 1,b 2...