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

A method to measure Stack Size in AndeSight
http://forum.andestech.com/viewtopic.php?f=23&t=918
Page 1 of 1

Author:  HuJin [ Mon Feb 02, 2015 9:49 am ]
Post subject:  A method to measure Stack Size in AndeSight

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 16815 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 16820 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 16820 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 16820 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 16815 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 1203 times

Author:  RichardWek [ Fri Dec 02, 2016 10:48 am ]
Post subject:  dixxrfo

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

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/