From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7123 invoked by alias); 29 Jun 2010 12:58:12 -0000 Received: (qmail 7030 invoked by uid 48); 29 Jun 2010 12:57:54 -0000 Date: Tue, 29 Jun 2010 12:58:00 -0000 Subject: [Bug debug/44712] New: Debug info for partially inlined functions X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg02798.txt.bz2 /* { dg-options "-g -O2" } */ extern void abort (void); extern void exit (int); extern int printf (const char *, ...); static int foo (int x) { typedef int T; T z = 2 * x; if (x <= 0) { printf ("foo\n"); printf ("foo\n"); printf ("foo\n"); exit (0); } return 6; } __attribute__((noinline)) int bar (int x) { return foo (x) + foo (6) + foo (x); } int main (void) { int l; asm volatile ("" : "=r" (l) : "0" (5)); if (bar (l) != 18) abort (); bar (l - 10); abort (); } Debugging experience on this testcase isn't ideal, work will be needed both on the gcc side and gdb side. Roland has some ideas what should be done, certainly DW_AT_artificial should be set on the foo.part* function, and perhaps it should have some DW_TAG_lexical_block from the abstract DW_TAG_subprogram as DW_AT_abstract_origin instead of the whole DW_TAG_subroutine (or perhaps some artificial DW_TAG_lexical_block created just for that purpose?). I'll let Roland write the details here himself. -- Summary: Debug info for partially inlined functions Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: wrong-debug Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44712