[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

879.0. "Problems with looking at types" by CCXX::MJHANS (Matthew Hanselman, DEC C) Tue Mar 11 1997 09:58

    There are two problems with the enum in this program:
    
    	a) a "whereis" lists main() twice.
    	b) a "whatis", giving the complete scope path, fails.
    
    ++++++++++++++++++++++
    main()
    {
      enum numbers {zero, one, two};
    
      return 0;
    }
    ++++++++++++++++++++++
    
    Welcome to the Ladebug Debugger Version 4.0-30
    ------------------ 
    object file name: a.out 
    Reading symbolic information ...done
    (ladebug) whereis numbers
    "tmp.cxx"`main`numbers
    "tmp.cxx"`main`numbers
    (ladebug) whatis "tmp.cxx"`main`numbers
    whatis "tmp.cxx"`main`numbers
                                  ^
    Unable to parse input as legal command or C++ expression.
    (ladebug) whatis numbers
    enum {zero, one, two}
    
    							- Matt
T.RTitleUserPersonal
Name
DateLines
879.1TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlTue Mar 11 1997 13:5723
Hmm.  Works okay with cc -migrate -g on my 3.2 system.  What is different?  Can
you post an stdump of the .o file?

/local/lucia/scratch> ladebug a.out
Welcome to the Ladebug Debugger Version 4.0-30
------------------ 
object file name: a.out 
Reading symbolic information ...done
(ladebug) list 1,100
      1     main()
      2     {
      3       enum numbers {zero, one, two};
      4     
      5       return 0;
      6     }
(ladebug) whereis numbers
"mjh.c"`main`numbers
(ladebug) whatis numbers
enum numbers {zero, one, two}
(ladebug) 
/local/lucia/scratch> uname -a
OSF1 savvy.zko.dec.com V3.2 148 alpha
/local/lucia/scratch> 
879.2TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlTue Mar 11 1997 13:587
(I grant you "whatis" with qualification does not work)

(ladebug) whatis "mjh.c"`main`numbers
whatis "mjh.c"`main`numbers
                            ^
Unable to parse input as legal command or C expression.
(ladebug) 
879.3CXXC::MJHANSMatthew Hanselman, DEC CTue Mar 11 1997 14:4322
    Ah.  A difference between C and C++.  I actually believe C++ is correct
    here (I keyed my bug while using C++).  Is C++ correct?
    
    C generates information for "numbers" with a simple Block/End.  C++
    also includes a Tag.  So it must be that Tag that's providing the extra
    output.
    
    This is also the case with classes, and other things with tags....
    
    greping stdumps for numbers:
    
    (C)
      2. ( 2)(   0) numbers    Block      Info       symref 7
      6. ( 2)(   0) numbers    End        Info       symref 2
    
    (C++)
      2. ( 2)(   0) numbers    Tag        Info       [19] enum(extended file 0, index 3)
      3. ( 2)(   0) numbers    Block      Info       symref 8
      7. ( 2)(   0) numbers    End        Info       symref 3
    
    
    								- Matt
879.4TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlTue Mar 11 1997 18:237
Well you didn't say which compiler, and you personal name says "DEC C".  I
initially typed "cxx ..." to compile it but did a double take.  

Your explanation of the C++ behavior is correct.  Which is right (c or c++) I
still am not sure.

Tim
879.5CXXC::MJHANSMatthew Hanselman, DEC CWed Mar 12 1997 08:0911
    > Well you didn't say which compiler, and you personal name says "DEC C".   I
    > initially typed "cxx ..." to compile it but did a double take.
      
    I've been working on C++ for the past couple of weeks.  I pulled the
    typical engineer's mistake of talking as if everything pertained
    directly to my project.  :)
    
    I'll remember to include compiler directions in my examples from now
    on.
    
    							- Matt