Home > Blockchain >  Debugging, I am trying to find where in this code these errors coming from
Debugging, I am trying to find where in this code these errors coming from

Time:12-31

Attempting to diagnose this output from a script I have to debug.

make[1]: Entering directory '/home/dwulf/sifchain/sifchain-validators'
/bin/sh: 1: Syntax error: Unterminated quoted string
make[1]: *** [Makefile:59: sifnode-standalone-boot] Error 2
make[1]: Leaving directory '/home/dwulf/sifchain/sifchain-validators'
make: *** [Makefile:62: sifnode-standalone-wizard] Error 2

Is there a debugger tool to find a Unterminated quote string to find this error?

CodePudding user response:

Maybe link /bin/sh to /bin/bash if it isn't yet. Bash is more verbose to syntax errors. Also try looking for the line that declares /bin/sh or executes it in a Makefile file and add -x to it. Besides that, you can open the buggy script if you find it in a good editor that recognizes Bash syntax and look for some inconsistent highlighting.

CodePudding user response:

You can do binary search to pinpoint quickly: Add an echo cmd to the middle of the code to print a debug message. If it gets printed before the error message, then, the error is located in the second half of the script. Otherwise, it is in the first half. As such you've eliminated half of the search problem. Now, do the same thing to the remaining half (add another echo to the middle of the half) and repeat as many times as necessary.

  • Related