[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decladebug

Title:Digital Ladebug debugger
Moderator:TLE::LUCIA
Created:Fri Feb 28 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:969
Total number of notes:3959

892.0. ""No class object..." w/ shared objects" by DECC::MJHANS (Matthew Hanselman, DEC C/C++) Thu Mar 20 1997 10:14

    Sorry -- I've found more problems with the new single-class approach:
    
    Using shared objects with ladebug 4.0-33 and C++ V5.6-121, you cannot
    type "print b.mf2()" while in main() -- ladebug gives the error "No
    class object...".  Note that the problem goes away when you compile
    non-shared.
    
    The commands to use are:
    
    cxx -g -O0 -shared -rpath . -o x_0041a.so x_0041a.cxx
    cxx -g -O0 x_0041a.so x_0041b.cxx
    ladebug a.out
        stop in main ; run ; p b.mf2()
    
    The sources are:
    -------------------------
    // x_0041.h
    #include "stdio.h"
    
    extern int counter;
    
    typedef class BASE { public:
        int bi; 
        /*ctr*/ BASE() : bi(counter++) {}
        void mf1();
        void mf2();
    } *BASE_ptr;
    ------------------------
    // x_0041a.cxx
    #include "x_0041.h"
    
    static int i = (counter=101);   // reset counter
    
    void BASE::mf1() {
        printf("BASE::mf1\n");
        mf2();
    }
    ------------------------
    #include "x_0041.h"
    int counter;
    static int i = (counter=1);     // reset counter
    
    BASE b;
    
    void BASE::mf2() {
        printf("BASE::mf2\n");
    }
    
    int main()
    {
        b.mf1();
        return 0;
    }
    ------------------------
    
    The output from ladebug:
    
    
    Welcome to the Ladebug Debugger Version 4.0-33
    ------------------ 
    object file name: a.out 
    Reading symbolic information ...done
    (ladebug) stop in main ; run ; p b.mf2()
    [#1: stop in int main(void) ]
    [1] stopped at [int main(void):14 0x120001cd8]
         14     b.mf1();
    No class object for member function call which requires one
    Error: no value for b.mf2() 
    
    
    							- Matt
T.RTitleUserPersonal
Name
DateLines
892.1Being looked at....TLE::MERRITTSteve Merritt, Ladebug TeamMon Mar 24 1997 09:555
This is being looked at now.


-Steve
892.2FixedTLE::MERRITTSteve Merritt, Ladebug TeamFri Apr 18 1997 14:3122
This is fixed in 4.0-36


alime.zko.dec.com> cxx -g -O0 -shared -rpath . -o x_0041a.so x_0041a.cxx
ld:
Warning: Unresolved:
counter
BASE::mf2(void)
alime.zko.dec.com> cxx -g -O0 x_0041a.so x_0041b.cxx -o 0041
alime.zko.dec.com> $V40P/ladebug 0041
Welcome to the Ladebug Debugger Version 4.0-36
------------------
object file name: 0041
Reading symbolic information ...done
(ladebug) stop in main
[#1: stop in int main(void) ]
(ladebug) run
[1] stopped at [int main(void):13 0x120002508]
     13     b.mf1();
(ladebug) print b.mf2()
BASE::mf2
void