From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5157 invoked by alias); 3 Nov 2014 04:04:27 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 5133 invoked by uid 48); 3 Nov 2014 04:04:25 -0000 From: "flameroc at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/17534] New: GDB failed to set bp on source line that includes an inlined function call Date: Mon, 03 Nov 2014 04:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: flameroc at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00170.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17534 Bug ID: 17534 Summary: GDB failed to set bp on source line that includes an inlined function call Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: flameroc at gmail dot com When try to set breakpoint on a source line that includes an inlined function call, gdb complains: No line 19 in file "g.c". Make breakpoint pending on future shared library load? (y or [n]) n But from the view of user, indeed there is a souce code at line 19. Is there any way to allow setting bp on line 19 to improve debug experience? Here are complete case and steps to reproduce this issue on x86: GNU gdb (GDB) 7.8.50.20141029-cvs Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from g.o...done. (gdb) !cat -n g.c 1 volatile int x; 2 3 static inline void NVIC_EnableIRQ(int IRQn) 4 { 5 volatile int y; 6 y = IRQn; 7 } 8 9 __attribute__( ( always_inline ) ) static inline void __WFI(void) 10 { 11 __asm volatile ("nop"); 12 } 13 14 int main(void) { 15 16 x= 42; 17 18 if (x) 19 NVIC_EnableIRQ(16); 20 else 21 NVIC_EnableIRQ(18); 22 23 while (1) 24 { 25 __WFI(); 26 } 27 28 return 0 ; 29 } 30 (gdb) b g.c:19 No line 19 in file "g.c". Make breakpoint pending on future shared library load? (y or [n]) n (gdb) The g.o is generated from command "../x86/install/bin/gcc -O2 -g3 -c g.c". The gcc is from pretty recent gcc trunk. I checked the assembly code and found the call on line 19 is turnd into below assembly code: .LBB9: .loc 1 6 0 movl $16, -8(%rsp) If I add more dwarf line information here like below: .LBB9: .loc 1 6 0 .loc 1 19 0 movl $16, -8(%rsp) I am able to set the bp on line 19. I guess I can improve gcc to generate more dwarf line information to solve this issue. But not sure whether it is a correct direction. Could somebody please give some advice? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.