Skip to content

This project aims to design and implement a StackFrame module that provides the functionality to establish the base pointer and return address in the caller’s stack frame and also print out stackframe data. This project helps understand stack frames through inline assembly with x86-64 in AT&T syntax.

Notifications You must be signed in to change notification settings

ChedySmaoui/C-StackFrame-Printer

Repository files navigation

C-Architecture, Stackframe Printer

Please give me a star if this was useful to you!

Objective

This project aims to design and implement a StackFrame module that provides the functionality to establish the base pointer and return address in the caller’s stack frame and also print out stackframe data. This project helps understand stack frames through inline assembly with x86-64 in AT&T syntax.

Grade Received: 20/20

1. How to build

See Makefile for the build scripts.

To build the TryStackFrames executable, simply run make at the command line in the current directory.

To compile and run the test suite, run make Tests.

Important: the command make clean will try to delete any executable or .o files in the src directory (tests or main executable files included).

2. Project Overview

  1. My program implementation is in StackFrames.c
  2. The header file has been edited to add MACRO definitions
  3. The Makefile has been edited to implement to make the test suite executables.

3. Testing Framework

To compile and run the test suite, run make Tests. This will automatically print the Stack Frames for different variants of executeFactorial. The stack frames printed out are for the following factorial numbers: 0!, 1!, 7!, 10!, and 20!.

  1. TestFactorial0 is a variant almost identical to Factorial but performs factorial(0,1).
  2. TestFactorial1 is a variant almost identical to Factorial but performs factorial(1,1).
  3. TestFactorial7 is a variant almost identical to Factorial but performs factorial(7,1).
  4. TestFactorial10 is a variant almost identical to Factorial but performs factorial(10,1).
  5. TestFactorial20 is a variant almost identical to Factorial but performs factorial(20,1).

About

This project aims to design and implement a StackFrame module that provides the functionality to establish the base pointer and return address in the caller’s stack frame and also print out stackframe data. This project helps understand stack frames through inline assembly with x86-64 in AT&T syntax.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published