Program Debugging
Print this page
  • It may not be necessary to keep the break point in the above part of the program. So we will see the code around line 15.
 
     

(gdb)   list   15

  1.       }

  2.        length = strlen(argv[1]);
  3.        mid = length/2;
  4.        for (i=0; i<=mid; ++i){
  5.              if (argv[1][i] != argv[1][lengthi]){
  6.              printf("\"%s\" is not a palindrome.\n", argv[1]);
  7.                       exit(0);
  8.                       }
  9. }

    (gdb)

 
Prev