]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: rework bp-cond-failure to not depend on inlining
authorGuinevere Larsen <guinevere@redhat.com>
Fri, 2 Aug 2024 11:46:28 +0000 (08:46 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Fri, 20 Sep 2024 19:08:23 +0000 (16:08 -0300)
commitb0170acd5a9e834e2b37ff151fa817e9a7a1412a
tree32f2046417fa67c01d8d4fde37265e009364aaee
parentc588e374965509b81a623ce9ef79a026f27d2592
gdb/testsuite: rework bp-cond-failure to not depend on inlining

The test gdb.base/bp-cond-failure is implicitly expecting that the
function foo will be inlined twice and gdb will be able to find 2
locations to place a breakpoint. When clang is used, gdb only finds
one location which causes the test to fail. Since the test is not
worried about handling breakpoints on inlined functions, but rather on
the format of the message on a breakpoint condition fail, this seems
like a false fail report.

This commit reworks the test to be in c++, and uses function overloading
to ensure that 2 locations will always be found. Empirical testing
showed that, for clang, we will land on location 2 with the currest exp
commands, no matter the order of the functions declared, whereas for gcc
it depends on the order that functions were declared, so they are
ordered to always land on the second location, this way we are able to
hardcode it and check for it.

Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.base/bp-cond-failure.c
gdb/testsuite/gdb.base/bp-cond-failure.exp