From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12599 invoked by alias); 31 Mar 2014 14:41:21 -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 12589 invoked by uid 89); 31 Mar 2014 14:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-la0-f51.google.com Received: from mail-la0-f51.google.com (HELO mail-la0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 31 Mar 2014 14:41:19 +0000 Received: by mail-la0-f51.google.com with SMTP id pv20so5987115lab.10 for ; Mon, 31 Mar 2014 07:41:15 -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:cc:content-type :content-transfer-encoding; bh=CgxfSDEP6EIZqofJ3l4SIx7Ic2LPsT/hdNwmVRcWm94=; b=F01fAB6u0wX3OLNhthlDddvtxomsX6nKpM/w/zan+puD1fJawuXNN8+KBfh5LTS4nc pl4PDr7AAqDFK2NBXjzFsNhjqsGs+0T/urX2NeiErF0235E/heMsdwkmHR8Say1xfXJC rzg+MfEFNEdwcq7R1x6sog242TvDIKRZq1eFuTZ4guEXyEGAygfSYQFJYPaatAhXo0m6 U6JpqV5EPVgl4Ffz5js8GI0jTeUJc0cthprcjOFVOci7fPTnqah7lJO48Uy6ofZnIugG hXcpz3jO+TEiGsUP3i70vss6SrfojRyC1luu4kx6lgwBCCUchQ1jJECoaK9LM1rbFhYp /DIw== X-Gm-Message-State: ALoCoQljsVUHLMpvhutw7Fs8MOWTN/qoWVa99cLuzExHF6qMBHpDhGVYUvu/fXg3bw9gcsIwwptG MIME-Version: 1.0 X-Received: by 10.152.7.8 with SMTP id f8mr1647836laa.39.1396276875680; Mon, 31 Mar 2014 07:41:15 -0700 (PDT) Received: by 10.112.9.40 with HTTP; Mon, 31 Mar 2014 07:41:15 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Mar 2014 14:41:00 -0000 Message-ID: Subject: Re: break on C++ global objects ctors From: Daniel Gutson To: Paul_Koning@dell.com Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00695.txt.bz2 On Mon, Mar 31, 2014 at 11:15 AM, wrote: > > On Mar 31, 2014, at 10:10 AM, Daniel Gutson wrote: > >> On Mon, Mar 31, 2014 at 10:56 AM, wrote: >>> This certainly should be easily doable, just in gdb. FWIW, if you star= t a program with gdbserver and then connect to it from gdb ("target remote"= to gdbserver), the program is stopped at the first instruction, way before= "main". >> >> That doesn't solve how gdb detects the beginning of each ctor function. > > I don't know what problem you're referring to. A constructor is just a f= unction, which has a name, and you can set a breakpoint on it. > > If for some reason that's not working, that would be a bug, but I've used= breakpoints on constructors for a long time and it seems to work when I tr= y it. The issue I need to add is to make gdb break at the beginning of the construction of each (all) global object of the program. Breaking at the beginning of the program does not solve this. Please see my original with this clarification, so maybe I can be clearer. One possible solution is: add breaks in the ctors of ALL types, run, and at main delete all those breakpoints. Another solution is to do some handling of each __static_initialization_and_destruction_0 which varies depending on the context. > > paul --=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