diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-04-30 14:40:56 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-04-30 14:40:56 +0000 |
commit | 8ee56bcfa3a6a15ffaf041c2e02dbebad38b1c7f (patch) | |
tree | b1f250d5d29aac075ecd1721041231c82bc6d93d /gdb/stabsread.c | |
parent | d0d6a25bf3db9eea811699671a0f218e75586ca0 (diff) | |
download | gdb-8ee56bcfa3a6a15ffaf041c2e02dbebad38b1c7f.zip gdb-8ee56bcfa3a6a15ffaf041c2e02dbebad38b1c7f.tar.gz gdb-8ee56bcfa3a6a15ffaf041c2e02dbebad38b1c7f.tar.bz2 |
2004-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete.
* gdbarch.h, gdbarch.c: Re-generate.
* stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE
code.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 62 |
1 files changed, 9 insertions, 53 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 07c6fe0..e91a980 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': |