[Dwarf-discuss] scope of a variable without lexical tag

Ron Brender ron.brender at charter.net
Thu Apr 5 05:36:54 PDT 2007


drizzle drizzle wrote:
> Hi
>      Is lexical tags essential to be able to distinguish between two
> local variables of the same name but in different scopes ( say
> declared in two different if blocs) bu ?  I am wondering what the
> consequence might be in terms of debugging correctness if the compiler
> does not generate the lexical tag ?
> 
> if (  }
> {
>    int x;
> 
> }
> 
> if (){
> 
> int x;
> 
> }

If the compiler fails to provide an accurate description of the source 
program and its transformation into code, one should not be surprised if 
the debugger is unable to operate correctly.

>      Can they be distinguished without the lexical tag ?

Hardly. Without the lexical tag, the source will possibly be described 
as a scope containing two declarations for variables named 'x'. This is 
almost always a source error that never reaches the debugger--how a 
debugger deals with such ill-defined input is hard to say.




More information about the Dwarf-Discuss mailing list