2003-02-04 David Carlton <carlton@math.stanford.edu>
authorDavid Carlton <carlton@bactrian.org>
Tue, 4 Feb 2003 21:19:27 +0000 (21:19 +0000)
committerDavid Carlton <carlton@bactrian.org>
Tue, 4 Feb 2003 21:19:27 +0000 (21:19 +0000)
* gdb.texinfo (C@t{++}): Recommend DWARF 2, then stabs+.
(Variables): Recommend stabs+ and DWARF 2.
(C plus plus expressions): Correct info about
compiler versions, debug formats.
(Contributors): Change 'DWARF2' to 'DWARF 2'.
PR symtab/874.

2003-02-04  David Carlton  <carlton@math.stanford.edu>

* gdb.c++/overload.exp: Test intToChar(1).
* gdb.c++/overload.cc (intToChar): New.
(main): Call intToChar.

gdb/ChangeLog
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.c++/overload.cc
gdb/testsuite/gdb.c++/overload.exp

index 2c37e80a4d0c4ca83dc30c172f72f30215599a3e..f504b95126fac73d4c8f518bec57b2f481b0e0e2 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-04  David Carlton  <carlton@math.stanford.edu>
+
+       * gdbtypes.h: Delete INTEGER_COERCION_BADNESS,
+       FLOAT_COERCION_BADNESS.
+       * gdbtypes.c (rank_one_type): Replace all uses of
+       INTEGER_COERCION_BADNESS by INTEGER_CONVERSION_BADNESS.
+
 2003-02-04  Jim Blandy  <jimb@redhat.com>
 
        * dwarf2read.c (dwarf2_locate_sections): When we find a macro info
index 679822fea7997236b833ad0b1e86620d2cb743d6..f93b36b083db3827bcd94ddacef668177e89d9ec 100644 (file)
@@ -2591,7 +2591,7 @@ rank_one_type (struct type *parm, struct type *arg)
                  if (TYPE_NOSIGN (arg))        /* plain char -> plain char */
                    return 0;
                  else
-                   return INTEGER_COERCION_BADNESS;    /* signed/unsigned char -> plain char */
+                   return INTEGER_CONVERSION_BADNESS;  /* signed/unsigned char -> plain char */
                }
              else if (TYPE_UNSIGNED (parm))
                {
@@ -2604,13 +2604,13 @@ rank_one_type (struct type *parm, struct type *arg)
                               && integer_types_same_name_p (TYPE_NAME (parm), "long"))
                        return INTEGER_PROMOTION_BADNESS;       /* unsigned int -> unsigned long */
                      else
-                       return INTEGER_COERCION_BADNESS;        /* unsigned long -> unsigned int */
+                       return INTEGER_CONVERSION_BADNESS;      /* unsigned long -> unsigned int */
                    }
                  else
                    {
                      if (integer_types_same_name_p (TYPE_NAME (arg), "long")
                          && integer_types_same_name_p (TYPE_NAME (parm), "int"))
-                       return INTEGER_COERCION_BADNESS;        /* signed long -> unsigned int */
+                       return INTEGER_CONVERSION_BADNESS;      /* signed long -> unsigned int */
                      else
                        return INTEGER_CONVERSION_BADNESS;      /* signed int/long -> unsigned int/long */
                    }
@@ -2623,15 +2623,15 @@ rank_one_type (struct type *parm, struct type *arg)
                           && integer_types_same_name_p (TYPE_NAME (parm), "long"))
                    return INTEGER_PROMOTION_BADNESS;
                  else
-                   return INTEGER_COERCION_BADNESS;
+                   return INTEGER_CONVERSION_BADNESS;
                }
              else
-               return INTEGER_COERCION_BADNESS;
+               return INTEGER_CONVERSION_BADNESS;
            }
          else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
            return INTEGER_PROMOTION_BADNESS;
          else
-           return INTEGER_COERCION_BADNESS;
+           return INTEGER_CONVERSION_BADNESS;
        case TYPE_CODE_ENUM:
        case TYPE_CODE_CHAR:
        case TYPE_CODE_RANGE:
@@ -2653,7 +2653,7 @@ rank_one_type (struct type *parm, struct type *arg)
        case TYPE_CODE_RANGE:
        case TYPE_CODE_BOOL:
        case TYPE_CODE_ENUM:
-         return INTEGER_COERCION_BADNESS;
+         return INTEGER_CONVERSION_BADNESS;
        case TYPE_CODE_FLT:
          return INT_FLOAT_CONVERSION_BADNESS;
        default:
@@ -2666,12 +2666,12 @@ rank_one_type (struct type *parm, struct type *arg)
        case TYPE_CODE_RANGE:
        case TYPE_CODE_BOOL:
        case TYPE_CODE_ENUM:
-         return INTEGER_COERCION_BADNESS;
+         return INTEGER_CONVERSION_BADNESS;
        case TYPE_CODE_FLT:
          return INT_FLOAT_CONVERSION_BADNESS;
        case TYPE_CODE_INT:
          if (TYPE_LENGTH (arg) > TYPE_LENGTH (parm))
-           return INTEGER_COERCION_BADNESS;
+           return INTEGER_CONVERSION_BADNESS;
          else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
            return INTEGER_PROMOTION_BADNESS;
          /* >>> !! else fall through !! <<< */
@@ -2683,7 +2683,7 @@ rank_one_type (struct type *parm, struct type *arg)
              if (TYPE_NOSIGN (arg))
                return 0;
              else
-               return INTEGER_COERCION_BADNESS;
+               return INTEGER_CONVERSION_BADNESS;
            }
          else if (TYPE_UNSIGNED (parm))
            {
@@ -2695,7 +2695,7 @@ rank_one_type (struct type *parm, struct type *arg)
          else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
            return 0;
          else
-           return INTEGER_COERCION_BADNESS;
+           return INTEGER_CONVERSION_BADNESS;
        default:
          return INCOMPATIBLE_TYPE_BADNESS;
        }
@@ -2708,7 +2708,7 @@ rank_one_type (struct type *parm, struct type *arg)
        case TYPE_CODE_RANGE:
        case TYPE_CODE_BOOL:
        case TYPE_CODE_ENUM:
-         return INTEGER_COERCION_BADNESS;
+         return INTEGER_CONVERSION_BADNESS;
        case TYPE_CODE_FLT:
          return INT_FLOAT_CONVERSION_BADNESS;
        default:
index 30cdb5fcd8094accf026d7ecf633e56287ba7c82..e3ba6fa48d986e1f7dc79f05ffb393d882277efe 100644 (file)
@@ -1211,10 +1211,6 @@ extern int count_virtual_fns (struct type *);
 #define TOO_FEW_PARAMS_BADNESS       100
 /* Badness if no conversion among types */
 #define INCOMPATIBLE_TYPE_BADNESS    100
-/* Badness of coercing large integer to smaller size */
-#define INTEGER_COERCION_BADNESS     100
-/* Badness of coercing large floating type to smaller size */
-#define FLOAT_COERCION_BADNESS       100
 
 /* Badness of integral promotion */
 #define INTEGER_PROMOTION_BADNESS      1
index dde2a43f39365b6613ed81a878ae1f566fc9f5fe..44b37261eb0476c2a04aeb1b562b8bbe66ce3fa0 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-04  David Carlton  <carlton@math.stanford.edu>
+
+       * gdb.c++/overload.exp: Test intToChar(1).
+       * gdb.c++/overload.cc (intToChar): New.
+       (main): Call intToChar.
+
 2003-02-03  David Carlton  <carlton@math.stanford.edu>
 
        * gdb.c++/ovldbreak.exp (continue_to_bp_overloaded): Add
index 97083c5640cdf08de1c0879e8d77ba1995517621..2f467154bdb085630b324e9d3e40ed412cdaa1f5 100644 (file)
@@ -45,6 +45,11 @@ int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
 
 };
 
+int intToChar (char c)
+{
+  return 297;
+}
+
 void marker1()
 {}
 
@@ -72,6 +77,8 @@ int main ()
        breakpoint();
     #endif
 
+    // Verify that intToChar should work:
+    intToChar(1);
 
     marker1();
     return 0; 
index 7bfae108522952b42f242390b6ec0117f3bb5006..227b0553ced7c14b8d3fb562b57055182dd1fec2 100644 (file)
@@ -378,3 +378,5 @@ gdb_test "list foo::overloadfnarg(int, int (*)(int))" \
 gdb_test "list \"foo::overloadfnarg(int, int (*)(int))\"" \
    "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
    "list overloaded function with function ptr args - quotes around argument"
+
+gdb_test "print intToChar(1)" ".\[0-9\]* = 297"