This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gdbarch.sh.patch


While running gdbarch.sh I got several errors of the form:

gdbarch.sh: [: -1: unary operator expected

Tracking it down resulted in this patch.

2001-04-05  Doug Evans  <dje@casey.transmeta.com>

	* gdbarch.sh (invalid_p handling loop): Properly test for
	non-empty strings.

Index: gdbarch.sh
===================================================================
RCS file: /proj/sw/astro/cvsroot/src/tools/fsf/gdb/gdbarch.sh,v
retrieving revision 1.9
diff -c -p -r1.9 gdbarch.sh
*** gdbarch.sh	2001/02/13 10:19:47	1.9
--- gdbarch.sh	2001/04/06 02:41:18
*************** do
*** 1293,1317 ****
  	then
  	    printf "  /* Skip verify of ${function}, has predicate */\n"
  	# FIXME: See do_read for potential simplification
!  	elif [ "${invalid_p}" -a "${postdefault}" ]
  	then
  	    printf "  if (${invalid_p})\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ "${predefault}" -a "${postdefault}" ]
  	then
  	    printf "  if (gdbarch->${function} == ${predefault})\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ "${postdefault}" ]
  	then
  	    printf "  if (gdbarch->${function} == 0)\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ "${invalid_p}" ]
  	then
  	    printf "  if ((GDB_MULTI_ARCH >= ${level})\n"
  	    printf "      && (${invalid_p}))\n"
  	    printf "    internal_error (__FILE__, __LINE__,\n"
  	    printf "                    \"gdbarch: verify_gdbarch: ${function} invalid\");\n"
! 	elif [ "${predefault}" ]
  	then
  	    printf "  if ((GDB_MULTI_ARCH >= ${level})\n"
  	    printf "      && (gdbarch->${function} == ${predefault}))\n"
--- 1294,1318 ----
  	then
  	    printf "  /* Skip verify of ${function}, has predicate */\n"
  	# FIXME: See do_read for potential simplification
!  	elif [ -n "${invalid_p}" -a -n "${postdefault}" ]
  	then
  	    printf "  if (${invalid_p})\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ -n "${predefault}" -a -n "${postdefault}" ]
  	then
  	    printf "  if (gdbarch->${function} == ${predefault})\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ -n "${postdefault}" ]
  	then
  	    printf "  if (gdbarch->${function} == 0)\n"
  	    printf "    gdbarch->${function} = ${postdefault};\n"
! 	elif [ -n "${invalid_p}" ]
  	then
  	    printf "  if ((GDB_MULTI_ARCH >= ${level})\n"
  	    printf "      && (${invalid_p}))\n"
  	    printf "    internal_error (__FILE__, __LINE__,\n"
  	    printf "                    \"gdbarch: verify_gdbarch: ${function} invalid\");\n"
! 	elif [ -n "${predefault}" ]
  	then
  	    printf "  if ((GDB_MULTI_ARCH >= ${level})\n"
  	    printf "      && (gdbarch->${function} == ${predefault}))\n"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]