From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8EC883840C07; Sat, 9 May 2020 18:17:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EC883840C07 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/25955] FAIL: gdb.mi/mi-catch-cpp-exceptions.exp: all with invalid regexp: run until breakpoint in main (unknown output after running) Date: Sat, 09 May 2020 18:17:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2020 18:17:14 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25955 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D434349969583= 0fbd4bfe75058fc5570e280ba831 commit 4343499695830fbd4bfe75058fc5570e280ba831 Author: Tom de Vries Date: Sat May 9 20:17:10 2020 +0200 [gdb] Fix catch throw regexp matching When running test-case gdb.mi/mi-catch-cpp-exceptions.exp, we have: ... FAIL: gdb.mi/mi-catch-cpp-exceptions.exp: all with invalid regexp: run until \ breakpoint in main (unknown output after running) ... This is a regression since commit 596dc4adff "Speed up psymbol reading = by removing a copy". Before that commit, we have: ... $ gdb \ -batch \ ./outputs/gdb.mi/mi-catch-cpp-exceptions/mi-catch-cpp-exceptions \ -ex "break 67" \ -ex "catch throw -r blahblah" \ -ex r Breakpoint 1 at 0x4008e5: file mi-catch-cpp-exceptions.cc, line 67. Catchpoint 2 (throw) Breakpoint 1, main () at mi-catch-cpp-exceptions.cc:67 67 return 1; /* Stop here. */ ... In other words: - we set a breakpoint somewhere in main, - we set a catchpoint with a regexp that is intended to not match any exception, and - run to the breakpoint, without the catchpoint triggering. After the commit, we have: ... $ gdb \ -batch \ ./outputs/gdb.mi/mi-catch-cpp-exceptions/mi-catch-cpp-exceptions \ -ex "break 67" \ -ex "catch throw -r blahblah" \ -ex r Breakpoint 1 at 0x4008e5: file mi-catch-cpp-exceptions.cc, line 67. Catchpoint 2 (throw) Catchpoint 2 (exception thrown), 0x00007ffff7ab037e in __cxa_throw () f= rom \ /usr/lib64/libstdc++.so.6 ... In other words, the catchpoint triggers. This is caused by this bit of the commit: ... type_name =3D cplus_typename_from_type_info (typeinfo_arg); canon =3D cp_canonicalize_string (type_name.c_str ()); - if (!canon.empty ()) - std::swap (type_name, canon); + name =3D (canon =3D=3D nullptr + ? canon.get () + : type_name.c_str ()); } catch (const gdb_exception_error &e) { exception_print (gdb_stderr, e); } - if (!type_name.empty ()) + if (name !=3D nullptr) { - if (self->pattern->exec (type_name.c_str (), 0, NULL, 0) !=3D 0) + if (self->pattern->exec (name, 0, NULL, 0) !=3D 0) ... Before the commit, we have: - type_name =3D=3D "my_exception" - canon =3D "" and the !type_name.empty () test succeeds, and gdb executes the self->pattern->exec call. After the commit, we have: - type_name =3D=3D "my_exception" - canon =3D=3D NULL - name =3D=3D NULL and the name !=3D nullptr test fails, and gdb doesn't execute the self->pattern->exec call. Fix this by inverting the condition for the calculation of name: ... - name =3D (canon =3D=3D nullptr + name =3D (canon !=3D nullptr ... Build and tested on x86_64-linux. gdb/ChangeLog: 2020-05-09 Tom de Vries PR gdb/25955 * break-catch-throw.c (check_status_exception_catchpoint): Fix = name calculation. --=20 You are receiving this mail because: You are on the CC list for the bug.=