很多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 [ 13.57 KiB | Viewed 8721 times ]
或者在gdb command view裡可以下command,僅限當次有效。
set trust-readonly-sections off
如下圖:
Attachment:
q1.gif [ 10.75 KiB | Viewed 8722 times ]
Attachment:
q2.gif [ 7.31 KiB | Viewed 8722 times ]