[Dwarf-Discuss] name lookup w/ using directives

Kendrick Wong kendrick at ca.ibm.com
Wed Aug 20 10:57:30 PDT 2008


Jason wrote:
> Yes, so the debugger needs to be smarter about C++ name lookup, and use 
> the same rules as the compiler: namely, an imported namespace isn't 
> searched until we search the common enclosing namespace of the imported 
> namespace and the current context.

You've nailed my primary concern. The 'common enclosing namespace' is not 
trivial to obtain, i.e.:
int a=0;
namespace A {
  namespace A1 {
    namespace B1 {
      ...
      namespace Z1 {
        int a=1;
      } 
    }
  }
  namespace A2 {
    ....
    namesapce Z2 {
      int fun () {
        using namespace ::A::A1::...::Z1;
        return a;     // returns ::A::A1::...::Z1::a
      }
    }
  }
}

The compiler already knows what the common enclosing namespace is (A in 
this case),  If this information is made available in DWARF, then the 
consumer would not need to go through extra effort to obtain this 
information.

Thanks,
Regards,

Kendrick Wong 
z/OS C/C++ Compiler 
Common Debug Architecture 
C2/YGK/8200/MKM 
kendrick at ca.ibm.com 
Office:905-413-2865 Fax:905-413-4839 Tie:313-2865 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20080820/c48e724e/attachment-0002.htm>


More information about the Dwarf-Discuss mailing list