summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorDavid Taylor <taylor@redhat.com>2000-08-25 20:51:19 +0000
committerDavid Taylor <taylor@redhat.com>2000-08-25 20:51:19 +0000
commit52204a0b3a4dda13a5c13c31cafff75bbad077de (patch)
treeae0ddc7c369a201712f0fcd1ee133dd3fb22ceb2 /gdb/gdbarch.h
parentc13b1b775b2ff3918d53d0babed8247d8d34593c (diff)
downloadbinutils-gdb-52204a0b3a4dda13a5c13c31cafff75bbad077de.tar.gz
Fri Aug 25 12:11:21 2000 David Taylor <taylor@texas.cygnus.com>
* symtab.c (search_symbols): Fix off by one error in index for initializing variables ourtype, ourtype2, ourtype3, and ourtype4. (symtab_symbol_info): fix similar off by one error. Fri Aug 25 12:03:15 2000 David Taylor <taylor@texas.cygnus.com> * gdbarch.sh (TARGET_ADDR_BIT): New macro for the number of bits in gdb's representation of a target address. * gdbarch.c, gdbarch.h: Regenerated. * gdbtypes.c (build_gdbtypes): Use TARGET_ADDR_BIT instead of TARGET_PTR_BIT when initializing builtin_type_CORE_ADDR. * printcmd.c (print_address_numeric): Use TARGET_ADDR_BIT instead of TARGET_PTR_BIT, because we're printing an address, not a pointer.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 0b8b64143a5..2fa2f6e51f6 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -22,13 +22,13 @@
/* This file was created with the aid of ``gdbarch.sh''.
- The bourn shell script ``gdbarch.sh'' creates the files
+ The Bourne shell script ``gdbarch.sh'' creates the files
``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
against the existing ``gdbarch.[hc]''. Any differences found
being reported.
If editing this file, please also run gdbarch.sh and merge any
- changes into that script. Conversely, when makeing sweeping changes
+ changes into that script. Conversely, when making sweeping changes
to this file, modifying gdbarch.sh and using its output may prove
easier. */
@@ -189,7 +189,15 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl
#endif
#endif
-/* Number of bits in a pointer for the target machine */
+/* For most targets, a pointer on the target and its representation as an
+ address in GDB have the same size and "look the same". For such a
+ target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+ / addr_bit will be set from it.
+
+ If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+ also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+
+ ptr_bit is the size of a pointer on the target */
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
@@ -204,6 +212,21 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
#endif
#endif
+/* addr_bit is the size of a target address as represented in gdb */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
+#endif
+
+extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
+#endif
+#endif
+
/* Number of bits in a BFD_VMA for the target object file format. */
/* Default (value) for non- multi-arch platforms. */