bash shell script Part.1 入門

前言 順便紀錄一下雷點reference: NTU csie NASA Bash 赴值 command use double quotes when referencing stackoverflow 參數 數字 迴圈 判斷式 reference:Linux Academy blogRyans Tutorialsunary operator expected ! EXPRESSION The EXPRESSION is false. -n STRING The length of STRING is greater than zero. -z STRING The lengh of STRING is zero (ie it is empty). STRING1 = STRING2 STRING1 Read more about bash shell script Part.1 入門[…]

gdb 與 父子程序

先上結論 set follow-fork-mode parent set follow-fork-mode child show follow-fork-mode 有時候會遇到debug到一半就跳出子程序,就結束了 [New process 28128] process 28128 is executing new program: /bin/dash [Inferior 2 (process 28128) exited with code 02] 只要下 set follow-fork-mode parent ,就可以繼續留在 parent process

在gdb中用原始碼debug glibc

打開/etc/apt/sources.list # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://debian.linux.org.tw/ubuntu/ bionic main restricted deb-src http://debian.linux.org.tw/ubuntu/ bionic main restricted 把main restricted的deb-src取消註解找個適當的地方執行apt-get source glibc在.gdbinit中加入 set directories /path/to/glibc-source/glibc-2.27/mallocdone!

再學C++ ─ I/O streams 篇

幾乎所有的內容都從 “Data Structure and Programming Prof. Chung-Yang (Ric) Huang” 取得 Formatted und Unformatted Unformatted I/O (Low-level) get, getline, put, read, write… high-speed, high-volume may have portability problem Formatted I/O (High-level) operators “<<“ and “>>”, I/O manipulators bytes are grouped into meaningful units (e.g. integer, float and character…), and sensitive to data types If unexpected data Read more about 再學C++ ─ I/O streams 篇[…]

再學C++

前言 修了電機的資料結構,還蠻有趣的。這篇大概就是放一些容易搞錯的東西。 內容幾乎都來自Data Structure and Programming Prof. Chung-Yang (Ric) Huang。 主文 pointer The memory size of a memory address depends on the machine architecture 32-bit machine: 4 Bytes 64-bit machine: 8 Bytes The memory content of the pointer variables For 32-bit machine, the last 2 bits are 0’s For 64-bit machine, the last 3 bits Read more about 再學C++[…]