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

set trust-readonly-sections off
http://forum.andestech.com/viewtopic.php?f=23&t=765
Page 1 of 1

Author:  cindy [ Thu Dec 19, 2013 2:58 pm ]
Post subject:  set trust-readonly-sections off

If we would like to change the memory content in .text or .rodata,
we need to use the gdb command "set trust-readonly-sections off".

set trust-readonly-sections off
Tell gdb not to trust readonly sections. This means that the contents of the section might change while the program is running, and must therefore be fetched from the target when needed.

In the following picture, address 0x0 is .text section. If we modify the memory content,
gdb doesn't read the true memory content.
Attachment:
1.gif
1.gif [ 10.31 KiB | Viewed 8887 times ]


In gdb command view, use the command "set trust-readonly-sections off"
Attachment:
2.gif
2.gif [ 12.51 KiB | Viewed 8887 times ]


Then we can modify the memory content in 0x0 (.text section), and gdb get the true memory content.
Attachment:
3.gif
3.gif [ 10.9 KiB | Viewed 8887 times ]

Author:  jerry [ Fri Sep 12, 2014 3:22 pm ]
Post subject:  Re: set trust-readonly-sections off

The MCU Program support the "set trust-readonly-sections off" item.
Attachment:
debug.jpg
debug.jpg [ 115.9 KiB | Viewed 8438 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/