Program Debugging
Print this page
  • Program giving wrong output, that it is executing lines 16 and 17, which is in the if part.
  • We have to check why if condition is satisfied?
  • Use the print command to display the values stored in variables or expression.

    (gdb) print length

    $1 = 5

    (gdb)

    •  Length of the input string “madam" is correct. Check other variables.

    (gdb) print mid

    $2 = 2

    (gdb)

 
Prev