On 05/04/07, Brian Ellis <[EMAIL PROTECTED]> wrote:

Now if there were actual function calls in the initialization, and no records 
were emitted, I would consider that to be a problem (haven't tested this at the 
moment though), however, static initializers like that could easily be skipped 
as a feature in the interest of saving space.

Example :
int i = 0;
int j = 2;
int n = CalculateSomething( j, &i );
int k = 3;

I would expect debug records for the initialization of 'n' to be emitted and a 
break point to properly work on that line... all others I could completely care 
less for.

I don't really understand, because the problem remains that if you
break before int n... and do print n you get a value, whereas you
should get an error saying the variable is not in scope.

Heck, if the scope for k (being a primitive type that is initialized with a 
compile-time
constant value) were started before n, i wouldn't even consider that to be a 
bug... I would
consider it a marvel of intelligence in the compiler.

How so?

Rob

----- Original Message ----
From: Joe Buck <[EMAIL PROTECTED]>
To: Rob Quill <[EMAIL PROTECTED]>
Cc: GCC Development <gcc@gcc.gnu.org>
Sent: Thursday, April 5, 2007 12:32:04 PM
Subject: Re: Variable scope debug info

On Thu, Apr 05, 2007 at 02:37:06PM +0100, Rob Quill wrote:
> My problem is thus: When using GDB do debug the follow bit of code:
>
> int i = 0;
> int j = 2;
> int k = 3;
>
> If I set a breakpoint at the 3rd line, before int k = 3; has been
> executed, and check if k is in scope, I find that it is, when, of
> course, it shouldn't be. I emailed the GDB mailing list about this and
> was informed that the problem arose because GCC does not emmit and GDB
> cannot handle the DW_AT_start_scope attribute (DWARF 3 standard, page
> 61, item 11).

If adding scope attributes every time more than one variable is declared
adds to the already immense bulk of C++ debugging information, I'd
prefer to live with the bug myself.







____________________________________________________________________________________
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

Reply via email to