Mail Archives: djgpp/1999/10/06/13:23:00
>> In the reference that Hans-Bernard pointed us to it states that
>> future versions of gdb will be able to debug src that uses _complex_
>> using the notation foo$real and foo$imag (or something similar)
>> However I've tried this with gdb 4.18 (and the 4.16 that ships with
>> rhide 1.4.7) and only gotten the message "foo$real:not available".
>
>How did you compile your program? Did you use -gstabs+ switch? If not,
>please use it and see if GDB can support complex variables. (I'm not
>sure that it can, but -gstabs+ is much more powerful in describing
>variable types than the default -g.)
Thanks Eli, I've tried using the -gstabs+ switch with the following results
Attempting to foo$real or foo$imag reports variable not available.
However if is simply examine foo then I obtain the real part of the
complex number. The only way I've found of obtaining the imaginary
part of the number is to use *(&(foo)+1). However, I note from the
gcc info page that gcc may store the real and imaginary parts of
complex numbers in entirely separate locations, and thus I would
guess that the above method is likely to be far from "safe".
Any other suggestions would be greatly appreciated
Thanks again for all your efforts
Andrew
- Raw text -