aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2024-07-15 19:39:48 +0100
committerNick Alcock <nick.alcock@oracle.com>2024-07-29 18:09:35 +0100
commit62e3464960dcb0b2a63785d1971856d6aa463e95 (patch)
tree3d06d7f21c39470deba7aeda3abed13ede0d796f
parentb6c06578e8a8dbe15b086c3b573f0001082524bc (diff)
downloadgdb-62e3464960dcb0b2a63785d1971856d6aa463e95.zip
gdb-62e3464960dcb0b2a63785d1971856d6aa463e95.tar.gz
gdb-62e3464960dcb0b2a63785d1971856d6aa463e95.tar.bz2
libctf, dump: correctly dump non-root-visible types
The flag test when dumping non-root-visible tyeps was doubly wrong: the flags word is a *bitfield* containing CTF_ADD_ROOT as one possible value, so needs | and & testing, not just ==, and CTF_ADD_NONROOT is 0, so cannot be tested for this way: one must check for the non-presence of CTF_ADD_ROOT. libctf/ * ctf-dump.c (ctf_dump_format_type): Fix non-root flag test.
-rw-r--r--libctf/ctf-dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c
index 80a3b26..cd41996 100644
--- a/libctf/ctf-dump.c
+++ b/libctf/ctf-dump.c
@@ -106,7 +106,7 @@ ctf_dump_format_type (ctf_dict_t *fp, ctf_id_t id, int flag)
const char *idstr = "";
id = new_id;
- if (flag == CTF_ADD_NONROOT)
+ if (!(flag & CTF_ADD_ROOT))
{
nonroot_leader = "{";
nonroot_trailer = "}";