From 1c5cb38e90bd8955f5027f152b832675c2aa7922 Mon Sep 17 00:00:00 2001 From: David Carlton Date: Tue, 4 Feb 2003 21:19:27 +0000 Subject: [PATCH] 2003-02-04 David Carlton * 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 * gdb.c++/overload.exp: Test intToChar(1). * gdb.c++/overload.cc (intToChar): New. (main): Call intToChar. --- gdb/ChangeLog | 7 +++++++ gdb/gdbtypes.c | 24 ++++++++++++------------ gdb/gdbtypes.h | 4 ---- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.c++/overload.cc | 7 +++++++ gdb/testsuite/gdb.c++/overload.exp | 2 ++ 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2c37e80a4d0..f504b95126f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2003-02-04 David Carlton + + * 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 * dwarf2read.c (dwarf2_locate_sections): When we find a macro info diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 679822fea79..f93b36b083d 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -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: diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 30cdb5fcd80..e3ba6fa48d9 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -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 diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index dde2a43f393..44b37261eb0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-02-04 David Carlton + + * gdb.c++/overload.exp: Test intToChar(1). + * gdb.c++/overload.cc (intToChar): New. + (main): Call intToChar. + 2003-02-03 David Carlton * gdb.c++/ovldbreak.exp (continue_to_bp_overloaded): Add diff --git a/gdb/testsuite/gdb.c++/overload.cc b/gdb/testsuite/gdb.c++/overload.cc index 97083c5640c..2f467154bdb 100644 --- a/gdb/testsuite/gdb.c++/overload.cc +++ b/gdb/testsuite/gdb.c++/overload.cc @@ -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; diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp index 7bfae108522..227b0553ced 100644 --- a/gdb/testsuite/gdb.c++/overload.exp +++ b/gdb/testsuite/gdb.c++/overload.exp @@ -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" -- 2.30.2