Andes Workshop

It is currently Fri Mar 29, 2024 6:31 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: set trust-readonly-sections off
PostPosted: Thu Dec 19, 2013 2:58 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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 8790 times ]


In gdb command view, use the command "set trust-readonly-sections off"
Attachment:
2.gif
2.gif [ 12.51 KiB | Viewed 8790 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 8790 times ]


Top
 Profile Send private message E-mail  
 
 Post subject: Re: set trust-readonly-sections off
PostPosted: Fri Sep 12, 2014 3:22 pm 
Offline

Joined: Thu Apr 03, 2014 10:09 am
Posts: 42
The MCU Program support the "set trust-readonly-sections off" item.
Attachment:
debug.jpg
debug.jpg [ 115.9 KiB | Viewed 8341 times ]


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

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


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