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/21473] New: wrong type info for extern inline function when debugging Emacs


https://sourceware.org/bugzilla/show_bug.cgi?id=21473

            Bug ID: 21473
           Summary: wrong type info for extern inline function when
                    debugging Emacs
           Product: gdb
           Version: 7.12.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: eggert at gnu dot org
  Target Milestone: ---

Created attachment 10042
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10042&action=edit
gzipped tarball of three source files illustrating the bug

On x86-64, GDB Fedora 7.12.1-48.fc25 has problems decoding debugging
information generated by GCC 6.3.1 20161221 (Red Hat 6.3.1-1). The problem does
not occur when I use GCC 4.8.5 20150623 (Red Hat 4.8.5-11) to compile. Although
I originally reported this as a GCC bug
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80646>, Richard Biener starts to
believe that it is a GDB bug. 

I ran into the problem while attempting to debug GNU Emacs, and constructed a
small test case to illustrate it. To reproduce it on Fedora 25 x86-64, extract
the files lisp.h, t.c and u.c from the attached tarball, and compile them by
running the shell command:

gcc -g3 -O2 t.c u.c

Then use GDB as follows:

$ gdb a.out
...
(gdb) ptype make_number
type = int ()
(gdb) ptype make_natnum
type = struct {
    long i;
} (long)
(gdb) ptype XIL
type = struct {
    long i;
} (long)
(gdb)

The reported type of 'make_number' is incorrect: it should be the same type as
that of make_natnum and XIL, but instead is a function returning 'int'. This
incorrect type can cause GDB to print incorrect results in expressions
involving make_number.

-- 
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]