----- Original Message -----
Hello Dave,
I have realized the function to display anonymous members of
struct/union. There are three changes, which are listed below, and I
will take "struct page" for example.
1. anonymous members will be showed when using "struct page"
That's nice...
2. anonymous member, "struct page.private", will be showed
together with
its offset
Sorry -- but doing that redefines the "struct" command output for both named
members and anonymous members. The "struct -o" option should be used to
prepend
the offset. Can you re-work the patch so that it behaves the same way
as it currently does?
3. anonymous member with the address of the structure, "struct
page.private xxx", will be showed.
About the implementation, gdb code is changed, which is used to change
the output of the gdb command, "ptype ...". And function
"arg_to_datatype" is also modified to analyze anonymous member.
I'm presuming (but not sure) that the change to anon_member_offset() to use
open_tmpfile2() is because your patch introduces a new potential path to
anon_member_offset() that would be inside a open_tmpfile()/close_tmpfile()
region? Is that correct?
The change to gdb's c_type_print_base() function is interesting -- do
you consider that a bug in gdb, or do you think they have a reason
for doing it the way it's done now? I ask because gdb has several
structure-printing optional variables, so I'm kind of surprised that
it's hard-wired to behave the way it does.
Thanks,
Dave