aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Larsen <blarsen@redhat.com>2022-06-07 16:07:07 -0300
committerBruno Larsen <blarsen@redhat.com>2022-06-30 14:13:08 -0300
commit0b1505c82dc5bb593608bb72c1db0496088f2d25 (patch)
tree38b7447b33c7d09ecfc3fd3f42fb33bc72ca766d /gdb/testsuite/gdb.cp/mb-ctor.exp
parentFix implementation of readelf's -wE and -wN options, (diff)
downloadbinutils-gdb-0b1505c82dc5bb593608bb72c1db0496088f2d25.tar.gz
binutils-gdb-0b1505c82dc5bb593608bb72c1db0496088f2d25.tar.bz2
binutils-gdb-0b1505c82dc5bb593608bb72c1db0496088f2d25.zip
gdb/testsuite: Expand gdb.cp/mb-ctor.exp to test dynamic allocation
When testing GDB's ability to stop in constructors, gdb.cp/mb-ctor.exp only tested objects allocated on the stack. This commit adds a couple of dynamic allocations and tests if GDB can stop in it as well.
Diffstat (limited to 'gdb/testsuite/gdb.cp/mb-ctor.exp')
-rw-r--r--gdb/testsuite/gdb.cp/mb-ctor.exp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index f5f5d9143d1..5a3c0a4a90f 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -56,6 +56,24 @@ gdb_test "continue" \
gdb_continue_to_breakpoint "set breakpoint here, second time" ".* breakpoint here"
gdb_test "continue" \
+ ".*Breakpoint.*Derived.*i=24.*" \
+ "run to breakpoint 1 dynamic v1"
+
+gdb_continue_to_breakpoint "set breakpoint here, first dynamic time"\
+ ".* breakpoint here"
+
+gdb_test "continue" \
+ ".*Breakpoint.*Derived.*i=42.*" \
+ "run to breakpoint 1 dynamic v2"
+
+gdb_continue_to_breakpoint "set breakpoint here, second dynamic time"\
+ ".* breakpoint here"
+
+gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v1"
+
+gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v2"
+
+gdb_test "continue" \
".*Breakpoint.*~Derived.*" \
"run to breakpoint 3 v1"