public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/39814]  New: GCC does not emit debug info for a called function
@ 2009-04-19 11:39 arthur dot loiret at gmail dot com
  2009-04-19 16:05 ` [Bug debug/39814] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: arthur dot loiret at gmail dot com @ 2009-04-19 11:39 UTC (permalink / raw)
  To: gcc-bugs

The following program:

#include <stdio.h>
#include <math.h>

int main() {
  printf("asin(1.0) = %f\n", asin(1.0));
  return 0;
}

prints correctly 1.570796, but "p asin(1.0)" from within gdb prints 0. However,
this work fine:

(gdb) p ((double (*)(double))asin) (1.0)
$4 = 1.5707963267948966

Or, with libc debug symbols installed:

(gdb) p __asin (1.0)
$5 = 1.5707963267948966


The explanation from Daniel Jacobowitz is:
The C library does not contain debug info for a function named 'asin',
because the implementation is __asin, so GDB does not know it returns
a double.  Also, GCC does not emit debug info for the called function
- I don't know why it doesn't, but probably to save space.


-- 
           Summary: GCC does not emit debug info for a called function
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: arthur dot loiret at gmail dot com
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


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

* [Bug debug/39814] GCC does not emit debug info for a called function
  2009-04-19 11:39 [Bug debug/39814] New: GCC does not emit debug info for a called function arthur dot loiret at gmail dot com
@ 2009-04-19 16:05 ` pinskia at gcc dot gnu dot org
  2009-04-21 18:07 ` pinskia at gcc dot gnu dot org
  2009-04-23 16:07 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-19 16:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-04-19 16:04 -------
Can you attach the preprocessed source? And what options are you using to
compile the program?  


It might be the case that asin is defined in the glibc's header as a macro
which causes no debug information to be emitted for asin as asin is not really
used.


-- 


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


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

* [Bug debug/39814] GCC does not emit debug info for a called function
  2009-04-19 11:39 [Bug debug/39814] New: GCC does not emit debug info for a called function arthur dot loiret at gmail dot com
  2009-04-19 16:05 ` [Bug debug/39814] " pinskia at gcc dot gnu dot org
@ 2009-04-21 18:07 ` pinskia at gcc dot gnu dot org
  2009-04-23 16:07 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-21 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2009-04-21 18:07 -------
Oh because constant folding of asin, we remove the reference to asin so no
debugging info for asin is going to be emitted because there is no call left
for asin.  Maybe -fbuiltins should not be enabled at -O0.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-04-21 18:07:01
               date|                            |


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


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

* [Bug debug/39814] GCC does not emit debug info for a called function
  2009-04-19 11:39 [Bug debug/39814] New: GCC does not emit debug info for a called function arthur dot loiret at gmail dot com
  2009-04-19 16:05 ` [Bug debug/39814] " pinskia at gcc dot gnu dot org
  2009-04-21 18:07 ` pinskia at gcc dot gnu dot org
@ 2009-04-23 16:07 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: drow at false dot org @ 2009-04-23 16:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from drow at gcc dot gnu dot org  2009-04-23 16:07 -------
Subject: Re:  GCC does not emit debug info for a called
        function

On Tue, Apr 21, 2009 at 06:07:01PM -0000, pinskia at gcc dot gnu dot org wrote:
> Oh because constant folding of asin, we remove the reference to asin so no
> debugging info for asin is going to be emitted because there is no call left
> for asin.  Maybe -fbuiltins should not be enabled at -O0.

In addition to that, there's still no debug info for it with
-fno-builtin.


-- 


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


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

end of thread, other threads:[~2009-04-23 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-19 11:39 [Bug debug/39814] New: GCC does not emit debug info for a called function arthur dot loiret at gmail dot com
2009-04-19 16:05 ` [Bug debug/39814] " pinskia at gcc dot gnu dot org
2009-04-21 18:07 ` pinskia at gcc dot gnu dot org
2009-04-23 16:07 ` drow at false 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).