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]

[PATCH]: More '\' vs. '\\' for regexp on Linux


These are some more regular expressions that fail on Linux when
given a single '\'.  They probably slipped by the previous patch
because rather than being passed directly to gdb_test, they are
passed to another proc which then in turn passes them to gdb_test.
2000-12-18  Michael Snyder  <msnyder@mvstp600e.cygnus.com>

	* gdb.base/setvar.exp: Use double '\\' to quote curly braces 
	in regexp.  One '\' does not suffice on Linux.

Index: setvar.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/setvar.exp,v
retrieving revision 1.28
diff -c -3 -p -r1.28 setvar.exp
*** setvar.exp	1999/12/09 21:36:49	1.28
--- setvar.exp	2000/12/19 01:21:59
*************** test_set "set variable v_unsigned_char_a
*** 257,303 ****
  #
  # test "set variable" for "short array[2]"
  #
! test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable short array" 
  #
  # test "set variable" for "signed short array[2]"
  #
! test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable signed short array" 
  #
  # test "set variable" for "unsigned short array[2]"
  #
! test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\{123,.*65080\}"        "set variable unsigned short array" 
  #
  # test "set variable" for "int array[2]"
  #
! test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable int array" 
  #
  # test "set variable" for "signed int array[2]"
  #
! test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable signed int array" 
  #
  # test "set variable" for "unsigned int array[2]"
  #
! test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\{123,.*(4294966840|65080)\}"        "set variable unsigned int array" 
  #
  # test "set variable" for "long array[2]"
  #
! test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable long array" 
  #
  # test "set variable" for "signed long array[2]"
  #
! test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable signed long array" 
  #
  # test "set variable" for "unsigned long array[2]"
  #
! test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\{123,.*$ulong_minus_456\}"        "set variable unsigned long array" 
  #
  # test "set variable" for "float array[2]"
  #
! test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable float array" 
  #
  # test "set variable" for "double array[2]"
  #
! test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\{123,.*-456\}"        "set variable double array" 
  #
  # test "set variable" for type "char *"
  #
--- 257,303 ----
  #
  # test "set variable" for "short array[2]"
  #
! test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable short array" 
  #
  # test "set variable" for "signed short array[2]"
  #
! test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed short array" 
  #
  # test "set variable" for "unsigned short array[2]"
  #
! test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}"        "set variable unsigned short array" 
  #
  # test "set variable" for "int array[2]"
  #
! test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable int array" 
  #
  # test "set variable" for "signed int array[2]"
  #
! test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed int array" 
  #
  # test "set variable" for "unsigned int array[2]"
  #
! test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}"        "set variable unsigned int array" 
  #
  # test "set variable" for "long array[2]"
  #
! test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable long array" 
  #
  # test "set variable" for "signed long array[2]"
  #
! test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed long array" 
  #
  # test "set variable" for "unsigned long array[2]"
  #
! test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"        "set variable unsigned long array" 
  #
  # test "set variable" for "float array[2]"
  #
! test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable float array" 
  #
  # test "set variable" for "double array[2]"
  #
! test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable double array" 
  #
  # test "set variable" for type "char *"
  #
*************** test_set "set v_unsigned_char_pointer=v_
*** 313,319 ****
  #
  # test "set variable" for type "short *"
  #
! test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456"     "set variable short pointer" 
  #
  # test "set variable" for type "signed short *"
  #
--- 313,319 ----
  #
  # test "set variable" for type "short *"
  #
! test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456"     "set variable short pointer" 
  #
  # test "set variable" for type "signed short *"
  #
*************** gdb_test "print *(v_unsigned_short_point
*** 339,374 ****
  #
  # test "set variable" for type "int *"
  #
! test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable int pointer" 
  #
  # test "set variable" for type "signed int *"
  #
! test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed int pointer" 
  #
  # test "set variable" for type "unsigned int *"
  #
! test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\{123,.*(4294966840|65080)\}" "set variable unsigned int pointer"
  test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080)"     "print variable unsigned int pointer+1"
  #
  # test "set variable" for type "long *"
  #
! test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable long pointer" 
  #
  # test "set variable" for type "signed long *"
  #
! test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed long pointer" 
  #
  # test "set variable" for type "unsigned long *"
  #
! test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\{123,.*$ulong_minus_456\}"  "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456"     "set variable unsigned long pointer" 
  #
  # test "set variable" for type "float *"
  #
! test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456"     "set variable float pointer" 
  #
  # test "set variable" for type "double *"
  #
! test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\{123,.*-456\}"  "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456"     "set variable double pointer" 
  #
  # test "set variable" for struct members
  #
--- 339,374 ----
  #
  # test "set variable" for type "int *"
  #
! test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable int pointer" 
  #
  # test "set variable" for type "signed int *"
  #
! test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed int pointer" 
  #
  # test "set variable" for type "unsigned int *"
  #
! test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int pointer"
  test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080)"     "print variable unsigned int pointer+1"
  #
  # test "set variable" for type "long *"
  #
! test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable long pointer" 
  #
  # test "set variable" for type "signed long *"
  #
! test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed long pointer" 
  #
  # test "set variable" for type "unsigned long *"
  #
! test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"  "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456"     "set variable unsigned long pointer" 
  #
  # test "set variable" for type "float *"
  #
! test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456"     "set variable float pointer" 
  #
  # test "set variable" for type "double *"
  #
! test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456"     "set variable double pointer" 
  #
  # test "set variable" for struct members
  #
*************** set timeout 60;
*** 400,416 ****
  # Change the values
  test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \
    "print v_struct1" \
!   ".*.\[0-9\]* = \{.*v_char_member = 32 \' \',.*v_short_member = 33,\
  .*v_int_member = 34,.*\
! v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\}" \
    "set print structure #2"
  
  # Change them back
  test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \
    "print v_struct1" \
!   ".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
  .*v_int_member = 2,.*\
! v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\}" \
    "set print structure #3"
  
  # Test printing of enumeration bitfields.
--- 400,416 ----
  # Change the values
  test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \
    "print v_struct1" \
!   ".*.\[0-9\]* = \\{.*v_char_member = 32 \' \',.*v_short_member = 33,\
  .*v_int_member = 34,.*\
! v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\\}" \
    "set print structure #2"
  
  # Change them back
  test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \
    "print v_struct1" \
!   ".*.\[0-9\]* = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
  .*v_int_member = 2,.*\
! v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \
    "set print structure #3"
  
  # Test printing of enumeration bitfields.

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