public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* debug/3352: extern/inline combination in try/catch causes wrong lineinfo for all symbols in file
@ 2001-06-21 18:46 jakacki
  0 siblings, 0 replies; 2+ messages in thread
From: jakacki @ 2001-06-21 18:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3352
>Category:       debug
>Synopsis:       extern/inline combination in try/catch causes wrong lineinfo for all symbols in file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 21 18:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Grzegorz Jakacki <jakacki@cidc.com.cn>
>Release:        gcc version 2.95.2 19991024 (release) , GNU nm 2.9.1
>Organization:
>Environment:
sparc-sun-solaris2.6
>Description:
When there is extern function call in 'try' and inlined 
function is called 'catch', and this construct appears in
the last function definition in the source file, all the 
symbols in the file get the lineinfo of the inlined 
function. 

The bug was also present in nightly x86 GNU/Linux 
build on 2001-06-20, gcc-3_0-branch (CodeSourcery).
>How-To-Repeat:
$ gcc -c -g inlined_catch_debuginfo_bug.cc
$ nm -l inlined_catch_debuginfo_bug.o | grep main
000000e0 t Letext       /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000000 ? __EXCEPTION_TABLE__  /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000000 ? __FRAME_BEGIN__      /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U __cp_pop_exception   /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U __eh_rtime_match     /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U __rtti_user  /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U __start_cp_handler   /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000000 W __tf9exception       /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U __throw      /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000008 C __ti9exception
         U external__Fv /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000000 W inlined__Fv  /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
00000000 T main /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
         U terminate__Fv        /home/jakacki/projects/partition/systemc_release/src/gcc-bug/inlined_catch_debuginfo_bug.cc:11
$ cat inlined_catch_debuginfo_bug.cc
//
// compile with 'gcc -c -g'
// (gcc version 2.95.2 19991024 (release))
//
// and make 'nm -l'; the line number of 'main' is 11 not 15 */
// GNU nm 2.9.1

class exception {
};

inline void inlined() {} /* line 11 */

extern void external();

int main(int argc, char* argv[]) /* line 15 */
{
    try
    {
      external();
    }
    catch(const exception &x)
    {
      inlined();
    }
}


$
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: debug/3352: extern/inline combination in try/catch causes wrong lineinfo for all symbols in file
@ 2001-12-18 14:23 dberlin
  0 siblings, 0 replies; 2+ messages in thread
From: dberlin @ 2001-12-18 14:23 UTC (permalink / raw)
  To: dberlin, gcc-bugs, gcc-prs, jakacki, nobody

Synopsis: extern/inline combination in try/catch causes wrong lineinfo for all symbols in file

Responsible-Changed-From-To: unassigned->dberlin
Responsible-Changed-By: dberlin
Responsible-Changed-When: Tue Dec 18 14:23:29 2001
Responsible-Changed-Why:
    Me	
State-Changed-From-To: open->closed
State-Changed-By: dberlin
State-Changed-When: Tue Dec 18 14:23:29 2001
State-Changed-Why:
    This is an assembler/linker bug (somewhere in bfd's stabs handling, in other words).
    if you look at the output of gcc, it's identifying the correct lines.
    I.e. we have
         .stabs  "main:F(0,1)",36,0,16,main
    etc
    However, the object file incorrectly has:
             U _Unwind_Resume       /home/dberlin/a.cc:11
    00000000 W _Z7inlinedv  /home/dberlin/a.cc:11
             U _Z8externalv /home/dberlin/a.cc:11
    00000000 V _ZTI9exception       /home/dberlin/a.cc:11
    00000000 V _ZTS9exception       /home/dberlin/a.cc:11
             U _ZTVN10__cxxabiv117__class_type_infoE        /home/dberlin/a.cc:11
             U __cxa_begin_catch    /home/dberlin/a.cc:11
             U __cxa_end_catch      /home/dberlin/a.cc:11
             U __gxx_personality_v0 /home/dberlin/a.cc:11
    00000000 T main /home/dberlin/a.cc:11
    
    So the problem isn't gcc, it's the assembler/bfd

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3352


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

end of thread, other threads:[~2001-12-18 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21 18:46 debug/3352: extern/inline combination in try/catch causes wrong lineinfo for all symbols in file jakacki
2001-12-18 14:23 dberlin

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).