CTF: handle forward reference type
authorWeimin Pan <weimin.pan@oracle.com>
Wed, 7 Apr 2021 18:07:48 +0000 (14:07 -0400)
committerWeimin Pan <weimin.pan@oracle.com>
Wed, 7 Apr 2021 18:07:48 +0000 (14:07 -0400)
commitdc2b480f3df3bc7673c892e0cb8459a4ea72d447
tree726c2ad7e681e30b01f30cc3c5ac44cec3b5f51e
parent0a703a4cedffa6f3824e87f115e8d392e32de191
CTF: handle forward reference type

Added function fetch_tid_type which calls get_tid_type and will set up
the type, associated with a tid, if it is not read in yet. Also implement
function read_forward_type which handles the CTF_K_FORWARD kind.

Expanded gdb.base/ctf-ptype.exp to add cases with forward references.

gdb/ChangeLog:
       * ctfread.c (fetch_tid_type): New function, use throughout file.
       (read_forward_type): New function.
       (read_type_record): Call read_forward_type.

gdb/testsuite/ChangeLog:
       * gdb.base/ctf-ptype.c: Add struct link containing a forward
       reference type.
       * gdb.base/ctf-ptype.exp: Add "ptype struct link".
gdb/ChangeLog
gdb/ctfread.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/ctf-ptype.c
gdb/testsuite/gdb.base/ctf-ptype.exp