* Re: Debug info for 'complex' types
@ 2002-02-01 2:34 George Helffrich +44 117 954 5437
2002-02-01 7:26 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: George Helffrich +44 117 954 5437 @ 2002-02-01 2:34 UTC (permalink / raw)
To: drow, gcc-bugs, gdb, law
I proposed this change also to fix complex value support in GDB (I use
g77, gdb and complex arithmetic extensively in my line of work). My base
version was GDB 4.16. (I can send you patches if you are interested.) After
studying all stabs documentation I could find (with no particular illumination
on the issue of complex types), I also compared stabs output from other
Fortran compilers available to me. Here they are:
From Solaris 2.7 SC4.2 f77:
.stabs "complex*8:t9=R3;8",32,0,0,0
From SunOS 4.1.3 f77:
.stabs "complex:t7=r7;8;0;",0x20,0,0,0
and with the patch I proposed for g77 (2.95.2 19991024 release, patched):
.stabs "complex float:t(0,16)=r(0,16);8;0;",128,0,0,0
I think this indicates the length should be 8 for a single precision complex
value. If you want gdb to even think about supporting Sun Fortran compiler
stabs (my gdb tries to do so), *don't* withdraw this patch. Tell your users
to recompile if they want to debug code with complex arithmetic.
George Helffrich
(george@geology.bristol.ac.uk)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Debug info for 'complex' types
2002-02-01 2:34 Debug info for 'complex' types George Helffrich +44 117 954 5437
@ 2002-02-01 7:26 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2002-02-01 7:26 UTC (permalink / raw)
To: George Helffrich +44 117 954 5437; +Cc: gcc-bugs, gdb, law
On Fri, Feb 01, 2002 at 10:34:24AM +0000, George Helffrich +44 117 954 5437 wrote:
> I proposed this change also to fix complex value support in GDB (I use
> g77, gdb and complex arithmetic extensively in my line of work). My base
> version was GDB 4.16. (I can send you patches if you are interested.) After
> studying all stabs documentation I could find (with no particular illumination
> on the issue of complex types), I also compared stabs output from other
> Fortran compilers available to me. Here they are:
>
> >From Solaris 2.7 SC4.2 f77:
>
> .stabs "complex*8:t9=R3;8",32,0,0,0
>
> >From SunOS 4.1.3 f77:
>
> .stabs "complex:t7=r7;8;0;",0x20,0,0,0
>
> and with the patch I proposed for g77 (2.95.2 19991024 release, patched):
>
> .stabs "complex float:t(0,16)=r(0,16);8;0;",128,0,0,0
>
> I think this indicates the length should be 8 for a single precision complex
> value. If you want gdb to even think about supporting Sun Fortran compiler
> stabs (my gdb tries to do so), *don't* withdraw this patch. Tell your users
> to recompile if they want to debug code with complex arithmetic.
No, I'm sorry, that's not acceptable logic. You broke compatibility
with released 2.95.x; 'fixing' GDB for it would break support for that
version of g77.
Also note that the newer of your two compilers above - the Solaris 2.7
package is, I assume, newer - 'R' is used instead of 'r'. That'll be
handled correctly in GDB whatever the outcome of this discussion (or at
least separately).
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Debug info for 'complex' types
@ 2002-02-01 7:53 George Helffrich +44 117 954 5437
2002-02-01 8:39 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: George Helffrich +44 117 954 5437 @ 2002-02-01 7:53 UTC (permalink / raw)
To: drow; +Cc: gcc-bugs, gdb, law
Bug compatibility does not seem to be a desirable goal in g77. It seems to me
that the divergence in established use of complex stabs lay in g77's method,
and the patch corrects it. However, the issue should now be clear and the
empowered ones may decide.
George Helffrich
(george@geology.bristol.ac.uk)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Debug info for 'complex' types
2002-02-01 7:53 George Helffrich +44 117 954 5437
@ 2002-02-01 8:39 ` Andrew Cagney
2002-02-01 9:06 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2002-02-01 8:39 UTC (permalink / raw)
To: George Helffrich +44 117 954 5437; +Cc: drow, gcc-bugs, gdb, law
> Bug compatibility does not seem to be a desirable goal in g77. It seems to me
> that the divergence in established use of complex stabs lay in g77's method,
> and the patch corrects it. However, the issue should now be clear and the
> empowered ones may decide.
For g77 perhaphs. For GDB it is important. (To give a generalization)
People tend to upgrade their debugger long before they upgrade their
compiler. Consequently GDB is very much concerned with working with
more than just the current compilers.
Daniel write:
> Also note that the newer of your two compilers above - the Solaris 2.7
> package is, I assume, newer - 'R' is used instead of 'r'. That'll be
> handled correctly in GDB whatever the outcome of this discussion (or at
> least separately).
Is there a reason to not copy sun?
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Debug info for 'complex' types
2002-02-01 8:39 ` Andrew Cagney
@ 2002-02-01 9:06 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2002-02-01 9:06 UTC (permalink / raw)
To: Andrew Cagney; +Cc: George Helffrich +44 117 954 5437, gcc-bugs, gdb, law
On Fri, Feb 01, 2002 at 11:39:35AM -0500, Andrew Cagney wrote:
> Daniel write:
>
> >Also note that the newer of your two compilers above - the Solaris 2.7
> >package is, I assume, newer - 'R' is used instead of 'r'. That'll be
> >handled correctly in GDB whatever the outcome of this discussion (or at
> >least separately).
>
>
> Is there a reason to not copy sun?
Well, I suppose there's no reason not to. Switching GCC 3 to that
model would work, and be less ambiguous. Or we can just revert to past
behavior for g77 and that will work too.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Debug info for 'complex' types
@ 2002-01-30 20:26 Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2002-01-30 20:26 UTC (permalink / raw)
To: Jeffrey Law, George Helffrich, gcc-bugs; +Cc: gdb
While otherwise fixing complex value support in GDB, I came across this
patch:
Sun Jul 23 11:52:03 2000 George Helffrich (george@gly.bris.ac.uk)
* dbxout.c (dbxout_type, case COMPLEX_TYPE): Fix length field in stab.
It's wrong - the GDB stabs reader says:
/* If n3 is zero and n2 is positive, we want a floating type, and n2
is the width in bytes.
Fortran programs appear to use this for complex types also. To
distinguish between floats and complex, g77 (and others?) seem
to use self-subranges for the complexes, and subranges of int for
the floats.
Also note that for complexes, g77 sets n2 to the size of one of
the member floats, not the whole complex beast. My guess is that
this was to work well with pre-COMPLEX versions of gdb. */
This was true as late as 2.95.3, and broken by this patch. Can it be
reverted for 3.0.4 and 3.1, please? There's no way for GDB to tell if this
change is present or not in any reasonable fashion, so there is no way to
support it.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-02-01 17:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 2:34 Debug info for 'complex' types George Helffrich +44 117 954 5437
2002-02-01 7:26 ` Daniel Jacobowitz
-- strict thread matches above, loose matches on Subject: below --
2002-02-01 7:53 George Helffrich +44 117 954 5437
2002-02-01 8:39 ` Andrew Cagney
2002-02-01 9:06 ` Daniel Jacobowitz
2002-01-30 20:26 Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox