Andes Workshop

It is currently Tue Mar 05, 2024 5:25 pm

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 

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:
stack_init.png [ 4.6 KiB | Viewed 16559 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):
debugsetting.png [ 39.61 KiB | Viewed 16564 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 )
memory.png [ 32.69 KiB | Viewed 16564 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:
import.png [ 46.28 KiB | Viewed 16564 times ]

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

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

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

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

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

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

cialis precio

 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 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group