Andes Workshop

It is currently Tue Sep 26, 2017 2:46 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: 使用gdb script在板子上連續跑2個程式
PostPosted: Thu Apr 14, 2011 10:40 am 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
gdb script類似Linux裡的shell script,
可以使gdb執行多個指令。
比方說下面這個例子。

Code:
target remote :9901
file hello1.adx
load
b empty
continue
clear
targetresetrun
file hello2.adx
load
b empty
continue
quit



執行步驟:
(1)打開ICEman
Attachment:
p1.gif
p1.gif [ 4.15 KiB | Viewed 5165 times ]


(2)執行nds32le-elf-gdb.exe -x run_program.txt
Attachment:
p2.gif
p2.gif [ 15.69 KiB | Viewed 5165 times ]


(3)可以看到執行完2個程式
Attachment:
p3.gif
p3.gif [ 14.91 KiB | Viewed 5165 times ]


下面的程式碼大家可以試試。
這2個*.adx檔是以V2 toolchain所編譯,run在N903A及N1033A。
請大家在實驗時,要依你的板子的toolchain為準,重新編譯程式。
Attachment:
gdb_test.7z [30.63 KiB]
Downloaded 439 times


裡面有2個txt,其中1個是AndeSight v1.4用,
另1個是BSP v300使用,
差別在AndeSight v1.4支援monitor reset target指令。
BSP v300支援targetresetrun。
這2個都是一樣的意思,reset板子之後,再跑boot code。

clear表示把中斷點清掉,這樣子才不會影響第2個程式的執行。


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group