aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-12-20 03:26:08 +0000
committerJim Blandy <jimb@codesourcery.com>2001-12-20 03:26:08 +0000
commit4e40929968103f27fba096429d4df7e1be8b80e6 (patch)
tree089bb00c6ba305f22a3745efd81aecdee053f56b /gdb/gdbarch.c
parent3695c2997d939be2c281d498c1b232805b4cb09b (diff)
downloadgdb-4e40929968103f27fba096429d4df7e1be8b80e6.zip
gdb-4e40929968103f27fba096429d4df7e1be8b80e6.tar.gz
gdb-4e40929968103f27fba096429d4df7e1be8b80e6.tar.bz2
* gdbarch.sh (TARGET_CHAR_SIGNED): New macro.
* gdbarch.c, gdbarch.h: Regenerated. * gdbtypes.c (build_gdbtypes): If TARGET_CHAR_SIGNED is zero, set the TYPE_FLAG_UNSIGNED bit on the type. * s390-tdep.c (s390_gdbarch_init): On the S/390, characters are unsigned by default. * rs6000-tdep.c (rs6000_gdbarch_init): Same for PowerPC and RS6000.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6a1b61b..2de3360 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -144,6 +144,7 @@ struct gdbarch
int ptr_bit;
int addr_bit;
int bfd_vma_bit;
+ int char_signed;
int ieee_float;
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
@@ -285,6 +286,7 @@ struct gdbarch startup_gdbarch =
8 * sizeof (void*),
8 * sizeof (void*),
8 * sizeof (void*),
+ 1,
0,
0,
0,
@@ -446,6 +448,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
current_gdbarch->ptr_bit = TARGET_INT_BIT;
current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+ current_gdbarch->char_signed = -1;
current_gdbarch->read_pc = generic_target_read_pc;
current_gdbarch->write_pc = generic_target_write_pc;
current_gdbarch->read_fp = generic_target_read_fp;
@@ -561,6 +564,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
if (gdbarch->addr_bit == 0)
gdbarch->addr_bit = TARGET_PTR_BIT;
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
+ if (gdbarch->char_signed == -1)
+ gdbarch->char_signed = 1;
/* Skip verify of ieee_float, invalid_p == 0 */
/* Skip verify of read_pc, invalid_p == 0 */
/* Skip verify of write_pc, invalid_p == 0 */
@@ -1867,6 +1872,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
(long) TARGET_BYTE_ORDER);
#endif
+#ifdef TARGET_CHAR_SIGNED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
+ XSTRING (TARGET_CHAR_SIGNED));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
+ (long) TARGET_CHAR_SIGNED);
+#endif
#ifdef TARGET_DOUBLE_BIT
fprintf_unfiltered (file,
"gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
@@ -2266,6 +2279,24 @@ set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
}
int
+gdbarch_char_signed (struct gdbarch *gdbarch)
+{
+ if (gdbarch->char_signed == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_char_signed invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
+ return gdbarch->char_signed;
+}
+
+void
+set_gdbarch_char_signed (struct gdbarch *gdbarch,
+ int char_signed)
+{
+ gdbarch->char_signed = char_signed;
+}
+
+int
gdbarch_ieee_float (struct gdbarch *gdbarch)
{
/* Skip verify of ieee_float, invalid_p == 0 */