aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-12-14 01:06:04 +0000
committerJason Molenda <jmolenda@apple.com>1999-12-14 01:06:04 +0000
commitc4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee (patch)
tree273969a6c8a28b0f0128edd803506abf025371b1 /gdb/gdbarch.c
parenta3a8c91d411abe91720a2ac92b8140e1bdb41282 (diff)
downloadgdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.zip
gdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.tar.gz
gdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.tar.bz2
import gdb-1999-12-13 snapshot
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index f7fbea4..49d7bf4 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -125,6 +125,7 @@ struct gdbarch
*/
+ int bfd_vma_bit;
int ptr_bit;
int short_bit;
int int_bit;
@@ -224,6 +225,7 @@ struct gdbarch default_gdbarch = {
0, NULL, NULL,
/* Multi-arch values */
8 * sizeof (void*),
+ 8 * sizeof (void*),
8 * sizeof (short),
8 * sizeof (int),
8 * sizeof (long),
@@ -325,6 +327,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->byte_order = info->byte_order;
/* Force the explicit initialization of these. */
+ gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
gdbarch->num_regs = -1;
gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1;
@@ -366,6 +369,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
internal_error ("verify_gdbarch: bfd_arch_info unset");
/* Check those that need to be defined for the given multi-arch level. */
if ((GDB_MULTI_ARCH >= 1)
+ && (0))
+ internal_error ("gdbarch: verify_gdbarch: bfd_vma_bit invalid");
+ if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->ptr_bit == 0))
internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
@@ -612,6 +618,9 @@ gdbarch_dump (void)
"gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
(long) TARGET_BYTE_ORDER);
fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
+ (long) TARGET_BFD_VMA_BIT);
+ fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_PTR_BIT = %ld\n",
(long) TARGET_PTR_BIT);
fprintf_unfiltered (gdb_stdlog,
@@ -940,6 +949,24 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
}
int
+gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
+{
+ if (0)
+ internal_error ("gdbarch: gdbarch_bfd_vma_bit invalid");
+ if (gdbarch_debug >= 2)
+ /* FIXME: gdb_std??? */
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
+ return gdbarch->bfd_vma_bit;
+}
+
+void
+set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
+ int bfd_vma_bit)
+{
+ gdbarch->bfd_vma_bit = bfd_vma_bit;
+}
+
+int
gdbarch_ptr_bit (struct gdbarch *gdbarch)
{
if (gdbarch->ptr_bit == 0)