delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/06/13:23:00

Message-ID: <000601bf0fff$7b54dee0$6032893e@amh-home>
From: "Andrew Hurrell" <andrew AT amh-consulting DOT freeserve DOT co DOT uk>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp AT delorie DOT com>
Subject: Re: complex numbers
Date: Wed, 6 Oct 1999 14:33:11 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

>> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019