Bug #7100 2006-04-10 12:15

lastattacker

Wrong watch values

When one has the following for example:

void f1()

{

int a = 5;

a += f2();

}

int f2()

{

char a = 'a' - 'b';

return a;

}

Then when the debugger enters the f2 func, it doesn't see that variable 'a' in f2 as a char but as an int and also gives it totally different values. In my case I had an int in my first function and an enum in my second one. Then when I entered the 2nd func, it didn't see that variable in a different scope as an enum but as an int. Also in the same function I had another int which I initialized to 0 but when it gets initialized, it doesn't set that value to 0, only in the function where I'm having problems with my enum variable.

I hope it was put clear enough.

Category
Debugger
Group
 
Status
Closed
Close date
2006-05-22 11:13
Assigned to
 
thomasdenk 2006-04-18 21:00

I compiled and ran the code you posted, and except that it contains at least one obvious error (which probably causes the malfunction that you observed), everything works fine.

The debugger (gdb 6.3) reports everything nicely for me, just as it should do.

lastattacker 2006-04-18 22:08

I tried something different with an enum this time (and it was with an enum that I had problems with) and there was no problem.

Its weird.

O well, if I come accross it again, I will try to give a more detailed piece of code to reproduce the error.

Thanks

lastattacker 2006-04-18 22:08

I tried something different with an enum this time (and it was with an enum that I had problems with) and there was no problem.

Its weird.

O well, if I come accross it again, I will try to give a more detailed piece of code to reproduce the error.

Thanks

thomasdenk 2006-05-22 11:13

Report is closed.

Note: This is a preformatted standard message.

Possible reasons for closing this report are:

* the developer in charge of the issue

- could not reproduce it despite trying several times

- did not get sufficient information

- got no reply to an inquiry for specific information

* the report is quite a bit dated of now, and

- no user comments have been added for several weeks

- significant changes have been made to the code

- no other developer could reproduce it either

It is assumed that the problem does not persist and the report

can be closed.

If the problem reappears in future releases, please feel free to

re-open this report and provide precise information on how to

reproduce it.