[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

396.0. "Ladebug Debugger Version 4.0-11 - treatment of consts" by UHUH::MICHAELS (Karen Michaels) Tue Jan 09 1996 16:19

T.RTitleUserPersonal
Name
DateLines
396.1SMURF::PETERTrigidly defined areas of doubt and uncertaintyWed Jan 10 1996 11:5718
396.2UHUH::LUCIAhttp://asaab.zko.dec.com/people/tjl/biography.htmlWed Jan 10 1996 13:496
396.3DECC::CARLSONThu Jan 11 1996 11:3421
396.4MoreTLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlFri May 02 1997 11:4135
    Opinions?  Who wants a warning?  Who doesn't?  There appears to be a
    problem in the way constants are used by the compiler and by the
    debugger, i.e.
    
    /local/lucia/scratch> ladebug const
    Welcome to the Ladebug Debugger Version 4.0-35
    ------------------ 
    object file name: const 
    Reading symbolic information ...done
    (ladebug) list 1,100
          1 #include <iostream.h>
          2 
          3 int main()
          4 {
          5     const int four = 4;
          6     cout << four << endl;
          7     return four;
          8 }
    (ladebug) stop at 6
    [#1: stop at "const.C":6 ]
    (ladebug) run
    [1] stopped at [int main(void):6 0x120001c98]
          6     cout << four << endl;
    (ladebug) whatis four
    const int four
    (ladebug) print four
    4
    (ladebug) a four=123                    # change const int four to 123
    (ladebug) print four                    # ladebug thinks four == 123
    123
    (ladebug) c                             # but the code doesn't.
    4
    Process has exited with status 4
    (ladebug) 
    
396.5DECCXL::OUELLETTEmudseason into blackfly seasonFri May 02 1997 13:239
The compiler is justified in value propagation of const variables.
Sometimes you'll need to modify code in addition to data if you want
to fiddle this stuff in the debugger.

However, for things like const char[]'s and string literals, being
able to change them in the debugger might be useful & the compiler
is rather unlikely to value propagate them any time soon...

R.
396.6TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlFri May 02 1997 13:4612
    In the non -g case, I have no problem with the constant propagation.  I
    (of course being the debugger guy, I am biased towards debugging, and
    being the compiler guy, you are biased towards compilation) would
    really like to see "-g" mean "Compiler, do everything you can to assist
    me in debugging my program".  Which means turning off even the most
    seemingly benign optimizations.
    
    Perhaps in a case like this, the variable 'four' ought not be described
    in the symbol table, since it clearly described incorrectly.
    
    Tim
    
396.7DECCXL::OUELLETTEmudseason into blackfly seasonFri May 02 1997 14:354
I'll make note of this and see if we cannot keep const variables
from being value propagated and folded at -O0 in the V6.0 compiler.

R.