From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24035 invoked by alias); 26 Mar 2014 18:22:39 -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 24023 invoked by uid 89); 26 Mar 2014 18:22:37 -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-f41.google.com Received: from mail-la0-f41.google.com (HELO mail-la0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 26 Mar 2014 18:22:36 +0000 Received: by mail-la0-f41.google.com with SMTP id gl10so1811048lab.14 for ; Wed, 26 Mar 2014 11:22:32 -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:date:message-id:subject:from:to :content-type; bh=IoCWTmnIwqtpuJ9Iem9ggXbbjY1NLY3uW4SoIO7yT+0=; b=VCn/MaCBSb0s7Gv7Ss2pKNlqJ37D/Ij+f14yElih5FgHxfJA84kfxPmmO0nXY4TWhI tULt/tHzJMPbdex8EIyYF91eRhFz5+vXggtUvmlFw8TroU2HY86yvR/0SYzrzzq/GZRJ gGS0Xevn3VN+DX6sitN8w4jxGCw9ctoOxPNFK9Js3G3bHLz8TD3+mgjB5RRy+zkgRUvo 9BHLsqUDBnR8wHcwf+tJXTh49E1lCLAj0vDbPZhSWDsUQTuv7wE30omorX82CJp8eWad DjLt8xz1dKM+ubQJX9SobBL47hmLif4Mtpe1NHFR81/jCYxUOSurvLNyiaYZDMYsvdll cI5Q== X-Gm-Message-State: ALoCoQlltdP9aAdosjcsohZChYpKRTHo/Mhbx7pZPyEpvogh6h+zO/yL8M1538UOORHB1zWfviWD MIME-Version: 1.0 X-Received: by 10.112.31.163 with SMTP id b3mr766910lbi.61.1395858152176; Wed, 26 Mar 2014 11:22:32 -0700 (PDT) Received: by 10.112.9.40 with HTTP; Wed, 26 Mar 2014 11:22:32 -0700 (PDT) Date: Wed, 26 Mar 2014 18:22:00 -0000 Message-ID: Subject: break on C++ global objects ctors From: Daniel Gutson To: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00620.txt.bz2 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.