This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] v850 uses a signed char type


I've committed the patch below.

It fixes the following failures for v850-elf:

FAIL: gdb.base/charset.exp: check value of parsed character literal in EBCDIC-US
FAIL: gdb.base/charset.exp: check value of parsed string literal in EBCDIC-US
FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in EBCDIC-US
FAIL: gdb.base/charset.exp: check value of parsed character literal in IBM1047
FAIL: gdb.base/charset.exp: check value of parsed string literal in IBM1047
FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in IBM1047

I wish I could find an authoritative ABI document that I could point
to to justify this change.  Unfortuntately I can't find such a
document.

I will note, however, that gcc/config/v850/v850.h says:

  /* Define this as 1 if `char' should by default be signed; else as 0.

     On the NEC V850, loads do sign extension, so make this default.  */
  #define DEFAULT_SIGNED_CHAR 1

Kevin

	* v850-tdep.c (v850_gdbarch_init): Change the v850's `char'
	type to be signed.

Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.113
diff -u -p -r1.113 v850-tdep.c
--- v850-tdep.c	1 Jan 2010 07:31:43 -0000	1.113
+++ v850-tdep.c	9 Sep 2010 22:52:30 -0000
@@ -1006,7 +1006,7 @@ v850_gdbarch_init (struct gdbarch_info i
 
   set_gdbarch_register_type (gdbarch, v850_register_type);
 
-  set_gdbarch_char_signed (gdbarch, 0);
+  set_gdbarch_char_signed (gdbarch, 1);
   set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
   set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]