Question: This is gdb debugging. There is an input.txt file. And follow the code make input.txt file. x 5 0 0 = viswa 1 0 6
This is gdb debugging. There is an input.txt file.
And follow the code make input.txt file.
x viswa Need help with all the phases.
puzzlebox.c: Inputs are read from a file on the command line. The inputs are modified in various ways to check against specific patterns associated with "phases". Each set of correct inputs "passes" a phase and scores points. USING THE DEBUGGER is almost essential to understand what is happening in the source code. Compile with debug flags and run in the gdb debugger as in gcc g o puzzlebox puzzlebox.c gdb tui puzzlebox Original DebugMe.java version and rhymes by Mark Snyder C PortAdaptation by Chris Kauffman DO NOT MODIFY THIS FILE #include #include #include #include #include #define BUFSIZE #define NSTAGES int pointsNSTAGES; int score ; int maxscore ; char userID NULL; int hash ; void setup; void endnow; void phase; void phase; void phase; void phase; void phase; void phase; void phase; void phase; void phase; void phase; int mainint argc, char argv printf
; if sizeofint sizeoflong printfUnexpected byte sizes of int or long
; printfs s
"EXPECT","ACTUAL"; printf int: d lu
sizeofint; printflong: d lu
sizeoflong; printf
; printfpuzzlebox must be run on a bit architecture. Bailing out
; return ; if argc printfusage: s
argv; printf Provide a text file to read from on the command line
; printf The first token in the input file is your Internet ID like kolb
; printf Bailing out.
; return ; setupargv; printfPHASE : A puzzle you say? Challenge accepted!
; phase; score points; printfPHASE : That was cake by the ocean! Wait: the cake is a lie!
; phase; scorepoints; printfPHASE : Warmup is over. This $# just got real.
; phase; scorepoints; printfPHASE : Tired yet? Nope? There's more in phase four.
; phase; scorepoints; printfPHASE : You're doing well. But can you break through this secret technique of darkness?
; phase; scorepoints; printfPHASE : Watch out, here comes a wall of bricks! It's time for you to solve phase six.
; phase; scorepoints; printfPHASE : Next it's phase eleven! oops, seven. offby errors don't lose credit, right?
; phase; scorepoints; printfPHASE : You're doing great, now try phase
; phase; scorepoints; printfPHASE : Finally, the finish line; Can you solve phase nine?
; phase; scorepoints; printfPHASE : Rule #: The doctor lies. Next time a message mentions 'finish line, check the source code.
; phase; scorepoints; printfAchievement Unlocked
; printfgdb Yeah you know me
; endnow; return ; void setupsignalhandlers; void failurechar msg; void endnow; void setupinputchar fname; void closeinput; char nextinput; void setupchar infilename setupsignalhandlers; setupinputinfilename; userID nextinput; int len strlenuserID; if len printfs is a userID and must be characters
userID; exit; hash ; int hashint userID; int hashint userID ; hash hashhash; if hash hash hash; printfUserID s accepted: hash value d
userID, hash; #define NSIGNALS char signalnamesNSIGNALS "SIGHUP", Hangup "SIGINT", Interrupt "SIGQUIT", Quit "SIGILL", Illegal Instruction "SIGTRAP", TraceBreakpoint Trap "SIGABRT", Abort "SIGEMT", Emulation Trap "SIGFPE usually divide by Arithmetic Exception "SIGKILL", Killed "SIGBUS", Bus Error "SIGSEGV out of bounds memory Segmentation Fault "SIGSYS", Bad System Call "SIGPIPE", Broken Pipe "SIGALRM",
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
