From eb91a94bcdd23bd19b5d1314637d61018e889373 Mon Sep 17 00:00:00 2001 From: "smithbenjamin2022@gmail.com" Date: Sat, 22 Oct 2022 14:10:30 -0700 Subject: Good Push? --- .../CST116-CH9-Smith-Pseudo-Code.txt | 19 +++++++++++++++++++ CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 10 ++++++++-- CST116-Ch9-Debugging/CST116-Ch9-Smith.txt | 8 ++++++++ .../Debug/CST116-C.dbddd78c.tlog/CL.command.1.tlog | Bin 0 -> 958 bytes .../x64/Debug/CST116-C.dbddd78c.tlog/CL.read.1.tlog | Bin 0 -> 19786 bytes .../x64/Debug/CST116-C.dbddd78c.tlog/CL.write.1.tlog | Bin 0 -> 884 bytes .../CST116-Ch9-Debugging.lastbuildstate | 2 ++ .../Debug/CST116-C.dbddd78c.tlog/link.command.1.tlog | Bin 0 -> 1784 bytes .../Debug/CST116-C.dbddd78c.tlog/link.read.1.tlog | Bin 0 -> 3660 bytes .../Debug/CST116-C.dbddd78c.tlog/link.write.1.tlog | Bin 0 -> 964 bytes .../x64/Debug/CST116-Ch9-Debugging.exe | Bin 0 -> 69120 bytes .../x64/Debug/CST116-Ch9-Debugging.exe.recipe | 11 +++++++++++ .../x64/Debug/CST116-Ch9-Debugging.ilk | Bin 0 -> 733016 bytes .../x64/Debug/CST116-Ch9-Debugging.log | 2 ++ .../x64/Debug/CST116-Ch9-Debugging.obj | Bin 0 -> 76996 bytes .../x64/Debug/CST116-Ch9-Debugging.pdb | Bin 0 -> 1544192 bytes ...CST116-Ch9-Debugging.vcxproj.FileListAbsolute.txt | 1 + .../x64/Debug/cst116-ch9-debugging.obj.enc | Bin 0 -> 76996 bytes CST116-Ch9-Debugging/x64/Debug/vc143.idb | Bin 0 -> 166912 bytes CST116-Ch9-Debugging/x64/Debug/vc143.pdb | Bin 0 -> 405504 bytes 20 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 CST116-Ch9-Debugging/CST116-CH9-Smith-Pseudo-Code.txt create mode 100644 CST116-Ch9-Debugging/CST116-Ch9-Smith.txt create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.command.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.read.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.write.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CST116-Ch9-Debugging.lastbuildstate create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.command.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.read.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.write.1.tlog create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe.recipe create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.ilk create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.log create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.obj create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.pdb create mode 100644 CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.vcxproj.FileListAbsolute.txt create mode 100644 CST116-Ch9-Debugging/x64/Debug/cst116-ch9-debugging.obj.enc create mode 100644 CST116-Ch9-Debugging/x64/Debug/vc143.idb create mode 100644 CST116-Ch9-Debugging/x64/Debug/vc143.pdb (limited to 'CST116-Ch9-Debugging') diff --git a/CST116-Ch9-Debugging/CST116-CH9-Smith-Pseudo-Code.txt b/CST116-Ch9-Debugging/CST116-CH9-Smith-Pseudo-Code.txt new file mode 100644 index 0000000..1eed71d --- /dev/null +++ b/CST116-Ch9-Debugging/CST116-CH9-Smith-Pseudo-Code.txt @@ -0,0 +1,19 @@ +main() +1) Initialize variables 'age' and 'days' and set them both to 0 +2) Get the user's age using the GetAge function +3) Set the 'days' variable to how many days that would be in 'age' amount of years using the CalcDays function +4) Call the PrintResults function using 'days' and 'age' as the input variables + +GetAge() +1) Initialize the local variable 'age' +2) get the user to input their age +3) Return 'age' + +CalcDays() +1) Initialize local variables 'years' and 'days' having 'years' be the input variable +2) Calculate days to be years * DAYS_PER_YEAR (365) +3) Return days + +PrintResults() +1) Output the user's age +2) Output the user's days oldness \ No newline at end of file diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp index eff8980..7d1c10c 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -12,15 +12,19 @@ * 4) Add another watch using &age for the name. This will display * the address of age. * 5) Write down the address of age. +* 0x000000d5558ffb04 {0} + * 6) Step Into the code for the function GetAge. * 7) The execution continues to the function header for GetAge. * 8) Step into one more time. * 9) Why did the address of age and value change? +* It changed because it's now referring to the funcion CalcDays() rather than just the variable by itself * 10) Step over the cout and cin statements. * 11) Verify the value entered is stored properly in age. * 12) Step into until the flow returns to main. * 13) Step over one more time. * 14) Why didn't the value entered get transferred back to main? +* Because the value entered was only for the local variable 'age' inside the function rather than the global variable * 15) Stop debugging and fix the error. * 16) Run to Breakpoint 1. * 17) Step over the function call to GetAge. @@ -36,6 +40,7 @@ * 4) Step into one more time so that the current line is the * calculation. * 5) Why is age greyed out in your watch window? +* For some reason or another, my variable never turned gray. It just stayed red. * 6) Stop debugging. * * Debugging Exercise 3 @@ -47,6 +52,7 @@ * 4) Step into the PrintResults function. * 5) Age is 7300? Not even Ralph is that old. * 6) Why did the values for both variables change? +* The input variables to the PrintResults function has the wrong order of varaibles, thus swapping their valued. * 7) Stop debugging and fix the error. * * Debugging Exercise 4 @@ -77,12 +83,12 @@ int main() // Breakpoint 1 // Put breakpoint on the following line - GetAge(); + age = GetAge(); days = CalcDays(age); // Breakpoint 2 // Put breakpoint on the following line - PrintResults(age, days); + PrintResults(days, age); return 0; } diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Smith.txt b/CST116-Ch9-Debugging/CST116-Ch9-Smith.txt new file mode 100644 index 0000000..df4c478 --- /dev/null +++ b/CST116-Ch9-Debugging/CST116-Ch9-Smith.txt @@ -0,0 +1,8 @@ +Please enter your age: 20 +20! Boy are you old! +Did you know that you are at least 7300 days old? + + +C:\Users\cowpi\Source\Repos\cst116-ch9-debugging-Smith-Benjami\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging.exe (process 10264) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . \ No newline at end of file diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.command.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.command.1.tlog new file mode 100644 index 0000000..6a695c6 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.command.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.read.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.read.1.tlog new file mode 100644 index 0000000..adc3fc2 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.read.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.write.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.write.1.tlog new file mode 100644 index 0000000..75d55f7 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CL.write.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CST116-Ch9-Debugging.lastbuildstate b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CST116-Ch9-Debugging.lastbuildstate new file mode 100644 index 0000000..c138518 --- /dev/null +++ b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/CST116-Ch9-Debugging.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0: +Debug|x64|C:\Users\cowpi\Source\Repos\cst116-ch9-debugging-Smith-Benjami\CST116-Ch9-Debugging\| diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.command.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.command.1.tlog new file mode 100644 index 0000000..a499f96 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.command.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.read.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.read.1.tlog new file mode 100644 index 0000000..26d60d9 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.read.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.write.1.tlog b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.write.1.tlog new file mode 100644 index 0000000..65f9faf Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-C.dbddd78c.tlog/link.write.1.tlog differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe new file mode 100644 index 0000000..4e436fa Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe.recipe b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe.recipe new file mode 100644 index 0000000..a79f7f7 --- /dev/null +++ b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\cowpi\Source\Repos\cst116-ch9-debugging-Smith-Benjami\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging.exe + + + + + + \ No newline at end of file diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.ilk b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.ilk new file mode 100644 index 0000000..62c4833 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.ilk differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.log b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.log new file mode 100644 index 0000000..abe70d7 --- /dev/null +++ b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.log @@ -0,0 +1,2 @@ + CST116-Ch9-Debugging.cpp + CST116-Ch9-Debugging.vcxproj -> C:\Users\cowpi\Source\Repos\cst116-ch9-debugging-Smith-Benjami\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging.exe diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.obj b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.obj new file mode 100644 index 0000000..1e2651e Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.obj differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.pdb b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.pdb new file mode 100644 index 0000000..431a161 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.pdb differ diff --git a/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.vcxproj.FileListAbsolute.txt b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..2eb7498 --- /dev/null +++ b/CST116-Ch9-Debugging/x64/Debug/CST116-Ch9-Debugging.vcxproj.FileListAbsolute.txt @@ -0,0 +1 @@ +C:\Users\cowpi\source\repos\cst116-ch9-debugging-Smith-Benjami\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging.exe diff --git a/CST116-Ch9-Debugging/x64/Debug/cst116-ch9-debugging.obj.enc b/CST116-Ch9-Debugging/x64/Debug/cst116-ch9-debugging.obj.enc new file mode 100644 index 0000000..4b2bd0a Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/cst116-ch9-debugging.obj.enc differ diff --git a/CST116-Ch9-Debugging/x64/Debug/vc143.idb b/CST116-Ch9-Debugging/x64/Debug/vc143.idb new file mode 100644 index 0000000..6583eb6 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/vc143.idb differ diff --git a/CST116-Ch9-Debugging/x64/Debug/vc143.pdb b/CST116-Ch9-Debugging/x64/Debug/vc143.pdb new file mode 100644 index 0000000..f71cc90 Binary files /dev/null and b/CST116-Ch9-Debugging/x64/Debug/vc143.pdb differ -- cgit v1.2.3