aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuinevere Larsen <blarsen@redhat.com>2024-07-23 13:56:17 -0300
committerGuinevere Larsen <blarsen@redhat.com>2024-09-17 17:18:36 -0300
commitbd26cd1810ce4296b228cd31d137a0b54e40c189 (patch)
tree06ec60d542bcbc9c1d7b56c20387328092ffa387
parent1794b3a18db2e5241f4daa88c99a5bcec9b1c311 (diff)
downloadbinutils-bd26cd1810ce4296b228cd31d137a0b54e40c189.zip
binutils-bd26cd1810ce4296b228cd31d137a0b54e40c189.tar.gz
binutils-bd26cd1810ce4296b228cd31d137a0b54e40c189.tar.bz2
gdb/testsuite: fix gdb.mi/mi-catch-cpp-exceptions.exp with clang
Clang adds line table information for a try/catch block differently to gcc. Instead of linking the instructions related to __cxa_begin_catch to the line containing the "catch" statement in the source code, it links to the closing brace of the try block. This was causing gdb.mi/mi-catch-cpp-exceptions.exp to fail when tested with clang. The test was updated to have the catch in the same line as the closing brace so it passes with no additional modifications with clang. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.cc b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.cc
index be1f50f..d41b55d 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.cc
+++ b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.cc
@@ -43,8 +43,7 @@ foo ()
try
{
bar ();
- }
- catch (const my_exception &ex) /* Catch 1. */
+ } catch (const my_exception &ex) /* Catch 1. */
{
if (i == 1)
throw; /* Throw 2. */
@@ -60,8 +59,7 @@ main ()
try
{
foo ();
- }
- catch (const my_exception &ex) /* Catch 2. */
+ } catch (const my_exception &ex) /* Catch 2. */
{
if (i == 1)
return 1; /* Stop here. */