- 在Embedded系統上常被用到的就是GDB Debug的機制,透過Remote control 設定 break point or print register status...
底下是目前最常看到的Debug平台,透過PC 端compiler好 Target(ARM)端的執行檔(.EXE),在藉由JTAG燒入到Target上,最後透過GDB Remote Debug的方式,設定Break Point or Dump Register的方法,達到Realtime Debug.
- 這邊我們簡化流程,把Target端跟Host端都在我們的PC上來模擬Embedded Debug的流程. Step 1. 安裝GDB Debug http://www.gnu.org/software/gdb/ 安裝參考 http://www.zychip.com/html/support/linux_gdb/index.php 這邊要注意,因為我們不須代入ARM-Linux的compiler.只要鍵入安裝路徑就可 % cd gdb-7.0.1 % ./configure --prefix=/usr/local/bin % make % make install PS: 切記路徑必須要在Path中,這樣才能被呼叫. Step 2. check /usr/local/bin/ 內有 gdb.exe, gdbserver.exe check GDB 安裝完成 % gdb 看使否會進GDB 的 console Step 3. sample code && Debug hello.c

- Step 4 模擬PC連到 Target 端
請在開個新的console,鍵入
% gdb

執行結果

or type
回覆刪除gcc -Wall -g -o hello hello.c
Howto: Porting the GNU Debugger
回覆刪除with Or1Km
http://www.embecosm.com/appnotes/ean3/embecosm-howto-gdb-porting-ean3-issue-2.html#id2708968
good ref
回覆刪除http://web.cecs.pdx.edu/~jrb/cs201/lectures/handouts/gdbcomm.txt