From a5a698cf43dbf7737c620897e0cfdb8c9ff7a4df Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 30 Apr 2004 14:40:56 +0000 Subject: [PATCH] 2004-04-30 Andrew Cagney * gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete. * gdbarch.h, gdbarch.c: Re-generate. * stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE code. --- gdb/ChangeLog | 7 ++++++ gdb/doc/ChangeLog | 5 ++++ gdb/doc/gdbint.texinfo | 8 +------ gdb/gdbarch.c | 26 --------------------- gdb/gdbarch.h | 9 -------- gdb/gdbarch.sh | 1 - gdb/stabsread.c | 62 ++++++++------------------------------------------ 7 files changed, 22 insertions(+), 96 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cd7d3d4ea2..b0277617a2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2004-04-30 Andrew Cagney + * gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE + code. + +2004-04-30 Andrew Cagney + * gdb-events.sh (selected_thread_changed) (selected_frame_level_changed, target_changed): Delete. * gdb-events.h, gdb-events.c: Re-generate. diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 66b97814d8..31b63d5043 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2004-04-30 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + documentation for BELIEVE_PCC_PROMOTION_TYPE, no longer defined. + 2004-04-30 Orjan Friberg * observer.texi (GDB Observers): Correct spelling. diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 4ecb3dd9be..9400c4c6ae 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -38,7 +38,7 @@ Free Documentation License''. @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.196 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.197 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Solutions\par \hfill \manvers\par @@ -2926,12 +2926,6 @@ Define if the compiler promotes a @code{short} or @code{char} parameter to an @code{int}, but still reports the parameter as its original type, rather than the promoted type. -@item BELIEVE_PCC_PROMOTION_TYPE -@findex BELIEVE_PCC_PROMOTION_TYPE -Define this if @value{GDBN} should believe the type of a @code{short} -argument when compiled by @code{pcc}, but look within a full int space to get -its value. Only defined for Sun-3 at present. - @item BITS_BIG_ENDIAN @findex BITS_BIG_ENDIAN Define this if the numbering of bits in the targets does @strong{not} match the diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index ff1d687dec..0f68e84a8e 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -182,7 +182,6 @@ struct gdbarch gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc; int believe_pcc_promotion; - int believe_pcc_promotion_type; gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register; gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible; gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual; @@ -347,7 +346,6 @@ struct gdbarch startup_gdbarch = deprecated_pc_in_call_dummy, /* deprecated_pc_in_call_dummy */ 0, /* deprecated_init_frame_pc */ 0, /* believe_pcc_promotion */ - 0, /* believe_pcc_promotion_type */ 0, /* deprecated_get_saved_register */ 0, /* deprecated_register_convertible */ 0, /* deprecated_register_convert_to_virtual */ @@ -862,14 +860,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n", BELIEVE_PCC_PROMOTION); #endif -#ifdef BELIEVE_PCC_PROMOTION_TYPE - fprintf_unfiltered (file, - "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n", - XSTRING (BELIEVE_PCC_PROMOTION_TYPE)); - fprintf_unfiltered (file, - "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n", - BELIEVE_PCC_PROMOTION_TYPE); -#endif #ifdef BREAKPOINT_FROM_PC fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -3790,22 +3780,6 @@ set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, } int -gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n"); - return gdbarch->believe_pcc_promotion_type; -} - -void -set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, - int believe_pcc_promotion_type) -{ - gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; -} - -int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index d881eb2081..b7dfa8f800 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1137,15 +1137,6 @@ extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int beli #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) #endif -extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); -extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" -#endif -#if !defined (BELIEVE_PCC_PROMOTION_TYPE) -#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) -#endif - #if defined (DEPRECATED_GET_SAVED_REGISTER) /* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */ #if !defined (DEPRECATED_GET_SAVED_REGISTER_P) diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index e46c64f789..acb4b9bd2d 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -564,7 +564,6 @@ F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, COR F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev # v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: -v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval # # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 07c6fe0b8a..e91a980905 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -978,61 +978,17 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "unsigned int", NULL); - if (BELIEVE_PCC_PROMOTION_TYPE) + /* If PCC says a parameter is a short or a char, it is + really an int. */ + if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) + && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT) { - /* This is defined on machines (e.g. sparc) where we - should believe the type of a PCC 'short' argument, - but shouldn't believe the address (the address is the - address of the corresponding int). - - My guess is that this correction, as opposed to - changing the parameter to an 'int' (as done below, - for PCC on most machines), is the right thing to do - on all machines, but I don't want to risk breaking - something that already works. On most PCC machines, - the sparc problem doesn't come up because the calling - function has to zero the top bytes (not knowing - whether the called function wants an int or a short), - so there is little practical difference between an - int and a short (except perhaps what happens when the - GDB user types "print short_arg = 0x10000;"). - - Hacked for SunOS 4.1 by gnu@cygnus.com. In 4.1, the - compiler actually produces the correct address (we - don't need to fix it up). I made this code adapt so - that it will offset the symbol if it was pointing at - an int-aligned location and not otherwise. This way - you can use the same gdb for 4.0.x and 4.1 systems. - - If the parameter is shorter than an int, and is - integral (e.g. char, short, or unsigned equivalent), - and is claimed to be passed on an integer boundary, - don't believe it! Offset the parameter's address to - the tail-end of that integer. */ - - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT - && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type)) - { - SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type) - - TYPE_LENGTH (SYMBOL_TYPE (sym)); - } - break; - } - else - { - /* If PCC says a parameter is a short or a char, - it is really an int. */ - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT) - { - SYMBOL_TYPE (sym) = - TYPE_UNSIGNED (SYMBOL_TYPE (sym)) - ? pcc_unsigned_promotion_type - : pcc_promotion_type; - } - break; + SYMBOL_TYPE (sym) = + TYPE_UNSIGNED (SYMBOL_TYPE (sym)) + ? pcc_unsigned_promotion_type + : pcc_promotion_type; } + break; } case 'P': -- 2.11.0