Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 2/4] Remove operator BINOP_RANGE
  2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
  2014-07-16  5:19 ` [PATCH 3/4] Update comments to TERNOP_SLICE Yao Qi
@ 2014-07-16  5:19 ` Yao Qi
  2014-07-16  5:19 ` [PATCH 1/4] Remove operator BINOP_IN Yao Qi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-16  5:19 UTC (permalink / raw)
  To: gdb-patches

BINOP_RANGE was added by the following commit for chill language.

commit badefd2800f5ee2dc6a0eef870771af9dc29bba7
Author: Per Bothner <per@bothner.com>
Date:   Wed Nov 29 22:59:31 1995 +0000

        * expression.h (enum exp_opcode):  Add BINOP_RANGE.
        * expprint.c (dump_expression):  Support BINOP_RANGE.
        * eval.c (evaluate_subexp_standard):  Handle BINOP_RANGE (as error).
        (case MULTI_SUBSCRIPT):  Fix broken f77 value->int ad hoc conversion.
        * ch-lang.c (chill_op_print_tab):  Support BINOP_RANGE.
        (evaluate_subexp_chill):  Error on BINOP_COMMA.

Chill language is no longer supported, so we can remove BINOP_RANGE too.
This patch is to remove BINOP_RANGE.

gdb:

2014-07-15  Yao Qi  <yao@codesourcery.com>

	* std-operator.def: Remove BINOP_RANGE.
	* breakpoint.c (watchpoint_exp_is_const): Update.
	* expprint.c (dump_subexp_body_standard): Likewise.
	* eval.c (init_array_element): Remove dead code.
	(evaluate_subexp_standard): Likewise.
---
 gdb/breakpoint.c     |  1 -
 gdb/eval.c           | 48 ++++--------------------------------------------
 gdb/expprint.c       |  1 -
 gdb/std-operator.def |  4 ----
 4 files changed, 4 insertions(+), 50 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bad375b..1c6070f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10602,7 +10602,6 @@ watchpoint_exp_is_const (const struct expression *exp)
 	case BINOP_MAX:
 	case BINOP_INTDIV:
 	case BINOP_CONCAT:
-	case BINOP_RANGE:
 	case TERNOP_COND:
 	case TERNOP_SLICE:
 
diff --git a/gdb/eval.c b/gdb/eval.c
index 949b2f8..f075096 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -369,22 +369,6 @@ init_array_element (struct value *array, struct value *element,
       return init_array_element (array, element,
 				 exp, pos, noside, low_bound, high_bound);
     }
-  else if (exp->elts[*pos].opcode == BINOP_RANGE)
-    {
-      LONGEST low, high;
-
-      (*pos)++;
-      low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-      high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-      if (low < low_bound || high > high_bound)
-	error (_("tuple range index out of range"));
-      for (index = low; index <= high; index++)
-	{
-	  memcpy (value_contents_raw (array)
-		  + (index - low_bound) * element_size,
-		  value_contents (element), element_size);
-	}
-    }
   else
     {
       index = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
@@ -903,11 +887,6 @@ evaluate_subexp_standard (struct type *expect_type,
 	      struct value *element;
 	      int index_pc = 0;
 
-	      if (exp->elts[*pos].opcode == BINOP_RANGE)
-		{
-		  index_pc = ++(*pos);
-		  evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-		}
 	      element = evaluate_subexp (element_type, exp, pos, noside);
 	      if (value_type (element) != element_type)
 		element = value_cast (element_type, element);
@@ -958,22 +937,10 @@ evaluate_subexp_standard (struct type *expect_type,
 	      struct type *range_low_type, *range_high_type;
 	      struct value *elem_val;
 
-	      if (exp->elts[*pos].opcode == BINOP_RANGE)
-		{
-		  (*pos)++;
-		  elem_val = evaluate_subexp (element_type, exp, pos, noside);
-		  range_low_type = value_type (elem_val);
-		  range_low = value_as_long (elem_val);
-		  elem_val = evaluate_subexp (element_type, exp, pos, noside);
-		  range_high_type = value_type (elem_val);
-		  range_high = value_as_long (elem_val);
-		}
-	      else
-		{
-		  elem_val = evaluate_subexp (element_type, exp, pos, noside);
-		  range_low_type = range_high_type = value_type (elem_val);
-		  range_low = range_high = value_as_long (elem_val);
-		}
+	      elem_val = evaluate_subexp (element_type, exp, pos, noside);
+	      range_low_type = range_high_type = value_type (elem_val);
+	      range_low = range_high = value_as_long (elem_val);
+
 	      /* Check types of elements to avoid mixture of elements from
 	         different types. Also check if type of element is "compatible"
 	         with element type of powerset.  */
@@ -2127,13 +2094,6 @@ evaluate_subexp_standard (struct type *expect_type,
 	    }
 	}
 
-    case BINOP_RANGE:
-      evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      if (noside == EVAL_SKIP)
-	goto nosideret;
-      error (_("':' operator used in invalid context"));
-
     case BINOP_SUBSCRIPT:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
diff --git a/gdb/expprint.c b/gdb/expprint.c
index a966203..4e73791 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -802,7 +802,6 @@ dump_subexp_body_standard (struct expression *exp,
     case BINOP_ASSIGN_MODIFY:
     case BINOP_VAL:
     case BINOP_CONCAT:
-    case BINOP_RANGE:
     case BINOP_END:
     case STRUCTOP_MEMBER:
     case STRUCTOP_MPTR:
diff --git a/gdb/std-operator.def b/gdb/std-operator.def
index 16014e0..c33a287 100644
--- a/gdb/std-operator.def
+++ b/gdb/std-operator.def
@@ -87,10 +87,6 @@ OP (BINOP_VAL)
    the second operand with itself that many times.  */
 OP (BINOP_CONCAT)
 
-/* This is the "colon operator" used various places in (the
-   deleted) Chill.  */
-OP (BINOP_RANGE)
-
 /* This must be the highest BINOP_ value, for expprint.c.  */
 OP (BINOP_END)
 
-- 
1.9.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] Remove operator BINOP_IN
  2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
  2014-07-16  5:19 ` [PATCH 3/4] Update comments to TERNOP_SLICE Yao Qi
  2014-07-16  5:19 ` [PATCH 2/4] Remove operator BINOP_RANGE Yao Qi
@ 2014-07-16  5:19 ` Yao Qi
  2014-07-16  8:53 ` [PATCH 4/4] Remove Chill from comments Yao Qi
  2014-07-19  9:17 ` [PATCH 0/4] Remove operators for language chill Tom Tromey
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-16  5:19 UTC (permalink / raw)
  To: gdb-patches

Chill language support was removed several years ago, and BINOP_IN
isn't used for Pascal.  This patch is to remove BINOP_IN.

gdb:

2014-07-15  Yao Qi  <yao@codesourcery.com>

	* std-operator.def: Remove BINOP_IN.
	* breakpoint.c (watchpoint_exp_is_const): Update.
	* eval.c (evaluate_subexp_standard): Likewise.
	* expprint.c (dump_subexp_body_standard): Likewise.
---
 gdb/breakpoint.c     | 1 -
 gdb/eval.c           | 9 ---------
 gdb/expprint.c       | 1 -
 gdb/std-operator.def | 3 ---
 4 files changed, 14 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 908a1ea..bad375b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10602,7 +10602,6 @@ watchpoint_exp_is_const (const struct expression *exp)
 	case BINOP_MAX:
 	case BINOP_INTDIV:
 	case BINOP_CONCAT:
-	case BINOP_IN:
 	case BINOP_RANGE:
 	case TERNOP_COND:
 	case TERNOP_SLICE:
diff --git a/gdb/eval.c b/gdb/eval.c
index d374b6a..949b2f8 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2164,15 +2164,6 @@ evaluate_subexp_standard (struct type *expect_type,
 	  else
 	    return value_subscript (arg1, value_as_long (arg2));
 	}
-
-    case BINOP_IN:
-      arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
-      arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
-      if (noside == EVAL_SKIP)
-	goto nosideret;
-      type = language_bool_type (exp->language_defn, exp->gdbarch);
-      return value_from_longest (type, (LONGEST) value_in (arg1, arg2));
-
     case MULTI_SUBSCRIPT:
       (*pos) += 2;
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 97188ed..a966203 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -802,7 +802,6 @@ dump_subexp_body_standard (struct expression *exp,
     case BINOP_ASSIGN_MODIFY:
     case BINOP_VAL:
     case BINOP_CONCAT:
-    case BINOP_IN:
     case BINOP_RANGE:
     case BINOP_END:
     case STRUCTOP_MEMBER:
diff --git a/gdb/std-operator.def b/gdb/std-operator.def
index e530654..16014e0 100644
--- a/gdb/std-operator.def
+++ b/gdb/std-operator.def
@@ -87,9 +87,6 @@ OP (BINOP_VAL)
    the second operand with itself that many times.  */
 OP (BINOP_CONCAT)
 
-/* For (the deleted) Chill and Pascal.  */
-OP (BINOP_IN)			/* Returns 1 iff ARG1 IN ARG2.  */
-
 /* This is the "colon operator" used various places in (the
    deleted) Chill.  */
 OP (BINOP_RANGE)
-- 
1.9.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/4] Update comments to TERNOP_SLICE
  2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
@ 2014-07-16  5:19 ` Yao Qi
  2014-07-16  5:19 ` [PATCH 2/4] Remove operator BINOP_RANGE Yao Qi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-16  5:19 UTC (permalink / raw)
  To: gdb-patches

TERNOP_SLICE was added for language Chill, but it is used for Ada and D later.
Since language Chill was removed from GDB, TERNOP_SLICE is only used for
Ada and D.  This patch is to update its comments.

gdb:

2014-07-15  Yao Qi  <yao@codesourcery.com>

	* std-operator.def: Update comments to TERNOP_SLICE.
---
 gdb/std-operator.def | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/std-operator.def b/gdb/std-operator.def
index c33a287..24c3a2b 100644
--- a/gdb/std-operator.def
+++ b/gdb/std-operator.def
@@ -93,8 +93,8 @@ OP (BINOP_END)
 /* Operates on three values computed by following subexpressions.  */
 OP (TERNOP_COND)		/* ?: */
 
-/* A sub-string/sub-array.  (the deleted) Chill syntax:
-   OP1(OP2:OP3).  Return elements OP2 through OP3 of OP1.  */
+/* A sub-string/sub-array.  Ada syntax: OP1(OP2..OP3).  Return
+   elements OP2 through OP3 of OP1.  */
 OP (TERNOP_SLICE)
 
 /* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
-- 
1.9.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 0/4] Remove operators for language chill
@ 2014-07-16  5:19 Yao Qi
  2014-07-16  5:19 ` [PATCH 3/4] Update comments to TERNOP_SLICE Yao Qi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-16  5:19 UTC (permalink / raw)
  To: gdb-patches

When doing something else, I find some operators added for language
chill are still there.  However, chill was removed several years ago.
I don't see any reason we still keep them, so this patch series is
to remove them.
 
Rebuild GDB for native mingw32 and regression tested on x86-64_linux.

*** BLURB HERE ***

Yao Qi (4):
  Remove operator BINOP_IN
  Remove operator BINOP_RANGE
  Update comments to TERNOP_SLICE
  Remove Chill from comments

 gdb/breakpoint.c     |  2 --
 gdb/eval.c           | 68 +++++++---------------------------------------------
 gdb/expprint.c       |  2 --
 gdb/gdbtypes.h       |  7 +++---
 gdb/std-operator.def | 11 ++-------
 gdb/symtab.h         |  2 +-
 6 files changed, 15 insertions(+), 77 deletions(-)

-- 
1.9.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/4] Remove Chill from comments
  2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
                   ` (2 preceding siblings ...)
  2014-07-16  5:19 ` [PATCH 1/4] Remove operator BINOP_IN Yao Qi
@ 2014-07-16  8:53 ` Yao Qi
  2014-07-19  9:17 ` [PATCH 0/4] Remove operators for language chill Tom Tromey
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-16  8:53 UTC (permalink / raw)
  To: gdb-patches

This patch is to remove "Chill" from comments, however "Chill" is still
mentioned in valops.c.  I am not sure we just remove "Chill" from comments
or need to update or simplify code in valops.c:do_search_struct_field.
I didn't touch it in this patch.

gdb:

2014-07-15  Yao Qi  <yao@codesourcery.com>

	* eval.c: Remove "Chill" from comments.
	* gdbtypes.h: Likewise.
	* symtab.h: Likewise.
---
 gdb/eval.c     | 11 +++++------
 gdb/gdbtypes.h |  7 +++----
 gdb/symtab.h   |  2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/gdb/eval.c b/gdb/eval.c
index f075096..5e64e54 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -346,12 +346,11 @@ evaluate_struct_tuple (struct value *struct_val,
   return struct_val;
 }
 
-/* Recursive helper function for setting elements of array tuples for
-   (the deleted) Chill.  The target is ARRAY (which has bounds
-   LOW_BOUND to HIGH_BOUND); the element value is ELEMENT; EXP, POS
-   and NOSIDE are as usual.  Evaluates index expresions and sets the
-   specified element(s) of ARRAY to ELEMENT.  Returns last index
-   value.  */
+/* Recursive helper function for setting elements of array tuples.
+   The target is ARRAY (which has bounds LOW_BOUND to HIGH_BOUND); the
+   element value is ELEMENT; EXP, POS and NOSIDE are as usual.
+   Evaluates index expresions and sets the specified element(s) of
+   ARRAY to ELEMENT.  Returns last index value.  */
 
 static LONGEST
 init_array_element (struct value *array, struct value *element,
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index bb6352d..5008ef4 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -132,10 +132,9 @@ enum type_code
     TYPE_CODE_RANGE,		/**< Range (integers within spec'd bounds).  */
 
     /* * A string type which is like an array of character but prints
-       differently (at least for (the deleted) CHILL).  It does not
-       contain a length field as Pascal strings (for many Pascals,
-       anyway) do; if we want to deal with such strings, we should use
-       a new type code.  */
+       differently.  It does not contain a length field as Pascal
+       strings (for many Pascals, anyway) do; if we want to deal with
+       such strings, we should use a new type code.  */
     TYPE_CODE_STRING,
 
     /* * Unknown type.  The length field is valid if we were able to
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 399ae54..4a47d48 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -271,7 +271,7 @@ extern const char *symbol_demangled_name
 extern int demangle;
 
 /* Macro that returns the name to be used when sorting and searching symbols.
-   In  C++, Chill, and Java, we search for the demangled form of a name,
+   In  C++ and Java, we search for the demangled form of a name,
    and so sort symbols accordingly.  In Ada, however, we search by mangled
    name.  If there is no distinct demangled name, then SYMBOL_SEARCH_NAME
    returns the same value (same pointer) as SYMBOL_LINKAGE_NAME.  */
-- 
1.9.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Remove operators for language chill
  2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
                   ` (3 preceding siblings ...)
  2014-07-16  8:53 ` [PATCH 4/4] Remove Chill from comments Yao Qi
@ 2014-07-19  9:17 ` Tom Tromey
  2014-07-20 23:47   ` Yao Qi
  4 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2014-07-19  9:17 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> When doing something else, I find some operators added for language
Yao> chill are still there.  However, chill was removed several years ago.
Yao> I don't see any reason we still keep them, so this patch series is
Yao> to remove them.

Thanks.
This series is ok.

Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Remove operators for language chill
  2014-07-19  9:17 ` [PATCH 0/4] Remove operators for language chill Tom Tromey
@ 2014-07-20 23:47   ` Yao Qi
  0 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-07-20 23:47 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 07/19/2014 04:43 AM, Tom Tromey wrote:
>>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
> 
> Yao> When doing something else, I find some operators added for language
> Yao> chill are still there.  However, chill was removed several years ago.
> Yao> I don't see any reason we still keep them, so this patch series is
> Yao> to remove them.
> 
> Thanks.
> This series is ok.
> 

Thanks for the review, Tom.  Patch is pushed in.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-20 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16  5:19 [PATCH 0/4] Remove operators for language chill Yao Qi
2014-07-16  5:19 ` [PATCH 3/4] Update comments to TERNOP_SLICE Yao Qi
2014-07-16  5:19 ` [PATCH 2/4] Remove operator BINOP_RANGE Yao Qi
2014-07-16  5:19 ` [PATCH 1/4] Remove operator BINOP_IN Yao Qi
2014-07-16  8:53 ` [PATCH 4/4] Remove Chill from comments Yao Qi
2014-07-19  9:17 ` [PATCH 0/4] Remove operators for language chill Tom Tromey
2014-07-20 23:47   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox