[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

867.0. "Why omit variables that start with __?" by DECC::MJHANS (Matthew Hanselman, DEC C) Wed Mar 05 1997 18:04

    ladebug 4.0-30:
    
    Why does ladebug refuse to print out structure members when they begin
    with two underscores?  Interestingly, this only happens for C++ -- if
    the exact same program is compiled for C, it works fine.
    
    							- Matt
    
    =================
    struct A {
      int __b;
    } c;
    
    main() {}
    =================
    
    % ladebug a.out
    Welcome to the Ladebug Debugger Version 4.0-30
    ------------------ 
    object file name: a.out 
    Reading symbolic information ...done
    (ladebug) whatis A
    struct A  {
    }
    
T.RTitleUserPersonal
Name
DateLines
867.2ADA9X::BRETTWed Mar 05 1997 19:024
I believe this is to deliberately conceal the compiler-generated entities
that we add to the classes etc.

/Bevin
867.3DECC::OUELLETTEWed Mar 05 1997 19:073
This sort of deliberate obfuscation is little help to the average user.
A naive user may appreciate it, but it will really annoy and confuse
a power user.
867.4TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlWed Mar 05 1997 20:267
Hence the STWG problem of "compiler: should we (debugger) print this symbol or
not?"

Only the compiler knows.  It would be great if it would tell us.

Tim

867.5ADA9X::BRETTThu Mar 06 1997 11:0510
> Only the compiler knows.  It would be great if it would tell us.

Only the USER knows whether they are trying to debug some memory trashing of a
__vptr, or just trying to see the normal language data members of their struct.

So the compiler can flag the 'implicit' components - which we do today by 
'__'ing their identifiers - but only the user and the debugger can decide 
whether or not to see/show them.

/Bevin
867.6$verboseTLE::MERRITTSteve Merritt, Ladebug TeamFri Mar 07 1997 13:1116
It gives alot of extra stuff you may not want, but isn't this the
purpose for $verbose?

(ladebug) set $verbose=1
(ladebug) whatis u
class Uscore  {
  long x;
  short _t;
  int __f;
  Uscore(Uscore* const);
  Uscore(Uscore* const, const Uscore&);
  void foo(Uscore* const);
  Uscore& operator =(Uscore* const, const Uscore&);
} u

867.7I concedeDECC::MJHANSMatthew Hanselman, DEC CFri Mar 07 1997 14:065
    I can see the motivation for it more now, esp with the $verbose
    variable.  I didn't realize there was so much "questionably unuseful"
    information there was.  :)
    
    							- Matt
867.8DECC::OUELLETTEcrunchFri Mar 07 1997 14:124
> set $verbose=1

Way cool.  Is there a way for me to just see the data members
and ignore the member functions?
867.9I don't think so...TLE::MERRITTSteve Merritt, Ladebug TeamFri Mar 07 1997 16:1710
>Way cool.  Is there a way for me to just see the data members
>and ignore the member functions?

(ladebug) set $verbose=0.5  =8^)

Unfortunately no, to my knowledge there is no way to limit the output
when using $verbose. 


-Steve