Andes Workshop

It is currently Sun May 31, 2020 7:01 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to set memory regions in gdb
PostPosted: Tue Sep 17, 2013 5:08 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
How to set memory regions in gdb?
In AndeSight, you can use the memory map view.

The reference of gdb memory region:
https://sourceware.org/gdb/onlinedocs/g ... butes.html

The use of memory region is to specify the read-only region.
For example, gdb command "finish", "next" or "step" is to use software breakpoints.
If gdb write a software breakpoint on read-only region, it may cause some errors.
For example, writing an software breakpoint to read-only region may cause BUS to hang.
If assigning the read-only region, then gdb will switch to hardware breakpoints.

memory region setting method:
The following is to list memory regions
info mem
Using user-defined memory regions.
Num Enb Low Addr High Addr Attrs
1 y 0x00000000 0x08000000 rw 32 nocache
2 y 0x80400000 0x82400000 ro 32 nocache
3 y 0x90100000 0x90100090 rw 32 nocache
4 y 0x90200000 0x90200088 rw 32 nocache
5 y 0x90300000 0x90300108 rw 32 nocache
6 y 0x90400000 0x90400178 rw 32 nocache
7 y 0x90500000 0x905000c4 rw 32 nocache
8 y 0x90600000 0x9060c800 rw 32 nocache
9 y 0x90900000 0x909000fc rw 32 nocache
10 y 0x98100000 0x98100104 rw 32 nocache
11 y 0x98300000 0x98300078 rw 32 nocache
12 y 0x98400000 0x98400040 rw 32 nocache
13 y 0x98500000 0x98500020 rw 32 nocache
14 y 0x98600000 0x98600040 rw 32 nocache
15 y 0x98700000 0x98700080 rw 32 nocache
16 y 0x98800000 0x98800070 rw 32 nocache
17 y 0x98a00000 0x98a00038 rw 32 nocache
18 y 0x98b00000 0x98b00068 rw 32 nocache
19 y 0x98d00000 0x98d00038 rw 32 nocache
20 y 0x98e00000 0x98e000a4 rw 32 nocache
21 y 0x99100000 0x9910001c rw 32 nocache
22 y 0x99400000 0x99400068 rw 32 nocache
23 y 0x99600000 0x99600078 rw 32 nocache
to delete region 1
delete mem 1
info mem

Using user-defined memory regions.
Num Enb Low Addr High Addr Attrs
2 y 0x80400000 0x82400000 ro 32 nocache
3 y 0x90100000 0x90100090 rw 32 nocache
4 y 0x90200000 0x90200088 rw 32 nocache
5 y 0x90300000 0x90300108 rw 32 nocache
6 y 0x90400000 0x90400178 rw 32 nocache
7 y 0x90500000 0x905000c4 rw 32 nocache
8 y 0x90600000 0x9060c800 rw 32 nocache
9 y 0x90900000 0x909000fc rw 32 nocache
10 y 0x98100000 0x98100104 rw 32 nocache
11 y 0x98300000 0x98300078 rw 32 nocache
12 y 0x98400000 0x98400040 rw 32 nocache
13 y 0x98500000 0x98500020 rw 32 nocache
14 y 0x98600000 0x98600040 rw 32 nocache
15 y 0x98700000 0x98700080 rw 32 nocache
16 y 0x98800000 0x98800070 rw 32 nocache
17 y 0x98a00000 0x98a00038 rw 32 nocache
18 y 0x98b00000 0x98b00068 rw 32 nocache
19 y 0x98d00000 0x98d00038 rw 32 nocache
20 y 0x98e00000 0x98e000a4 rw 32 nocache
21 y 0x99100000 0x9910001c rw 32 nocache
22 y 0x99400000 0x99400068 rw 32 nocache
23 y 0x99600000 0x99600078 rw 32 nocache
Add 0x00000000 to 0x07000000, set as read-only region
mem 0x00000000 0x07000000 ro 32 nocache
info mem
Using user-defined memory regions.
Num Enb Low Addr High Addr Attrs
24 y 0x00000000 0x07000000 ro 32 nocache
2 y 0x80400000 0x82400000 ro 32 nocache
3 y 0x90100000 0x90100090 rw 32 nocache
4 y 0x90200000 0x90200088 rw 32 nocache
5 y 0x90300000 0x90300108 rw 32 nocache
6 y 0x90400000 0x90400178 rw 32 nocache
7 y 0x90500000 0x905000c4 rw 32 nocache
8 y 0x90600000 0x9060c800 rw 32 nocache
9 y 0x90900000 0x909000fc rw 32 nocache
10 y 0x98100000 0x98100104 rw 32 nocache
11 y 0x98300000 0x98300078 rw 32 nocache
12 y 0x98400000 0x98400040 rw 32 nocache
13 y 0x98500000 0x98500020 rw 32 nocache
14 y 0x98600000 0x98600040 rw 32 nocache
15 y 0x98700000 0x98700080 rw 32 nocache
16 y 0x98800000 0x98800070 rw 32 nocache
17 y 0x98a00000 0x98a00038 rw 32 nocache
18 y 0x98b00000 0x98b00068 rw 32 nocache
19 y 0x98d00000 0x98d00038 rw 32 nocache
20 y 0x98e00000 0x98e000a4 rw 32 nocache
21 y 0x99100000 0x9910001c rw 32 nocache
22 y 0x99400000 0x99400068 rw 32 nocache
23 y 0x99600000 0x99600078 rw 32 nocache


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

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 2 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