From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1526 invoked by alias); 10 May 2013 20:43:21 -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 1502 invoked by uid 48); 10 May 2013 20:43:20 -0000 From: "bogden at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/15458] New: gdb cannot step into function that begins with first entry in line table, if that entry does not have is_stmt flag Date: Fri, 10 May 2013 20:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bogden at arm 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-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-q2/txt/msg00230.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15458 Bug #: 15458 Summary: gdb cannot step into function that begins with first entry in line table, if that entry does not have is_stmt flag Product: gdb Version: 7.2 Status: NEW Severity: normal Priority: P2 Component: gdb AssignedTo: unassigned@sourceware.org ReportedBy: bogden@arm.com Classification: Unclassified gdb cannot step into function that begins with first entry in line table, if that entry does not have is_stmt flag set to true - even if subsequent lines of the function do have is_stmt true. I believe that this such a line table is legal DWARF. clang/LLVM can produce such a line table, at least when compiling for ARM targets. The attached program exhibits this problem. It was built with a recent trunk build of LLVM, like this: clang -target arm step-through.c -integrated-as -g -O0 -c -mcpu=arm7tdmi -mfloat-abi=soft So far as I understand it, what is happening is something like: 1) To decide whether to step into a function, gdb looks for a line table entry associated with an address <= the first address of the function, and the line table entry associated with the lowest address > the first address of the function. If it finds such entries, it steps in. 2) The array of line table entries used for this purpose does not include entries for which is_stmt is not true 3) The first entry in the line table of the attached program refers to a function 'get_name'. is_stmt is false for this entry, so it is not in gdb's array. 4) gdb therefore cannot find an entry in the line table that refers to an address <= get_name. 5) gdb therefore refuses to step into get_name, even though the function contains a line for which is_stmt is true. There is another subroutine in the program (func) with a line table entry for which is_stmt is false. In this case gdb believes it can step in because it finds an entry referring to an address < address of func. Some relevant code can be seen at infrun.c:4572 and symtab.c:2031 in CodeSourcery GCC release arm-2012.03-56-arm-none-eabi. Running --version on this gdb build gives: GNU gdb (Sourcery CodeBench Lite 2012.03-56) 7.2.50.20100908-cvs I realise this build is somewhere between 1 - 3 years behind trunk. I've tried but failed to find/build a newer gdb with a sim target for ARM. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.