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

.text區的記憶體無法寫入的設定方法
http://forum.andestech.com/viewtopic.php?f=23&t=149
Page 1 of 1

Author:  cindy [ Wed Sep 21, 2011 3:25 pm ]
Post subject:  .text區的記憶體無法寫入的設定方法

很多user發現,AndeSight的memory view在.text區的記憶體無法寫入。
例如.text區由0x500000開始,則0x500000起的一段memory無法寫入。

因為我們預設有一個"set trust-readonly-sections 1"的設定,
這個設定會讓 gdb 不會去remote memory 讀 readonly-section 的值,
而是從local file讀. 所以你會有沒有寫進去的錯覺, 其實寫入還是會執行,
只是讀出會從local file

解決方法:
在 toolchain 下的 .Andesgdbinit 裡開頭會有一行
set trust-readonly-sections 1
請把他移掉, 註解掉, 或是改成 0
Attachment:
off.gif
off.gif [ 13.57 KiB | Viewed 8689 times ]


或者在gdb command view裡可以下command,僅限當次有效。
set trust-readonly-sections off
如下圖:

Attachment:
q1.gif
q1.gif [ 10.75 KiB | Viewed 8690 times ]


Attachment:
q2.gif
q2.gif [ 7.31 KiB | Viewed 8690 times ]

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