This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC]: Patch to type and value print Fortran derived type - Fixfor gfortran PR24527
Hi, Thomas
On Sat, 29 Oct 2005, Thomas Koenig wrote:
> I can't easily test your patch because I don't compile gdb from
> sources.
>
> One test case that might be worth testing is
>
> program main
> type foo
> real :: a
> end type foo
> type bar
> type(foo) :: x
> real :: y
> end type bar
> type(bar) :: z
> z%x%a = 1.0
> z%y = 1.2
> print *,z
> end program main
>
> where a type contains another type.
>
My patch could handle that. But I don't take too much time on how to
print them. So the output is like this:
(gdb) ptype z
type = Type bar
Type foo
real*4 a
End type x
real*4 y
End type
(gdb) p z
$3 = { { 1}, 1.20000005}
(gdb)
Do you have thought on how to print that kind of embedded type?
In fact, that patch is only a begining. I just want to use that as a
strawman to solicit some comments, so that I can made it better to be
acceptable. To support derived type completely, 'p z%y' is also needed.
But I want to see how are you thinking on this patch first? Especially
from GDB community. :-) Anyway, my patch needed to be get into gdb
source to support that. :-)
Any comment from gdb maintainers? Daniel, any thought on this patch?
Best Regards
- Wu Zhou