Andes Workshop

It is currently Fri Mar 29, 2024 12:13 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: A method to measure Stack Size in AndeSight
PostPosted: Mon Feb 02, 2015 9:49 am 
Offline

Joined: Fri May 04, 2012 6:49 am
Posts: 17
This article shares a method to measure stack size in AndeSight, the core idea is that we fill the stack region with specific value 0xff after loading the elf file to target,then check the stack region after running to the end. OK we take the hello-world project as the example to show how to implement this idea.

Step1: Check the initial stack top. In normal project, we get the stack initial value from the sag file or linker script.In this demo we get the value from the sag file:
Attachment:
stack_init.png
stack_init.png [ 4.6 KiB | Viewed 16740 times ]


Step2: Set the breakpoint as the early beginning (AndeSight will take main() function as the default breakpoint, keep the default setting is OK for measuring stack size, but change breakpoint to _start can show the stack consumption more clearly):
Attachment:
debugsetting.png
debugsetting.png [ 39.61 KiB | Viewed 16745 times ]


Step3: Debug the hello-world project, open Memory View and set a appropriate monitor.(In hello -world the SP = 0x750000, and it's a small project so we watch memory after 0x74ff00 )
Attachment:
memory.png
memory.png [ 32.69 KiB | Viewed 16745 times ]


Step4: Fill the memory with specific value 0xff. AndeSight gets a "import" bar to do this, it's like gdb command "restore". It can import three kinds format, we suggest use "Plain Text". As:
Attachment:
import.png
import.png [ 46.28 KiB | Viewed 16745 times ]


Step5: Continue to run (to the last line of the project). Then check the stack region:
Attachment:
memoryview.png
memoryview.png [ 18.14 KiB | Viewed 16740 times ]

We can get the used stack size is:0x750000 - 0x74ffb0 = 0x50 Byte.

The import plain text file can find here:
Attachment:
test.txt [1.22 KiB]
Downloaded 1197 times


Top
 Profile Send private message E-mail  
 
 Post subject: dixxrfo
PostPosted: Fri Dec 02, 2016 10:48 am 
Offline

Joined: Fri Dec 02, 2016 10:39 am
Posts: 16
Location: Saudi Arabia
plwoyzx

http://www.costa-anatomicas.es/
http://www.autoescuelaalcon.es/
http://www.extretechfestival.es/
http://www.sofasbaratosweb.es/
http://www.hosting-prestashop.es

viagra sin receta
cialis precio
cialis 20
levitra sin receta
super kamagra

_________________
cialis precio


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: Google [Bot] and 18 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group