#include #include "trace.h" /** @file trace.c * @brief * @details You will modify this file and implement the two functions defined in trace.h. * You may add other functions you find useful. Any added functions should be declared * static to indicate they are only used within this file. *

* @author Your name */ /** @todo Implement traceStack. * * This functions starts a strack trace that prints the frame address, frame pointer, * return address, the specified number of local variables, and the specified number * of parameters for each frame on the stack. The stack trace should not include * the frame of the traceStack function itself or the main() function * that called the recursive function. * * The function first prints a header for each column in the stack trace using the titles * FrameAddr, FramePtr, ReturnAddr, Parm1, Parm2, ... and Local1, Local2, ... * on a single line. Note that the parameters should be printed in the order they appear * in the function definition. * * The frame address is printed as "%p" while the other values are printed as "0x%08x". * There should be four spaces between each column. * * This function identifies the top of the stack and to determine the first frame pointer. * The function then calls the traceNext function to recursively print the frames on the * stack. */ void traceStack(int parms, int locals) { } /** @todo Implement traceNext. * * This function performs the stack trace one frame at a time. It prints a line * with information about the current stack frame, then recursively calls itself * with the frame pointer of the next stack frame to print. * It stops when there are no more stack frames to print. */ void traceNext(unsigned int *framePointer, int parms, int locals) { }