This is the mail archive of the gdb@sources.redhat.com 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]

Re: 5.2 branch gdb crash - infinite recursion stack overflow


Daniel Jacobowitz wrote:

>On Wed, Mar 06, 2002 at 07:57:11AM -0800, Gianni Mariani wrote:
>
>>Any ideas ?
>>
>
>"That's nice, give us more."
>
>I need to see a little more information before I can guess what's
>wrong.  Like, what were you doing?  Preferably source code so that I
>can actually debug the problem!
>
Oops, I forgot to mention that I had asked to print a deref of pointer 
to a class that has virtual inheritance and virtual methods.  In prior 
revs of gdb it would come back with "can't convert to integer" or 
somthing like that.

So, it terms of creating a snippet of offending code - I'll do that 
soon, I just am too bizzee right now.  However, here is the snippet of 
the code of the offending classes.  A HA_ErrorReport is an interface 
passed into methods that want to be able to report errors. 
 HA_ErrorReportImpl is an implementation of an error reporter that 
basically stores the error codes.

These were compiled using g++ 3.0.3 on RH 7.2 running linux 2.4.17 on an 
Athlon.

class HA_ErrorReport {
public:
      
    /**
     * SetErrorMessage
     * @parm code The error code being set.
     * @parm msg The error message being set.
     */
    virtual void SetErrorMessage( int w_code, const std::string & w_msg 
) = 0;
    
};  

class HA_ErrorReportImpl : virtual public HA_ErrorReport {
public:

    /**
     * m_message contains the last message set by SetErrorMessage.
     */
    std::string             m_message;
 
    /**
     * m_code contains the last code set by SetErrorMessage.
     */
    int                     m_code;

    /**
     * m_ncalled contains the number of times SetErrorMessage was called.
     */
    int                     m_ncalled;

    /**
     * SetErrorMessage implements the HA_ErrorReport method to reporting
     * errors.
     */
    virtual void SetErrorMessage( int w_code, const std::string & w_msg );
      
    HA_ErrorReportImpl() :
        m_code(0), m_ncalled(0)
    {
    }
      
    virtual ~HA_ErrorReportImpl()
    {
    }
};  



Regards
G

>




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]