This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Correction of complex number display for fortran program
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Correction of complex number display for fortran program
- From: Gregory Lielens <Gregory dot Lielens at fft dot be>
- Date: Tue, 23 May 2000 13:41:55 +0200
- Organization: Free Field Technologies
Hi,
I 've just dowloaded GDB 5.0 and use it to debug a fortran subroutine.
I've noted that value of complex variables or arrays are incorrectly
outputed by the print command, and also within the DDD frontend.
When inspecting a complex variable V, the value printed is
(Real(V),Real(V)) instead of (Real(V),Imag(V)). This behavior was
already present in the previous version of gdb, but this time I think
I've corrected it and send you the (very) small patch - one line to
change!
I'll try to follow the guidelines for this, but it's the first time I
contribute and English is not my native language, so don't expect too
much...
Here is the Changelog
Tue May 23 13:20:00 1999 Gregory Lielens <info@fft.be>
* f-valprint.c : Corrected f_val_print function for TYPE_CODE
(type) = TYPE_CODE_COMPLEX
and the diff
diff -up f-valprint.c.old f-valprint.c
--- f-valprint.c.old Tue May 23 13:34:51 2000
+++ f-valprint.c Tue May 23 13:34:25 2000
@@ -564,7 +564,7 @@ f_val_print (type, valaddr, embedded_off
fputs_filtered ("(", stream);
print_floating (valaddr, type, stream);
fputs_filtered (",", stream);
- print_floating (valaddr, type, stream);
+ print_floating (valaddr+TYPE_LENGTH(type), type, stream);
fputs_filtered (")", stream);
break;
Hope this help, and congratulation for the 5.0 release: it seems at lot
more stable when interacting whith DDD
Greg.