help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

g++ 3.2.3 generates different code with and without symbol info


From: maett
Subject: g++ 3.2.3 generates different code with and without symbol info
Date: Thu, 22 Feb 2007 21:10:42 +0100
User-agent: Opera Mail/9.10 (Win32)

Hi.

I noticed that my g++ 3.2.3 generates different code with and without
symbol info (switch "-g").
I don't have a reduced test case, but the code can be sketched like this:


class Message
{
  // complicated class
};

void MyClass::MyFunction1( const Message& msg )
{
  MyFunction2( msg );
}

void MyClass::MyFunction2( const Message& msg )
{
  /* work hard */
}


If I compile with
    g++ -Os
I get this assembler code for MyClass::MyFunction1:

        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp
        jmp     _ZN7MyClass11MyFunction2ERK7Message


If I compile with
    g++ -Os -g
I get

        pushl   %ebp
        movl    %esp, %ebp
        pushl   12(%ebp)
        pushl   8(%ebp)
        call    _ZN7MyClass11MyFunction2ERK7Message
        leave
        ret


Is there a way to get the same code with and without symbol information ?

The problem is that the code that is delivered to the customer is generated
without symbol info. But sometimes an access violation occurs at the
customer, and then I generate with symbol infomation to find where the
crash was. If then the code is different it's hard to find the bug...

Maett


reply via email to

[Prev in Thread] Current Thread [Next in Thread]