This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]