[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 110032] New: display area not distinguishing between local and global variables
From:       kdevelop-bugs-admin () barney ! cs ! uni-potsdam ! de
Date:       2005-08-02 11:46:34
Message-ID: 20050802134633.110032.jdhenning () gmx ! de
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=110032         
           Summary: display area not distinguishing between local and global
                    variables
           Product: kdevelop
           Version: unspecified
          Platform: SuSE RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-bugs kdevelop org
        ReportedBy: jdhenning gmx de


Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
Compiler:          gcc 
OS:                Linux

the variable display area does not distinguish correctly between local and global \
variables

In the following program a breakpoint is set on the line "test_sub" and then the \
variable "var1" is entered to the variable list. The value "5" is displayed \
correctly.

Then the subroutine "test_sub" is entered and when the local variable "var1" gets the \
value "10", this value is displayed as well for the global variable "var1".

Maybe it is not very good programming style to use the same name with different \
scope, but it's legal; mixing the scope of variables is definitely a fault of the \
debugger.

#include <stdio.h>

void test_sub(void);

int var1;

int main()
{

  var1 = 5;
  test_sub();
  printf("from main: var1 = %d \n", var1);

}

void test_sub()
 {
 int var1;

 var1 = 10;
 printf("from sub: var1 = %d \n", var1);

 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic