Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 239152 - strange debuging messages with g++ (gcc 4.1.2) & gdb 6.7.1
Summary: strange debuging messages with g++ (gcc 4.1.2) & gdb 6.7.1
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-30 14:18 UTC by pavel sanda
Modified: 2008-09-30 21:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
file.c (pom.c,218 bytes, text/plain)
2008-09-30 14:19 UTC, pavel sanda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pavel sanda 2008-09-30 14:18:14 UTC
i got some strange bugs on my system and when i've tried to find out whats the problem i arrive to the attached small example.
when i compile it this way:
g++ pom.c -Wall -g -Wextra

then i launch gdb(6.7.1-r3) and set arguments this way:
set args 0.7 0 10000 10
when i come to the lines:
double alpha=0.1;
alpha=atof(argv[1]);

variable doesn't change its value at all.

can anybody reproduce it?

Reproducible: Always

Steps to Reproduce:
Comment 1 pavel sanda 2008-09-30 14:19:37 UTC
Created attachment 166829 [details]
file.c
Comment 2 pavel sanda 2008-09-30 14:39:59 UTC
perhaps there is nothing wrong with the gcc, only gdb does not recognize it has been compiled via g++. gcc compilation is ok, and printf of alpha works also ok.
Comment 3 Sebastian Luther (few) 2008-09-30 21:01:30 UTC
The reason for this is that your program contains the variable "alpha" twice. If you are not lucky enough gdb prints the wrong one with "print alpha". You can see them both with "info locals". Rename one of your alpha's and you get what you expect. 
Comment 4 pavel sanda 2008-09-30 21:06:32 UTC
aha, so this is not a bug; i will close it then.