From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED5433856941; Mon, 5 Sep 2022 16:36:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED5433856941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662395782; bh=eEWyYR4sP6q5acXDHVjCGDDZo3sjlampo18pr1uHFMg=; h=From:To:Subject:Date:From; b=lHsBNgN5vbyqM+yecPXLXdsYQosI+7caKcoqWp0y0igDq8tV48tpo0gKnft52Pho2 Tc/R0zq0yMQaVIHC75dbggHepDJrdjAjzXbVEpjc92vTEbifyXKljiJg25G+eyUr6g RT0U1RIx1O1v7ryfcJ2Y8Q4/8SWLLfhjUfGsOX2c= From: "denis.zinin at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/29548] New: Can't breakpoint __cxa_throw with Qt5Core.dll Date: Mon, 05 Sep 2022 16:36:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: denis.zinin at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29548 Bug ID: 29548 Summary: Can't breakpoint __cxa_throw with Qt5Core.dll Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: denis.zinin at gmail dot com Target Milestone: --- Windows 10. Debugged binary compiled with C++ 12.2.0 under MSYS2/Mingw64. I can't set breakpoint on throwing exception (__cxa_throw) in Clion bundled= gdb 12.1. The same problem with Mingw64 GDB 12.1 and Mingw64 GDB 11.1. But all work with Mingw64 GDB 10.1. On starting gdb: --------------- GNU gdb (GDB; JetBrains IDE bundle; build 152) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". Function "swift_willThrow" not defined. Function "_CxxThrowException" not defined. Function "swift_errorRetain" not defined. unset env HOME --------------- I see suspicious "not defined". But the real problem in the following. In non working bundled gdb 12.1: -------------------------------- (gdb) info symbol __cxa_throw __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\_src\robo_003\cmake-build-debug\robo_001.exe (gdb) info functions __cxa_throw All functions matching regular expression "__cxa_throw": Non-debugging symbols: 0x00007ff76b112108 __cxa_throw 0x00007ffe67a75f68 __cxa_throw_bad_array_new_length 0x00007ffe67a75f70 __cxa_throw (gdb) info symbol 0x00007ff76b112108 __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\_src\robo_003\cmake-build-debug\robo_001.exe (gdb) info symbol 0x00007ffe67a75f70 __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\robo\Qt5Core.dll (gdb) break __cxa_throw Function "__cxa_throw" not defined. Make breakpoint pending on future shared library load? (y or [n]) [answered= N; input not from terminal] Breakpoint is not set. ------------------------------- In working external Mingw64 gdb 10.1. Same exe and libraries: ------------------------------- (gdb) info symbol __cxa_throw __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\_src\robo_003\cmake-build-debug\robo_001.exe (gdb) info functions __cxa_throw All functions matching regular expression "__cxa_throw": Non-debugging symbols: 0x00007ffe670e5f68 __cxa_throw_bad_array_new_length 0x00007ffe670e5f70 __cxa_throw (gdb) info symbol 0x00007ffe670e5f70 __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\robo\Qt5Core.dll (gdb) break __cxa_throw Note: breakpoint 2 also set at pc 0x7ffe670e5f70. Note: breakpoint 2 also set at pc 0x7ff76b112108. Breakpoint 7 at 0x7ff76b112108 (2 locations) (gdb) info symbol 0x7ff76b112108 __cxa_throw in section .text of C:\Users\Veter\Desktop\Dev\_src\robo_003\cmake-build-debug\robo_001.exe Breakpoint is set successfully. -------------------------------- Simple project to reproduce the problem. CMakeLists.txt: ----------------------------------- cmake_minimum_required(VERSION 3.23) project(untitled1) set(CMAKE_CXX_STANDARD 20) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Widgets_INCLUDES}) add_definitions(${Qt5Widgets_DEFINITIONS}) set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") add_executable(untitled1 main.cpp) target_link_libraries (untitled1 ${Qt5Widgets_LIBRARIES}) --------------------------------------- main.cpp: ------------------ #include #include #include #include #include class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow() {}; ~MainWindow() override {}; }; #include "main.moc" int main(int argc, char *argv[]) { std::cout << "Hello, World!" << std::endl; QApplication app(argc, argv); QCoreApplication::setApplicationName("robot"); QCoreApplication::setOrganizationName("Figvam"); MainWindow mainWin{}; mainWin.show(); throw std::exception(); return QApplication::exec(); } ------------------------- Without Qt5 all work well. It seems the problem that "(gdb)info functions __cxa_throw" return twice __cxa_throw. One from main binary, another from Qt5Core.dll. ----------------------------------- (gdb) info functions __cxa_throw All functions matching regular expression "__cxa_throw": Non-debugging symbols: 0x00007ff76b112108 __cxa_throw 0x00007ffe67a75f68 __cxa_throw_bad_array_new_length 0x00007ffe67a75f70 __cxa_throw ------------------------------------ But in old gdb it return only one __cxa_throw. "catch throw" is not resolve the problem. It's output: "Catchpoint 7 (throw= )" But on real throw program exited (not pause) with: [Thread 42504.0x7adc exi= ted with code 3] [Inferior 1 (process 42504) exited with code 03]". --=20 You are receiving this mail because: You are on the CC list for the bug.=