aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-09-17 23:33:41 +0100
committerPedro Alves <pedro@palves.net>2020-09-18 00:05:39 +0100
commit151fdbad7a4df43fb7e5b1ef2f84622aaaa2ddb5 (patch)
tree4c39710152f35200c9792b8c8c76e83e67092d3d /gdb
parent18a25b648176c70a651dc869394eef2d26d50723 (diff)
downloadgdb-151fdbad7a4df43fb7e5b1ef2f84622aaaa2ddb5.zip
gdb-151fdbad7a4df43fb7e5b1ef2f84622aaaa2ddb5.tar.gz
gdb-151fdbad7a4df43fb7e5b1ef2f84622aaaa2ddb5.tar.bz2
gdb.base/watchpoint.{c,exp}
Adjust gdb.base/watchpoint.c so that it can be built as a C++ program. Fixes: gdb compile failed, src/gdb/testsuite/gdb.base/watchpoint.c:33:16: error: initializer-string for array of chars is too long [-fpermissive] 33 | char buf[30] = "testtesttesttesttesttesttestte"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gdb/testsuite/gdb.base/watchpoint.c:62:14: error: expected unqualified-id before 'nullptr' 62 | struct foo5 *nullptr; | ^~~~~~~ gdb/testsuite/ChangeLog: * gdb.base/watchpoint.c (buf): Make it 31 bytes. (nullptr): Rename to ... (null_ptr): ... this. * gdb.base/watchpoint.exp: Adjust to rename.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.c4
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp4
3 files changed, 11 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7b424b5..6ff6092 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2020-09-17 Pedro Alves <pedro@palves.net>
+ * gdb.base/watchpoint.c (buf): Make it 31 bytes.
+ (nullptr): Rename to ...
+ (null_ptr): ... this.
+ * gdb.base/watchpoint.exp: Adjust to rename.
+
+2020-09-17 Pedro Alves <pedro@palves.net>
+
* gdb.base/printcmds.c (three, flag_enum_without_zero)
(three_not_flag): Add casts.
diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c
index 60f60d6..3d6e36f 100644
--- a/gdb/testsuite/gdb.base/watchpoint.c
+++ b/gdb/testsuite/gdb.base/watchpoint.c
@@ -30,7 +30,7 @@ int ival2 = -1;
int ival3 = -1;
int ival4 = -1;
int ival5 = -1;
-char buf[30] = "testtesttesttesttesttesttestte";
+char buf[31] = "testtesttesttesttesttesttestte";
struct foo
{
int val;
@@ -59,7 +59,7 @@ struct foo5
struct { int x; } *p;
};
-struct foo5 *nullptr;
+struct foo5 *null_ptr;
void marker1 ()
{
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 1ed73e8..fc84f98 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -604,9 +604,9 @@ proc test_watch_location {} {
gdb_continue_to_breakpoint "func5 breakpoint here"
# Check first if a null pointer can be dereferenced on the target.
- gdb_test_multiple "p *nullptr" "" {
+ gdb_test_multiple "p *null_ptr" "" {
-re "Cannot access memory at address 0x0.*$gdb_prompt $" {
- gdb_test "watch -location nullptr->p->x" \
+ gdb_test "watch -location null_ptr->p->x" \
"Cannot access memory at address 0x0"
}
-re ".*$gdb_prompt $" {