This is the mail archive of the gdb-patches@sourceware.cygnus.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]

RFA: gdbarch.sh should use sed, not tr.



You could use tr '[a-zA-Z0-9_]' '[ *100]', but that probably won't
work nicely on older tr's.  Sed, on the other hand, should work fine
on just about anything.

1999-09-12  Jim Blandy  <jimb@cris.red-bean.com>

	* gdbarch.sh (generating setters): Use sed to generate the proper
	indentation, not tr; tr's behavior is notoriously unportable.

Index: gdbarch.sh
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbarch.sh,v
retrieving revision 2.38
diff -c -r2.38 gdbarch.sh
*** gdbarch.sh	1999/08/24 04:56:58	2.38
--- gdbarch.sh	1999/09/12 18:10:01
***************
*** 983,989 ****
  	echo ""
  	echo "void"
  	echo "set_gdbarch_${function} (struct gdbarch *gdbarch,"
!         echo "            `echo ${function} | tr '[0-9a-z_]' ' '`  gdbarch_${function}_ftype ${function})"
  	echo "{"
  	echo "  gdbarch->${function} = ${function};"
  	echo "}"
--- 983,989 ----
  	echo ""
  	echo "void"
  	echo "set_gdbarch_${function} (struct gdbarch *gdbarch,"
!         echo "            `echo ${function} | sed -e 's/[0-9a-zA-Z_]/ /g'`  gdbarch_${function}_ftype ${function})"
  	echo "{"
  	echo "  gdbarch->${function} = ${function};"
  	echo "}"
***************
*** 1010,1016 ****
  	echo ""
  	echo "void"
  	echo "set_gdbarch_${function} (struct gdbarch *gdbarch,"
!         echo "            `echo ${function} | tr '[0-9a-z_]' ' '`  ${returntype} ${function})"
  	echo "{"
  	echo "  gdbarch->${function} = ${function};"
  	echo "}"
--- 1010,1016 ----
  	echo ""
  	echo "void"
  	echo "set_gdbarch_${function} (struct gdbarch *gdbarch,"
!         echo "            `echo ${function} | sed -e 's/[0-9a-zA-Z_]/ /g'`  ${returntype} ${function})"
  	echo "{"
  	echo "  gdbarch->${function} = ${function};"
  	echo "}"

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