From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17468 invoked by alias); 31 Mar 2014 12:24:32 -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 17455 invoked by uid 89); 31 Mar 2014 12:24:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-lb0-f182.google.com Received: from mail-lb0-f182.google.com (HELO mail-lb0-f182.google.com) (209.85.217.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 31 Mar 2014 12:24:30 +0000 Received: by mail-lb0-f182.google.com with SMTP id n15so5664065lbi.41 for ; Mon, 31 Mar 2014 05:24:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=vpk6f9+pJD9d2Pp9xato9brzhkCFubI5qoC08F1yV1U=; b=Qjd5jYfDAosRo4SKIbcNuZqw3ovKWPxz0+3FNevk3XjsOk5+wzfem16NfWMaz6b00z v3AViN3eYrQ8kLTadNOkY73xESGMkJIR7KMFpgfBe7HJLmejzOZ5UHS90zP/TBl0k/ne w7cLhL3PFlWjZRIBujTAFNPEhUxwB8n0/7aJ3vqenD9c1pwrBaGUvS1e32fQlLlzJ+eP HH9nUPELLrQxqDZxPPcEl6sV2czvnyh7F0Rww+pQ0jlCzEsLxbbGVaASBw43VyixOnDg vkLpf2nOz1rUiC+v2sbabDfa7IVD+edoz1JdzBmzVlzQdLwL4ScGUald236R6EgeZD1o tqfg== X-Gm-Message-State: ALoCoQmwwZ3RN0Ff+cHvXICRXspJaTvhjhdert4W20OP1SBFSBY/b0+SoJeNx6bwXBG31qYygtwF MIME-Version: 1.0 X-Received: by 10.152.29.40 with SMTP id g8mr233764lah.65.1396268666762; Mon, 31 Mar 2014 05:24:26 -0700 (PDT) Received: by 10.112.9.40 with HTTP; Mon, 31 Mar 2014 05:24:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Mar 2014 12:24:00 -0000 Message-ID: Subject: Re: break on C++ global objects ctors From: Daniel Gutson To: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00690.txt.bz2 PING for a maintainer please? Thanks! Daniel. On Wed, Mar 26, 2014 at 3:22 PM, Daniel Gutson wrote: > Hi, > > AFAIK, there is no command to break and debug the construction of > global objects in C++. > > 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. > > 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 br= , gdb > shows all the source locations of the global object instances. > > 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 too, > or some libc internals knowledge by gdb. > > Daniel. --=20 Daniel F. Gutson Chief Engineering Officer, SPD San Lorenzo 47, 3rd Floor, Office 5 C=F3rdoba, Argentina Phone: +54 351 4217888 / +54 351 4218211 Skype: dgutson