public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter
@ 2004-03-04  0:22 rdelashmit at soe dot sony dot com
  2004-03-04  8:11 ` [Bug debug/14423] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rdelashmit at soe dot sony dot com @ 2004-03-04  0:22 UTC (permalink / raw)
  To: gcc-bugs

In the case shown below, a non-inline function call which has inline function 
calls in its parameter list does not generate debug_line information with gcc 
3.2.3.  debug_line information is generated when using gcc 2.95.3.

Compiler info, preprocessed source, and dwarfdump output follow.  The debug 
info does get generated by gcc 2.95.3 but not by gcc 3.2.3.

-- Compile output:

Reading specs from /home/rdelashmit/bin/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-
gnu/3.2.3/specs
Configured with: ../srcdir/configure --prefix=/home/rdelashmit/bin --enable-
languages=c,c++ --disable-libgcj --with-dwarf2 : 
(reconfigured) ../srcdir/configure --prefix=/home/rdelashmit/bin/gcc-3.2.3 --
enable-languages=c,c++ --disable-libgcj --with-dwarf2
Thread model: posix
gcc version 3.2.3
 /home/rdelashmit/bin/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/cpp0 -lang-
c++ -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -v -D__GNUC__=3 -
D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D__ELF__ -
Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -
D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -dD -
D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -
D__tune_i686__ -D__tune_pentiumpro__ a.cpp a.ii
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/home/rdelashmit/bin/gcc-3.2.3/i686-pc-linux-
gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/rdelashmit/bin/gcc-3.2.3/include/c++/3.2.3
 /home/rdelashmit/bin/gcc-3.2.3/include/c++/3.2.3/i686-pc-linux-gnu
 /home/rdelashmit/bin/gcc-3.2.3/include/c++/3.2.3/backward
 /usr/local/include
 /home/rdelashmit/bin/gcc-3.2.3/include
 /home/rdelashmit/bin/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include
 /usr/include
End of search list.
 /home/rdelashmit/bin/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/cc1plus -
fpreprocessed a.ii -quiet -dumpbase a.cpp -g3 -O1 -version -o a.s
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2.3 (i686-pc-linux-gnu)
	compiled by GNU C version 3.2.3.
 as -V -Qy -o a-inline a.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 
2.13.90.0.18 20030206

-- Preprocessed file:

# 1 "a.cpp"
# 1 "<built-in>"
#define __VERSION__ "3.2.3"
#define __USER_LABEL_PREFIX__ 
#define __REGISTER_PREFIX__ 
#define __HAVE_BUILTIN_SETJMP__ 1
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ long int
#define __WINT_TYPE__ unsigned int
#define __STDC__ 1
#define __cplusplus 1
# 10 "<built-in>"
#define __GXX_WEAK__ 1
# 1 "<command line>"
#define __GNUG__ 3
# 1 "<command line>"
#define __DEPRECATED 1
# 1 "<command line>"
#define __EXCEPTIONS 1
# 1 "<command line>"
#define __GNUC__ 3
# 1 "<command line>"
#define __GNUC_MINOR__ 2
# 1 "<command line>"
#define __GNUC_PATCHLEVEL__ 3
# 1 "<command line>"
#define __GXX_ABI_VERSION 102
# 1 "<command line>"
#define __ELF__ 1
# 1 "<command line>"
#define unix 1
# 1 "<command line>"
#define __gnu_linux__ 1
# 1 "<command line>"
#define linux 1
# 1 "<command line>"
#define __ELF__ 1
# 1 "<command line>"
#define __unix__ 1
# 1 "<command line>"
#define __gnu_linux__ 1
# 1 "<command line>"
#define __linux__ 1
# 1 "<command line>"
#define __unix 1
# 1 "<command line>"
#define __linux 1
# 1 "<command line>"
#define __OPTIMIZE__ 1
# 1 "<command line>"
#define __STDC_HOSTED__ 1
# 1 "<command line>"
#define _GNU_SOURCE 1
# 1 "<command line>"
#define i386 1
# 1 "<command line>"
#define __i386 1
# 1 "<command line>"
#define __i386__ 1
# 1 "<command line>"
#define __tune_i686__ 1
# 1 "<command line>"
#define __tune_pentiumpro__ 1
# 1 "a.cpp"

static int s;

inline int inlineFunction(int a, int b)
{
        s = a+b;
        return a+b;
}

void nonInlineFunction(int a)
{
        s = a;
}

int main(int, char**)
{
        nonInlineFunction(inlineFunction(5, 6));
        nonInlineFunction(inlineFunction(5, 6));
        return 0;
}

-- output of dwarfdump -l on the generated object file

line number info
<source>	[row,column]	<pc>	//<new statement or basic block
/home/rdelashmit/gcctest/a.cpp:	[ 11,-1]	0	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 12,-1]	0x3	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 13,-1]	0xb	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 16,-1]	0xe	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x17	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x21	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x2d	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x37	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x43	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x4e	// new statement
	// end of text sequence

-- 
           Summary: Missing debug_line info for non-inline function call
                    site with inline call in parameter
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rdelashmit at soe dot sony dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/14423] Missing debug_line info for non-inline function call site with inline call in parameter
  2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
@ 2004-03-04  8:11 ` pinskia at gcc dot gnu dot org
  2004-03-04 15:44 ` rdelashmit at soe dot sony dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-04  8:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-04 08:11 -------
Looks to be fixed for both 3.3.1 and 3.4.0, can you try 3.3.3 and see if it is fixed?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/14423] Missing debug_line info for non-inline function call site with inline call in parameter
  2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
  2004-03-04  8:11 ` [Bug debug/14423] " pinskia at gcc dot gnu dot org
@ 2004-03-04 15:44 ` rdelashmit at soe dot sony dot com
  2004-03-04 15:47 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rdelashmit at soe dot sony dot com @ 2004-03-04 15:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rdelashmit at soe dot sony dot com  2004-03-04 15:44 -------
(In reply to comment #1)
> Looks to be fixed for both 3.3.1 and 3.4.0, can you try 3.3.3 and see if it 
is fixed?

I tried 3.3.3, and dwarfdump is identical to that given using 3.2.3.  I also 
built and tested a cvs version from yesterday (3.5.0 20040303 (experimental)) 
and the relevant debug info is missing there as well.  Below is the dwarfdump 
for the 3.3.3 built file, and the 2.95.3 built file.  Source lines 17 and 18 
are the ones I would expect to be present that are missing from the 3.x built 
file.

With 3.3.3:
line number info
<source>	[row,column]	<pc>	//<new statement or basic block
/home/rdelashmit/gcctest/a.cpp:	[ 11,-1]	0	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 12,-1]	0x3	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 13,-1]	0xb	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 16,-1]	0xe	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x17	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x21	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x2d	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x37	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x43	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x4e	// new statement
	// end of text sequence

With 2.95.3:
line number info
<source>	[row,column]	<pc>	//<new statement or basic block
/home/rdelashmit/gcctest/a.cpp:	[ 11,-1]	0x3	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 12,-1]	0x6	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 13,-1]	0xf	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 17,-1]	0x16	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x19	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x19	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  7,-1]	0x23	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  8,-1]	0x23	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 17,-1]	0x23	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 18,-1]	0x2a	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  5,-1]	0x2d	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  6,-1]	0x30	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  7,-1]	0x3a	// new statement
/home/rdelashmit/gcctest/a.cpp:	[  8,-1]	0x3a	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 18,-1]	0x3a	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 19,-1]	0x41	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x47	// new statement
/home/rdelashmit/gcctest/a.cpp:	[ 20,-1]	0x47	// new statement
	// end of text sequence


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/14423] Missing debug_line info for non-inline function call site with inline call in parameter
  2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
  2004-03-04  8:11 ` [Bug debug/14423] " pinskia at gcc dot gnu dot org
  2004-03-04 15:44 ` rdelashmit at soe dot sony dot com
@ 2004-03-04 15:47 ` pinskia at gcc dot gnu dot org
  2004-03-04 16:01 ` rdelashmit at soe dot sony dot com
  2004-06-03  0:57 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-04 15:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-04 15:47 -------
Okay, where do I get this dwarfdump as readelf --debug-dump gives this for 3.3.3 (which looks right):
  Extended opcode 2: set Address to 0x8048340
  Advance Line by 11 to 12
  Copy
  Special opcode 48: advance Address by 3 to 0x8048343 and Line by 1 to 13
  Special opcode 48: advance Address by 3 to 0x8048346 and Line by 1 to 14
  Special opcode 18: advance Address by 1 to 0x8048347 and Line by -1 to 13
  Special opcode 76: advance Address by 5 to 0x804834c and Line by 1 to 14
  Special opcode 64: advance Address by 4 to 0x8048350 and Line by 3 to 17
  Advance Line by -10 to 7
  Special opcode 19: advance Address by 1 to 0x8048351 and Line by 0 to 7
  Advance Line by 10 to 17
  Special opcode 75: advance Address by 5 to 0x8048356 and Line by 0 to 17
  Advance Line by -10 to 7
  Special opcode 117: advance Address by 8 to 0x804835e and Line by 0 to 7
  Special opcode 88: advance Address by 6 to 0x8048364 and Line by -1 to 6
  Advance PC by constant 17 to 0x8048375
  Special opcode 34: advance Address by 2 to 0x8048377 and Line by 1 to 7
  Special opcode 144: advance Address by 10 to 0x8048381 and Line by -1 to 6
  Advance Line by 15 to 21
  Special opcode 75: advance Address by 5 to 0x8048386 and Line by 0 to 21
  Advance PC by 6 to 804838c
  Extended opcode 1: End of Sequence

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/14423] Missing debug_line info for non-inline function call site with inline call in parameter
  2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
                   ` (2 preceding siblings ...)
  2004-03-04 15:47 ` pinskia at gcc dot gnu dot org
@ 2004-03-04 16:01 ` rdelashmit at soe dot sony dot com
  2004-06-03  0:57 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rdelashmit at soe dot sony dot com @ 2004-03-04 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rdelashmit at soe dot sony dot com  2004-03-04 16:01 -------
(In reply to comment #3)
dwarfdump can be found at http://reality.sgi.com/davea
'dwarfdump -l' output as I used previously is the equivalent of 'readelf -wl', 
so I'll switch to that format for consistency.

Using gcc 3.3.3 and readelf -wl, I don't get the same results that you did.

I get the following (once again missing source lines 17 and 18):

  Extended opcode 2: set Address to 0x0
  Advance Line by 10 to 11
  Copy
  Special opcode 48: advance Address by 3 to 0x3 and Line by 1 to 12
  Special opcode 118: advance Address by 8 to 0xb and Line by 1 to 13
  Special opcode 50: advance Address by 3 to 0xe and Line by 3 to 16
  Advance Line by -10 to 6
  Special opcode 131: advance Address by 9 to 0x17 and Line by 0 to 6
  Special opcode 144: advance Address by 10 to 0x21 and Line by -1 to 5
  Special opcode 174: advance Address by 12 to 0x2d and Line by 1 to 6
  Special opcode 144: advance Address by 10 to 0x37 and Line by -1 to 5
  Advance Line by 15 to 20
  Special opcode 173: advance Address by 12 to 0x43 and Line by 0 to 20
  Advance PC by 11 to 4e
  Extended opcode 1: End of Sequence

Compile output is as follows:

Reading specs from /home/rdelashmit/bin/gcc-3.3.3/lib/gcc-lib/i686-pc-linux-
gnu/3.3.3/specs
Configured with: ../configure --prefix=/home/rdelashmit/bin/gcc-3.3.3
Thread model: posix
gcc version 3.3.3
 /home/rdelashmit/bin/gcc-3.3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/cc1plus -E -
D__GNUG__=3 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -
dD -D_GNU_SOURCE a.cpp -O1 a.ii
ignoring nonexistent directory "/home/rdelashmit/bin/gcc-3.3.3/i686-pc-linux-
gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/rdelashmit/bin/gcc-3.3.3/include/c++/3.3.3
 /home/rdelashmit/bin/gcc-3.3.3/include/c++/3.3.3/i686-pc-linux-gnu
 /home/rdelashmit/bin/gcc-3.3.3/include/c++/3.3.3/backward
 /usr/local/include
 /home/rdelashmit/bin/gcc-3.3.3/include
 /home/rdelashmit/bin/gcc-3.3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include
 /usr/include
End of search list.
 /home/rdelashmit/bin/gcc-3.3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/cc1plus -
fpreprocessed a.ii -quiet -dumpbase a.cpp -auxbase-strip a-inline-3.3.3 -g3 -
O1 -version -o a.s
GNU C++ version 3.3.3 (i686-pc-linux-gnu)
	compiled by GNU C version 3.2.3.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128726
 as -V -Qy -o a-inline-3.3.3 a.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 
2.13.90.0.18 20030206


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/14423] Missing debug_line info for non-inline function call site with inline call in parameter
  2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
                   ` (3 preceding siblings ...)
  2004-03-04 16:01 ` rdelashmit at soe dot sony dot com
@ 2004-06-03  0:57 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-03  0:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-03 00:57 -------
Okay, you had forgot to say that you were compiling with optimization.  Anyways this is fixed on the 
mainline by the merge of the tree-ssa so closing as fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
           Keywords|                            |wrong-debug
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14423


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-03  0:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-04  0:22 [Bug debug/14423] New: Missing debug_line info for non-inline function call site with inline call in parameter rdelashmit at soe dot sony dot com
2004-03-04  8:11 ` [Bug debug/14423] " pinskia at gcc dot gnu dot org
2004-03-04 15:44 ` rdelashmit at soe dot sony dot com
2004-03-04 15:47 ` pinskia at gcc dot gnu dot org
2004-03-04 16:01 ` rdelashmit at soe dot sony dot com
2004-06-03  0:57 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).