This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Support routines for reading and decoding debugging information in
the "stabs" format. This format is used with many systems that use
#include "doublest.h"
#include "cp-abi.h"
#include "cp-support.h"
+#include "gdb_assert.h"
#include <ctype.h>
static const char vptr_name[] = "_vptr$";
static const char vb_name[] = "_vb$";
-/* Define this as 1 if a pcc declaration of a char or short argument
- gives the correct address. Otherwise assume pcc gives the
- address of the corresponding int, which is not the same on a
- big-endian machine. */
-
-#if !defined (BELIEVE_PCC_PROMOTION)
-#define BELIEVE_PCC_PROMOTION 0
-#endif
-
static void
invalid_cpp_abbrev_complaint (const char *arg1)
{
if (real_filenum >= N_HEADER_FILES (current_objfile))
{
- struct type *temp_type;
- struct type **temp_type_p;
+ static struct type **temp_type_p;
warning (_("GDB internal error: bad real_filenum"));
error_return:
- temp_type = init_type (TYPE_CODE_ERROR, 0, 0, NULL, NULL);
- temp_type_p = (struct type **) xmalloc (sizeof (struct type *));
- *temp_type_p = temp_type;
+ temp_type_p = &builtin_type_error;
return temp_type_p;
}
{
name = stabs->stab[ii];
pp = (char *) strchr (name, ':');
+ gdb_assert (pp); /* Must find a ':' or game's over. */
while (pp[1] == ':')
{
pp += 2;
}
/* If it's gcc-compiled, if it says `short', believe it. */
- if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION)
+ if (processing_gcc_compilation
+ || gdbarch_believe_pcc_promotion (current_gdbarch))
break;
- if (!BELIEVE_PCC_PROMOTION)
+ if (!gdbarch_believe_pcc_promotion (current_gdbarch))
{
/* This is the signed type which arguments get promoted to. */
static struct type *pcc_promotion_type;
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (within_function)
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
int nbits = 0;
int c;
long upper_limit;
- int twos_complement_representation = radix == 8 && twos_complement_bits > 0;
+ int twos_complement_representation;
if (*p == '-')
{
p++;
}
+ twos_complement_representation = radix == 8 && twos_complement_bits > 0;
upper_limit = LONG_MAX / radix;
while ((c = *p++) >= '0' && c < ('0' + radix))