CS 210 PROJECT #5 Due Date: Noon Tuesday 12/02/03 This project introduces students to the Linux 'ptrace' programming interface, used to allow a parent-process to control the execution of a child-process for debugging purposes. PROBLEM STATEMENT Develop our initial debugger prototype (named 'mytracer.cpp') into a more useful tool for interactively debugging future assembly language application programs, by incorporating the following new features: 1) Redesign the display for the processor's register-values so it occupies fewer lines on the screen, like this: EAX=00000000 ECX=00000000 ESI=00000000 EFL=00000000 CS=0000 EIP=00000000 EBX=00000000 EDX=00000000 EDI=00000000 EBP=00000000 SS=0000 ESP=00000000 DS=0000 ES=0000 FS=0000 GS=0000 2) Display an additional line on the screen that shows the values of the seven topmost elements stored on the child's stack (use the PTRACE_PEEKDATA subfunction), like this: TOS: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3) Display another additional line on the screen which shows the next sixteen bytes in the child's instruction-stream (use the PTRACE_PEEKTEXT subfunction), like this: Next instruction-bytes: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4) Setup the terminal for non-canonical keyboard input, so that the debugger can respond to single-keystroke commands; 5) Reprogram the response to keyboard-input so that these four single-key commands are recognized: <'s'>-key: 'single-step' the child-process <'c'>-key: 'continue' the child-process <'k'>-key: 'kill' the child-process -key: terminate the parent-process 6) Remove the for-loop with its fixed number of iterations, and substitute a while-loop that will continue executing until a condition-variable (named 'done') becomes true (nonzero). _______________________________________________________________________ (c) Allan B. Cruse University of San Francisco Fall 2003