- 在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的流程.
 
 程式碼下載
http://sites.google.com/site/funningboy/perl_code/hello.c?attredirects=0&d=1
Step 4. 模擬Target 端
% gcc -g -O0 -o hello.gdb hello.c
% cp hello.gdb hello
% strip -s hello
這邊藉由gcc complie出我們要模擬的Target端,Post的部分我們就省略了.
要模擬Traget的部分要靠 gdbsever的功能,請鍵入
% gdbserver :3333 hello
- Step 4 模擬PC連到 Target 端
請在開個新的console,鍵入
% gdb
 
                         執行結果 
         
          Reference links

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