[OpenBIOS] static and global variable problem
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Fri Dec 21 10:55:25 CET 2012
On 20/12/12 20:16, Programmingkid wrote:
> I was doing some debugging of an issue with the hash_page_32() function in the file ofmem.c, when I noticed a very odd problem. The static variable next_grab_slot never changes value. I tried declaring it as a global variable and its value still never changes. I used gdb to monitor its value. Local variables work just fine. Any body know a way to fix this problem? My guess is this is a gcc problem. What is your theory?
The first thing I would check is have you changed the CFLAGS from -Os to
-O0 to disable optimisation? Otherwise gdb is missing information it
needs to work correctly, and will start to do some strange things.
Also I note that when Alex did some work on this back in 2009, he made a
minor change to PPC's OFMEM here:
http://lists.openbios.org/pipermail/openbios/2009-July/003796.html. Alex
- should the change to hash_page_32() be committed or is that another
hack to work around something else?
ATB,
Mark.
More information about the OpenBIOS
mailing list