diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-06-02 20:26:29 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-07-22 17:57:26 +0100 |
commit | 2484ca436ac68716636a7aca3826bca3cda243a4 (patch) | |
tree | f43e2b3693ef4597519bc11bf25f2d9e4510016f | |
parent | 437061996d8d25ba902903e15952cfc14257b839 (diff) | |
download | gdb-2484ca436ac68716636a7aca3826bca3cda243a4.zip gdb-2484ca436ac68716636a7aca3826bca3cda243a4.tar.gz gdb-2484ca436ac68716636a7aca3826bca3cda243a4.tar.bz2 |
libctf, open: drop unnecessary historical wart around forwards
When opening, we consider a forward with a kind above the maximum
allowable set of kinds and a forward of kind CTF_K_UNKNOWN to be a
forward to a struct. Whatever CTF version it was that produced
forwards with no associated kind, it predates anything we can read:
remove this wart.
libctf/
* ctf-open.c (init_types): Remove typeless CTF_K_FORWARD
special-casing.
-rw-r--r-- | libctf/ChangeLog | 5 | ||||
-rw-r--r-- | libctf/ctf-open.c | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 8dd6651..61aebd1 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,10 @@ 2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-open.c (init_types): Remove typeless CTF_K_FORWARD + special-casing. + +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-types.c (ctf_type_reference): Add support for dynamic slices. 2020-07-22 Nick Alcock <nick.alcock@oracle.com> diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c index 4daa1e4..05672f3 100644 --- a/libctf/ctf-open.c +++ b/libctf/ctf-open.c @@ -692,17 +692,11 @@ init_types (ctf_file_t *fp, ctf_header_t *cth) if (vbytes < 0) return ECTF_CORRUPT; + /* For forward declarations, ctt_type is the CTF_K_* kind for the tag, + so bump that population count too. */ if (kind == CTF_K_FORWARD) - { - /* For forward declarations, ctt_type is the CTF_K_* kind for the tag, - so bump that population count too. If ctt_type is unknown, treat - the tag as a struct. */ + pop[tp->ctt_type]++; - if (tp->ctt_type == CTF_K_UNKNOWN || tp->ctt_type >= CTF_K_MAX) - pop[CTF_K_STRUCT]++; - else - pop[tp->ctt_type]++; - } tp = (ctf_type_t *) ((uintptr_t) tp + increment + vbytes); pop[kind]++; } |