| 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 | 
    DEC C++ V5.5-004, ladebug 4.0-30:                         
    
    This program will produce a bad reference when attempting to view a
    variable.
    
    Step into b().  When in b(), try printing out one.  You'll get the
    message "<bad reference>"
    
    Note that if you remove the initialization of the variable "two", the
    problem goes away.
    
    							- Matt
    
    -------------------
    struct A_tag {
      int a_member;
    };
    
    static A_tag* get_tag(A_tag& var)
    {
      return 0;
    }
    
    static void b(A_tag& var)
    {
      A_tag& one = var;
      A_tag* two = get_tag(var);
    }
    
    main()
    {
      A_tag var;
    
      b(var);
      return 0;
    }
    --------------------
    
    Welcome to the Ladebug Debugger Version 4.0-30
    ------------------ 
    object file name: a.out 
    Reading symbolic information ...done
    (ladebug) stop in b
    [#1: stop in void b(A_tag&) ]
    (ladebug) run
    [1] stopped at [void b(A_tag&):12 0x120002124]
         12   A_tag& one = var;
    (ladebug) print one
    <bad reference>
    (ladebug) 
    
    
    							- Matt
| T.R | Title | User | Personal Name | Date | Lines | 
|---|---|---|---|---|---|
| 850.1 | TLE::MURRAY | Wanfang Murray | Mon Feb 24 1997 07:26 | 5 | |
|     
    Stephen will take a look at this.
    
    Wanfang
    
 | |||||
| 850.2 | motivation | CAIRN::HARRIS | Kevin Harris, dtn 381-2039 | Thu Mar 06 1997 14:42 | 7 | 
| This one bit me today. With reference parameters and reference variables. We use reference arguments and variables heavily in the Middle End of the EDG based C++ compilers, so we will continue to have this problem until it is fixed in ladebug. I discovered that I could get the necessary variable value by examining non-reference variables higher up in the call stack, so we don't need an additional workaround. -Kevin | |||||
| 850.3 | TLE::BRETT | Wed May 28 1997 14:28 | 1 | ||
| fixed | |||||