From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18111 invoked by alias); 31 Mar 2014 13:56:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18095 invoked by uid 89); 31 Mar 2014 13:56:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ausc60ps301.us.dell.com Received: from ausc60ps301.us.dell.com (HELO ausc60ps301.us.dell.com) (143.166.148.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 31 Mar 2014 13:56:43 +0000 X-LoopCount0: from 10.170.28.41 From: To: CC: Subject: Re: break on C++ global objects ctors Date: Mon, 31 Mar 2014 13:56:00 -0000 Message-ID: References: In-Reply-To: Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00692.txt.bz2 This certainly should be easily doable, just in gdb. FWIW, if you start a = program with gdbserver and then connect to it from gdb (=93target remote=94= to gdbserver), the program is stopped at the first instruction, way before= =93main=94. At that point you should be able to set a breakpoint in a con= structor and tell it =93continue=94. If such a thing were desirable for gdb, the same logic could be used, I wou= ld assume. paul On Mar 31, 2014, at 8:24 AM, Daniel Gutson wrote: > PING for a maintainer please? >=20 > Thanks! >=20 > Daniel. >=20 > On Wed, Mar 26, 2014 at 3:22 PM, Daniel Gutson > wrote: >> Hi, >>=20 >> AFAIK, there is no command to break and debug the construction of >> global objects in C++. >>=20 >> I'm looking for an equivalent command to "start" but instead of temp >> breaking at the >> beginning of main(), breaks at the beginning of every global ctor. >>=20 >> The way I'm currently doing this in GNU Linux/x86_64 is: >> br __static_initialization_and_destruction_0 >> which is a workaround, with the nice side effect that when asking info b= r, gdb >> shows all the source locations of the global object instances. >>=20 >> I'm not sure whether this could supported by a native gdb feature or by = a python >> extension. >> If there is consensus about the former, I might create some patch. >> However, I suspect that this might require some support from collect2 to= o, >> or some libc internals knowledge by gdb. >>=20 >> Daniel. >=20 >=20 >=20 > --=20 >=20 > Daniel F. Gutson > Chief Engineering Officer, SPD >=20 >=20 > San Lorenzo 47, 3rd Floor, Office 5 >=20 > C=F3rdoba, Argentina >=20 >=20 > Phone: +54 351 4217888 / +54 351 4218211 >=20 > Skype: dgutson