Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [rfa] C++ testsuite fix for unsigned char
@ 2004-02-28 23:15 Michael Elizabeth Chastain
  2004-02-29 17:10 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-28 23:15 UTC (permalink / raw)
  To: drow, gdb-patches

Approved, provided that you've tested it at least once.

> By the way, this test would be invalid C since it relies on the behavior of
> signed overflow.  I'm not sure about C++ but I suspect it's the same.

You are right.  It would be okay with me to change all the 'c' from
'char' to 'unsigned char'.  It's about templates, not about whether
chars are 'signed' or 'unsigned'.

Michael C

===

2004-02-28  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.cp/ctti.exp: Handle unsigned char type.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] C++ testsuite fix for unsigned char
  2004-02-28 23:15 [rfa] C++ testsuite fix for unsigned char Michael Elizabeth Chastain
@ 2004-02-29 17:10 ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-29 17:10 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

On Sat, Feb 28, 2004 at 06:15:19PM -0500, Michael Chastain wrote:
> Approved, provided that you've tested it at least once.
> 
> > By the way, this test would be invalid C since it relies on the behavior of
> > signed overflow.  I'm not sure about C++ but I suspect it's the same.
> 
> You are right.  It would be okay with me to change all the 'c' from
> 'char' to 'unsigned char'.  It's about templates, not about whether
> chars are 'signed' or 'unsigned'.
> 
> Michael C
> 
> ===
> 
> 2004-02-28  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* gdb.cp/ctti.exp: Handle unsigned char type.

How about this patch instead, then?  Tested on i386-linux and
arm-linux.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-29  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.cp/ctti.exp: Handle unsigned char type.  Expect templates
	to use unsigned char.
	* gdb.cp/cttiadd.c, gdb.cp/cttiadd1.c, gdb.cp/cttiadd2.c,
	gdb.cp/cttiadd3.c: Change type of variable to unsigned char.

Index: gdb/testsuite/gdb.cp/ctti.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/ctti.exp,v
retrieving revision 1.5
diff -u -p -r1.5 ctti.exp
--- gdb/testsuite/gdb.cp/ctti.exp	11 Feb 2004 14:01:25 -0000	1.5
+++ gdb/testsuite/gdb.cp/ctti.exp	29 Feb 2004 17:05:08 -0000
@@ -76,7 +76,7 @@ if ![runto_main] then {
 gdb_breakpoint [gdb_get_line_number "marker add1"]
 gdb_continue_to_breakpoint "marker add1"
 
-gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
+gdb_test "print c" "\\$\[0-9\]+ = 194 .*"
 gdb_test "print f" "\\$\[0-9\]+ = 9"
 gdb_test "print i" "\\$\[0-9\]+ = 4"
 
@@ -106,13 +106,13 @@ gdb_test_multiple "print add<float>(2.25
     }
 }
 
-gdb_test_multiple "print add<char>('A','A')" "print add<char>('A','A')" {
+gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
     -re "\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
-	pass "print add<char>('A','A')"
+	pass "print add<unsigned char>('A','A')"
     }
-    -re "No symbol \"add<char>\" in current context.\r\n$gdb_prompt $" {
+    -re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
 	# TODO: kfail or xfail this
-	fail "print add<char>('A','A')"
+	fail "print add<unsigned char>('A','A')"
     }
 }
 
@@ -136,13 +136,13 @@ gdb_test_multiple "print add2<float>(2.2
     }
 }
 
-gdb_test_multiple "print add2<char>('A','A')" "print add2<char>('A','A')" {
+gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
     -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
-	pass "print add2<char>('A','A')"
+	pass "print add2<unsigned char>('A','A')"
     }
-    -re "No symbol \"add2<char>\" in current context.\r\n$gdb_prompt $" {
+    -re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
 	# TODO: kfail or xfail this
-	fail "print add2<char>('A','A')"
+	fail "print add2<unsigned char>('A','A')"
     }
 }
 
@@ -166,13 +166,13 @@ gdb_test_multiple "print add3<float>(2.2
     }
 }
 
-gdb_test_multiple "print add3<char>('A','A')" "print add3<char>('A','A')" {
+gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
     -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
-	pass "print add3<char>('A','A')"
+	pass "print add3<unsigned char>('A','A')"
     }
-    -re "No symbol \"add3<char>\" in current context.\r\n$gdb_prompt $" {
+    -re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
 	# TODO: kfail or xfail this
-	fail "print add3<char>('A','A')"
+	fail "print add3<unsigned char>('A','A')"
     }
 }
 
@@ -196,12 +196,12 @@ gdb_test_multiple "print add4<float>(2.2
     }
 }
 
-gdb_test_multiple "print add4<char>('A','A')" "print add4<char>('A','A')" {
+gdb_test_multiple "print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
     -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
-	pass "print add4<char>('A','A')"
+	pass "print add4<unsigned char>('A','A')"
     }
-    -re "No symbol \"add4<char>\" in current context.\r\n$gdb_prompt $" {
+    -re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
 	# TODO: kfail or xfail this
-	fail "print add4<char>('A','A')"
+	fail "print add4<unsigned char>('A','A')"
     }
 }
Index: gdb/testsuite/gdb.cp/cttiadd.cc
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/cttiadd.cc,v
retrieving revision 1.4
diff -u -p -r1.4 cttiadd.cc
--- gdb/testsuite/gdb.cp/cttiadd.cc	11 Feb 2004 14:01:25 -0000	1.4
+++ gdb/testsuite/gdb.cp/cttiadd.cc	29 Feb 2004 17:03:53 -0000
@@ -27,7 +27,7 @@ template<class T> T add(T v1, T v2)
 
 int main()
 {
-  char c;
+  unsigned char c;
   int i;
   float f;
   extern void add1();
Index: gdb/testsuite/gdb.cp/cttiadd1.cc
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/cttiadd1.cc,v
retrieving revision 1.3
diff -u -p -r1.3 cttiadd1.cc
--- gdb/testsuite/gdb.cp/cttiadd1.cc	11 Feb 2004 14:01:25 -0000	1.3
+++ gdb/testsuite/gdb.cp/cttiadd1.cc	29 Feb 2004 17:04:34 -0000
@@ -21,7 +21,7 @@ template<class T> T add(T v1, T v2);
 
 void add1()
 {
-  char c;
+  unsigned char c;
   int i;
   float f;
   
Index: gdb/testsuite/gdb.cp/cttiadd2.cc
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/cttiadd2.cc,v
retrieving revision 1.3
diff -u -p -r1.3 cttiadd2.cc
--- gdb/testsuite/gdb.cp/cttiadd2.cc	11 Feb 2004 14:01:25 -0000	1.3
+++ gdb/testsuite/gdb.cp/cttiadd2.cc	29 Feb 2004 17:04:47 -0000
@@ -27,7 +27,7 @@ template<class T> T add2(T v1, T v2)
 
 void subr2()
 {
-  char c;
+  unsigned char c;
   int i;
   float f;
   
Index: gdb/testsuite/gdb.cp/cttiadd3.cc
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/cttiadd3.cc,v
retrieving revision 1.3
diff -u -p -r1.3 cttiadd3.cc
--- gdb/testsuite/gdb.cp/cttiadd3.cc	11 Feb 2004 14:01:25 -0000	1.3
+++ gdb/testsuite/gdb.cp/cttiadd3.cc	29 Feb 2004 17:04:55 -0000
@@ -35,7 +35,7 @@ template<class T> T add4(T v1, T v2)
 
 void subr3()
 {
-  char c;
+  unsigned char c;
   int i;
   float f;
   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] C++ testsuite fix for unsigned char
  2004-02-29 22:15 Michael Elizabeth Chastain
@ 2004-02-29 22:35 ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-29 22:35 UTC (permalink / raw)
  To: gdb-patches

On Sun, Feb 29, 2004 at 05:15:07PM -0500, Michael Chastain wrote:
> It's beautiful!  I approve this patch.

OK, I've checked it in.

> 
> Michael C
> 
> ===
> 
> 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* gdb.cp/ctti.exp: Handle unsigned char type.  Expect templates
> 	to use unsigned char.
> 	* gdb.cp/cttiadd.c, gdb.cp/cttiadd1.c, gdb.cp/cttiadd2.c,
> 	gdb.cp/cttiadd3.c: Change type of variable to unsigned char.
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] C++ testsuite fix for unsigned char
@ 2004-02-29 22:15 Michael Elizabeth Chastain
  2004-02-29 22:35 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-29 22:15 UTC (permalink / raw)
  To: drow, mec.gnu; +Cc: gdb-patches

It's beautiful!  I approve this patch.

Michael C

===

2004-02-29  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.cp/ctti.exp: Handle unsigned char type.  Expect templates
	to use unsigned char.
	* gdb.cp/cttiadd.c, gdb.cp/cttiadd1.c, gdb.cp/cttiadd2.c,
	gdb.cp/cttiadd3.c: Change type of variable to unsigned char.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [rfa] C++ testsuite fix for unsigned char
@ 2004-02-28 17:51 Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-28 17:51 UTC (permalink / raw)
  To: gdb-patches

ARM targets, by default, have char as an unsigned type.  Therefore this test
prints out 194 instead of -62.  OK to commit?

By the way, this test would be invalid C since it relies on the behavior of
signed overflow.  I'm not sure about C++ but I suspect it's the same.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-28  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.cp/ctti.exp: Handle unsigned char type.

Index: gdb/testsuite/gdb.cp/ctti.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.cp/ctti.exp,v
retrieving revision 1.5
diff -u -p -r1.5 ctti.exp
--- gdb/testsuite/gdb.cp/ctti.exp	11 Feb 2004 14:01:25 -0000	1.5
+++ gdb/testsuite/gdb.cp/ctti.exp	28 Feb 2004 15:11:30 -0000
@@ -76,7 +76,7 @@ if ![runto_main] then {
 gdb_breakpoint [gdb_get_line_number "marker add1"]
 gdb_continue_to_breakpoint "marker add1"
 
-gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
+gdb_test "print c" "\\$\[0-9\]+ = (-62|194) .*"
 gdb_test "print f" "\\$\[0-9\]+ = 9"
 gdb_test "print i" "\\$\[0-9\]+ = 4"
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-29 22:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-28 23:15 [rfa] C++ testsuite fix for unsigned char Michael Elizabeth Chastain
2004-02-29 17:10 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2004-02-29 22:15 Michael Elizabeth Chastain
2004-02-29 22:35 ` Daniel Jacobowitz
2004-02-28 17:51 Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox