From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3410 invoked by alias); 8 Nov 2009 23:09:53 -0000 Received: (qmail 3401 invoked by uid 22791); 8 Nov 2009 23:09:53 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Nov 2009 23:09:47 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7GtB-00005A-L8 for gcc@gcc.gnu.org; Mon, 09 Nov 2009 00:09:41 +0100 Received: from r74-192-0-229.bcstcmta01.clsttx.tl.dh.suddenlink.net ([74.192.0.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 00:09:41 +0100 Received: from cppljevans by r74-192-0-229.bcstcmta01.clsttx.tl.dh.suddenlink.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 00:09:41 +0100 To: gcc@gcc.gnu.org From: Larry Evans Subject: howto graphically view .cfg file produced by -fdump-tree-cfg Date: Sun, 08 Nov 2009 23:09:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.23 (X11/20090817) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00219.txt.bz2 http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options describes -fdump-tree-SWITCH where SWITCH may be one of a number of "switches" including: cfg vcg I tried the vcg switch; however, it looks like that's just the control flow for basic block. The cfg switch looks similar except it prefixes the control flow for each function with the function name. In addition, calls in the function appear as the actual function name called with possibly some generated variable names as argument and result. For example, the output from compile of cp/pt.c with -fdump-tree-cfg contains: instantiate_class_template (type) { ... } and within the ..., there's: union tree_node * D.76307; union tree_node * type.1598; ... type.1598 = type; D.76307 = most_specialized_class (type.1598, templ); which I think corresponds to the obvious line in: /* Figure out which template is being instantiated. */ templ = most_general_template (CLASSTYPE_TI_TEMPLATE (type)); gcc_assert (TREE_CODE (templ) == TEMPLATE_DECL); /* Determine what specialization of the original template to instantiate. */ t = most_specialized_class (type, templ); if (t == error_mark_node) of pt.c around line 7371 (viewable here: http://gcc.gnu.org/viewcvs/trunk/gcc/cp/pt.c?revision=153977&view=markup ) Does someone know of a way to view this in a graphical way, somewhat like what xvcg does for its cfg's? TIA. -Larry