Question
Using c code: What line causes the value stored in i to go bad? What is the cause? How could it be fixed?(gdb) list i
Using c code: What line causes the value stored in i to go bad? What is the cause? How could it be fixed?(gdb) list i 1 /* 2 Example file to debug 3 */ 4 5 #include 6 #include 7 #include 8 9 int main (int argc, char *argv[]) { 10 (gdb) list 10 5 #include 6 #include 7 #include 8 9 int main (int argc, char *argv[]) { 10 11 char str2[] "abc"; 12 char str3[] = "def"; 13 int i = 5; 14 char str1[6]; (gdb) break 13 Breakpoint 1 at ox4005ea: file file2debug.c, line 13. (gdb)r lmnopqrstuvwxyz Appending lmnopqrstuvwxyz to ef gives lmnopqrstuvwxyzdef done is 119 while i is 8026488 [Inferior 1 (process 17152) exited normally] (gdb)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started