Short Homework 2 due Oct. 7 This homework has two parts (at the end). Be sure to do both parts. In this homework, you will learn more about using GDB at an advanced level. In GDB, you can type 'help' to learn more about the commands. The basic GDB commands that everyone should know, after help, are: run, where (or bt), frame, next, step, until, finish, list, print, break, info breakpoints, continue, set follow-fork-mode (child/parent), info threads, thread, quit Note also that (auto-complete) and the cursor keys work. In C++, it's necessary to provide a full signature when setting a breakpoint at a function. To do this, try (for example, in GDB): info functions startNewCoordinator As an example, download, configure, and build DMTCP: Download version _2.4.0_ of DMTCP from: wget http://downloads.sourceforge.net/project/dmtcp/2.4.0/dmtcp-2.4.0.tar.gz Untar or unzip it. ./configure CXXFLAGS="-g3 -O0" CFLAGS="-g3 -O0" && make -j make -j check-dmtcp1 Then, try: gdb --args bin/dmtcp_launch -i5 test/dmtcp1 (gdb) info functions startNewCoordinator All functions matching regular expression "startNewCoordinator": File coordinatorapi.cpp: void dmtcp::CoordinatorAPI::startNewCoordinator(dmtcp::CoordinatorMode); (gdb) b 'dmtcp::CoordinatorAPI::startNewCoordinator(dmtcp::CoordinatorMode)' Breakpoint 2 at 0x40cf75: file coordinatorapi.cpp, line 406. The expression 'dmtcp::CoordinatorAPI::startNewCoordinator(dmtcp::CoordinatorMode)' is too long to type accurately. Be sure to use TAB-completion. For those who like a full-screen mode, try ^Xa (control-X a). However, that mode is not always verbose. So, type it again to turn it off when you don't need it. You're now ready for the assignment. PART 1: Write a sequence of GDB commands in the file mygdbinit, and execute: gdb -x mygdbinit --args bin/dmtcp_launch -i500 test/dmtcp1 The GDB commands in mygdbinit should cause your GDB session to follow the fork into a child process that will exec into a dmtcp_coordinator process. Your file must include the run command, some continue commands, and breakpoints at: main startNewCoordinator() fork execv DmtcpCoordinator::eventLoop epoll_wait # Then print the stack: (gdb) where # Then print the local variable, 'thePort' from within the 'main()' routine # Hint: you may need to use the 'frame' command in GDB to get to main, # and then to get back to the most recent frame. # Then print theDefaultCheckpointInterval and theCheckpointInterval # Hint: you may need to use the 'finish' command in GDB to get out # of 'epoll_wait()'. PART 2: How was the checkpoint interval set to 500 seconds in the DMTCP coordinator?