C Programming: 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:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C Programming:

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. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education