summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-12-14 01:06:04 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-12-14 01:06:04 +0000
commited20a4786f2177ddb10716ce386b41eae69696e4 (patch)
treeb284bdfce8bb4cf2d417bcf57da78f37f66bc1c8 /gdb/gdbarch.c
parent64502d627774c5d5b399a9725f1020b435e80b54 (diff)
downloadgdb-ed20a4786f2177ddb10716ce386b41eae69696e4.tar.gz
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 f7fbea45eac..49d7bf4ca70 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)