
C
Write a separate program that takes one command line argument indicating a binary stack file (e.g., stack.bin). Provide an appropriate error message in case of a missing filename or error opening it. The program should visualize the stack frame and call information in the file as shown in the following sample output:
Sample Output:
function: 0x5639db7fc2ca, caller: 0x7f8b8f372290, frame pointer: 0x7ffd23831080
stack frame: 0x7ffd23831080-0x7ffd23831070, time: 0.003484 (2158-5642)
address range initial final
0x7ffd2383107f-0x7ffd2383107c: 00007f8b | 00007f8b
0x7ffd2383107b-0x7ffd23831078: 8f372290 | 8f372290
0x7ffd23831077-0x7ffd23831074: 00000000 | 00000000
0x7ffd23831073-0x7ffd23831070: 00000001 | 00000001
function: 0x5639db7fc1d9, caller: 0x5639db7fc2f3, frame pointer: 0x7ffd23831060
stack frame: 0x7ffd23831060-0x7ffd23831030, time: 0.002587 (2173-4760)
address range initial final
0x7ffd2383105f-0x7ffd2383105c: 00005639 | 00005639
0x7ffd2383105b-0x7ffd23831058: db7fc2f3 | db7fc2f3
0x7ffd23831057-0x7ffd23831054: 00007ffd | 00007ffd
0x7ffd23831053-0x7ffd23831050: 23831070 | 23831070
0x7ffd2383104f-0x7ffd2383104c: bbc0f880 | bbc0f880
0x7ffd2383104b-0x7ffd23831048: 778a2800 | 778a2800
0x7ffd23831047-0x7ffd23831044: 00000000 | 03030303
0x7ffd23831043-0x7ffd23831040: 00000000 | 03030303
0x7ffd2383103f-0x7ffd2383103c: 00005639 | 03035639
0x7ffd2383103b-0x7ffd23831038: db7fc2ca | 89abcdef
0x7ffd23831037-0x7ffd23831034: 00007f8b | 0000000a
0x7ffd23831033-0x7ffd23831030: 8f372290 | 000186a0
function: 0x5639db7fc1d9, caller: 0x5639db7fc29d, frame pointer: 0x7ffd23831020
stack frame: 0x7ffd23831020-0x7ffd23830ff0, time: 0.001733 (3015-4748)
address range initial final
0x7ffd2383101f-0x7ffd2383101c: 00005639 | 00005639
0x7ffd2383101b-0x7ffd23831018: db7fc29d | db7fc29d
0x7ffd23831017-0x7ffd23831014: 00007ffd | 00007ffd
0x7ffd23831013-0x7ffd23831010: 23831050 | 23831050
0x7ffd2383100f-0x7ffd2383100c: bbc0f880 | bbc0f880
0x7ffd2383100b-0x7ffd23831008: 778a2800 | 778a2800
0x7ffd23831007-0x7ffd23831004: 00007ffd | 02020202
0x7ffd23831003-0x7ffd23831000: 23831050 | 02020202
0x7ffd23830fff-0x7ffd23830ffc: 00007ffd | 02027ffd
0x7ffd23830ffb-0x7ffd23830ff8: 23831188 | 89abcdef
0x7ffd23830ff7-0x7ffd23830ff4: 00005639 | 0000000a
0x7ffd23830ff3-0x7ffd23830ff0: db7fc2f3 | 000186a0
function: 0x5639db7fc1d9, caller: 0x5639db7fc29d, frame pointer: 0x7ffd23830fe0
stack frame: 0x7ffd23830fe0-0x7ffd23830fb0, time: 0.000851 (3883-4734)
address range initial final
0x7ffd23830fdf-0x7ffd23830fdc: 00005639 | 00005639
0x7ffd23830fdb-0x7ffd23830fd8: db7fc29d | db7fc29d
0x7ffd23830fd7-0x7ffd23830fd4: 00007ffd | 00007ffd
0x7ffd23830fd3-0x7ffd23830fd0: 23831010 | 23831010
0x7ffd23830fcf-0x7ffd23830fcc: bbc0f880 | bbc0f880
0x7ffd23830fcb-0x7ffd23830fc8: 778a2800 | 778a2800
0x7ffd23830fc7-0x7ffd23830fc4: 00007ffd | 01010101
0x7ffd23830fc3-0x7ffd23830fc0: 23831010 | 01010101
0x7ffd23830fbf-0x7ffd23830fbc: 00007ffd | 01017ffd
0x7ffd23830fbb-0x7ffd23830fb8: 23831188 | 89abcdef
0x7ffd23830fb7-0x7ffd23830fb4: 00005639 | 0000000a
0x7ffd23830fb3-0x7ffd23830fb0: db7fc29d | 000186a0
function: 0x5639db7fc1d9, caller: 0x5639db7fc2fd, frame pointer: 0x7ffd23831060
stack frame: 0x7ffd23831060-0x7ffd23831030, time: 0.000851 (4781-5632)
address range initial final
0x7ffd2383105f-0x7ffd2383105c: 00005639 | 00005639
0x7ffd2383105b-0x7ffd23831058: db7fc2fd | db7fc2fd
0x7ffd23831057-0x7ffd23831054: 00007ffd | 00007ffd
0x7ffd23831053-0x7ffd23831050: 23831070 | 23831070
0x7ffd2383104f-0x7ffd2383104c: bbc0f880 | bbc0f880
0x7ffd2383104b-0x7ffd23831048: 778a2800 | 778a2800
0x7ffd23831047-0x7ffd23831044: 03030303 | 01010101
0x7ffd23831043-0x7ffd23831040: 03030303 | 01010101
0x7ffd2383103f-0x7ffd2383103c: 03035639 | 01015639
0x7ffd2383103b-0x7ffd23831038: 89abcdef | 89abcdef
0x7ffd23831037-0x7ffd23831034: 0000000a | 0000000a
0x7ffd23831033-0x7ffd23831030: 000186a0 | 000186a0
Please print out as shown in the sample output above and show the full code and output as well. There must be no errors in the program with comments within the code as well.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- In C++ Write a line of code that creates an array for 100 decimal numbers in the heap, then write another line of code to reclaim the used heap memory.arrow_forwardC++ Code dynamicarray.h and dynamicarray.cpparrow_forwardComplete the missing code then compile, debug and test your program using the command lines below: c++ -o project1 project1.cpp <enter> ./project1 n m k <enter> Where n is the size of the stack, m is the modular of the real part and imagination part of a random complex number, and k is the number of elements displayed per line. In the main function, you need to Get the values n, m, and k from the command line. Declare a complex number stack of size n, generate n random complex numbers and push them into the stack. Meantime display all these numbers, k numbers per line. Display all elements of the stack, k elements per line. Create two random complex numbers c1 and c2, display c1, c2 and the results of the addition c1+c2, the subtraction c1-c2, the multiplication c1*c2, and the division c1/c2. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; class Complex {…arrow_forward
- Using the PEP 8 machine. Create a function that takes 2 arguments and returns a result. When I say function I mean that the parameters and the return value are passed on the stack . You code must have a function and a main program that calls the function using the stack. Assignment will not be accepted if you are not passing parameters and return value in the stack. Please note a complete "pass by stack" example is below. The function adds two numbers. Feel free to use that as starter code. The function you do should be one of three operations: 1) multiply - return the product of the two factors 2) divide - return the quotient ( integer arithmetic ) 3) remainder / modulo - return the remainder of the division of the two factors.arrow_forwardDefine a function named display_word (encrypted_list) which takes a list of characters as a parameter. The function prints the parameter list as shown in the examples below. Note: you can assume that the parameter list is not empty. For example: Test Result **¹, ¹*¹'] GUESS THE WORD: h**** data = ['h', '*', '*', display_word (data) ''*', '*', '*'] GUESS THE WORD: s****** data = ['s', '*', display_word (data)arrow_forwardPut the following code in a main.py file and a module.py file. Define the names sort, list_max and sum_of_list after putting the code into a main file and a module file #predefined modules import random import math #function to sort the list in ascending order def sort(x): #predefined function sort() x.sort() #print the sorted list print("\nSorted list is: ",str(x)) #function to find the sum of list elements def sum_of_list(x): #predefined function sum() Sum=sum(x) #return the sum of list elements return Sum #function to list the maximum from the list def list_max(x): #predefined function max() maximum=max(x) #return maximum return maximum #function to test the above three function def main(): #set a flag variable flag=True #create a list list1=list() #initialize the list element by using randrange() predefined function of random module list1=[random.randrange(1, 50, 1) for i in range(0,7)] #print the…arrow_forward
- C++ Code Use the following list to sort it and create a single linked list: 6,13,7,11,9,2,15,5,3,4,10,14 Also make a list of the available memory. Print the list out with the links. Now delete 11 from the list, adding its location to the available memory list, then add 1 and 8 to the list. When you add the 1 you should use the location of the deleted 11 to add 1 there. Add 8 to the next available spot on the available memory list. When you print the list, print out the logical list using the links and also print out physical list without the links to see what the real list looks like.arrow_forwardplease send asm file and follow all the steps. I need a complete answer to study for final so little explanation would be helpful. Thank youarrow_forwardm = int(temp[1]) IndexError: list index out of range line 3, in <module> m = int(temp[10])IndexError: list index out of range when i ran this test case input: 3 jun3 Jin1 Li2 Kitty2 Josh3 Bob1 Dave2 Jose1 David3 Rob3 Anne3 Ann2 Kevin2 Lara1 ALI3 Xin expected output: Li Dave David ALI Kitty Josh Kevin Lara jun Bob Anne Ann Xinarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





