Mail Archives: djgpp/1997/01/23/22:24:57
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
>On Wed, 22 Jan 1997 frazer AT rtp DOT ericsson DOT se wrote:
>> I am having problems with GDB and static variables. GDB seems
>> to have problems with debugging information for uninitialized
>> static variables. Here is a test program which exhibits the
>> strangeness:
>[snip]
>> Now I compile with DJGPP v2.01 and GCC 2.7.2.1:
>>
>> C:\TEST>gcc -c -m486 -Wall -g -o main.o main.c
>Does the same happen if you compile without -m486? Maybe that switch
>causes gcc to optimize the code, whereby it's OK if the code isn't
>exactly like the source.
Yes, the same thing happens without the "-m486". I have found that
if I declare things like:
static int a_variable = { };
static struct a_struct_type a_struct = { { } };
GDB will have the proper debugging information. While this is both
a pain and ugly, it allows me to continue development. I downloaded
the sources for GDB and looked around in the source code hoping for
something obvious to be wrong, but didn't have any luck. Maybe
someone else can step up to the plate ...
Scott
- Raw text -