Andes Workshop
http://forum.andestech.com/

修改.Andesgdbinit的方法
http://forum.andestech.com/viewtopic.php?f=16&t=658
Page 1 of 1

Author:  cindy [ Wed Jan 16, 2013 6:27 pm ]
Post subject:  修改.Andesgdbinit的方法

不建議修改.Andesgdbinit。
因為怕toolchain更新忘了加上去。
如果真的要改,請參考下面的說明。
.Andesgdbinit路徑:在toolchain的bin目錄裡。

1. 在target一連上的時候
請加在這2個地方
define target hookpost-remote
set $nds32_target = 1
xxxxxxxxx
end


define target hookpost-extended-remote
set $nds32_target = 1
xxxxxxxxxxxxxxx
end


2. 在load code之前
# Disable cache when loading code
define hook-load
xxxxxxxxxxxxxx
if $nds32_target
if $nds32_elf_check
nds32 elf-check
end

set $old_mr8 = $mr8
set $mr8 = 0
maintenance packet qPart:nds32:request:InvalidateCache
maintenance packet qPart:nds32:request:MemAccBus
end
end


3. 在load code之後
define hookpost-load
xxxxxxxxxxxxxxxxxxxx
if $nds32_target
maintenance packet qPart:nds32:request:MemAccCPU
set $mr8 = $old_mr8
nds32 set-gloss
end
end

上面的邏輯很簡單..在某指令xxxx執行之前,就叫hook-xxxx,
在某個指令執行之後,就叫hookpost-xxxx。
xxxx就看需要,例如加next也行。

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/