From 71900fe836550b5de69842ebaa243b8bd762e594 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 30 Mar 2003 04:08:16 +0000 Subject: [PATCH] 2003-03-29 Andrew Cagney * gdb.base/sizeof.c (main): Print the value of '\377'. * gdb.base/sizeof.exp: Check the sign of '\377'. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/sizeof.c | 1 + gdb/testsuite/gdb.base/sizeof.exp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7cb22bd5b42..3c031f30813 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-03-29 Andrew Cagney + + * gdb.base/sizeof.c (main): Print the value of '\377'. + * gdb.base/sizeof.exp: Check the sign of '\377'. + 2003-03-27 Michael Chastain * gdb.base/gdb1090.exp: New file. diff --git a/gdb/testsuite/gdb.base/sizeof.c b/gdb/testsuite/gdb.base/sizeof.c index 95d379ee9ae..c32231f8566 100644 --- a/gdb/testsuite/gdb.base/sizeof.c +++ b/gdb/testsuite/gdb.base/sizeof.c @@ -114,6 +114,7 @@ main () printf ("sizeof (long double) == %d\n", sizeof (long double)); /* Signed char? */ + printf ("valueof ('\\377') == %d\n", '\377'); printf ("valueof ((int) (char) -1) == %d\n", (int) (char) -1); printf ("valueof ((int) (signed char) -1) == %d\n", (int) (signed char) -1); printf ("valueof ((int) (unsigned char) -1) == %d\n", (int) (unsigned char) -1); diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp index 7c0390588a0..7fcbe0e37e7 100644 --- a/gdb/testsuite/gdb.base/sizeof.exp +++ b/gdb/testsuite/gdb.base/sizeof.exp @@ -154,10 +154,12 @@ proc check_valueof { exp val } { # Check that GDB and the target agree over the sign of a character. +set signof_byte [get_valueof "/d" "'\\377'" -1] set signof_char [get_valueof "/d" "(int) (char) -1" -1] set signof_signed_char [get_valueof "/d" "(int) (signed char) -1" -1] set signof_unsigned_char [get_valueof "/d" "(int) (unsigned char) -1" -1] +check_valueof "'\\\\377'" ${signof_byte} check_valueof "(int) (char) -1" ${signof_char} check_valueof "(int) (signed char) -1" ${signof_signed_char} check_valueof "(int) (unsigned char) -1" ${signof_unsigned_char} -- 2.30.2