[14/22] libctf: fix tiny dumping error

Message ID 20240417202018.34966-15-nick.alcock@oracle.com
State New
Headers
Series more modifiable CTF dicts (and a few bugfixes) |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Nick Alcock April 17, 2024, 8:20 p.m. UTC
  Without this, you might get things like this in the output:

    Flags: 0xa (CTF_F_NEWFUNCINFO, , CTF_F_DYNSTR)

Note the spurious comma.

libctf/
	* ctf-dump.c (ctf_dump_header): Fix comma emission.
---
 libctf/ctf-dump.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c
index 474c4e00cea..2213d09dc29 100644
--- a/libctf/ctf-dump.c
+++ b/libctf/ctf-dump.c
@@ -333,13 +333,12 @@  ctf_dump_header (ctf_dict_t *fp, ctf_dump_state_t *state)
 		    ? ", " : "",
 		    fp->ctf_openflags & CTF_F_NEWFUNCINFO
 		    ? "CTF_F_NEWFUNCINFO" : "",
-		    (fp->ctf_openflags & (CTF_F_COMPRESS | CTF_F_NEWFUNCINFO))
+		    (fp->ctf_openflags & (CTF_F_NEWFUNCINFO))
 		    && (fp->ctf_openflags & ~(CTF_F_COMPRESS | CTF_F_NEWFUNCINFO))
 		    ? ", " : "",
 		    fp->ctf_openflags & CTF_F_IDXSORTED
 		    ? "CTF_F_IDXSORTED" : "",
-		    fp->ctf_openflags & (CTF_F_COMPRESS | CTF_F_NEWFUNCINFO
-					 | CTF_F_IDXSORTED)
+		    fp->ctf_openflags & (CTF_F_IDXSORTED)
 		    && (fp->ctf_openflags & ~(CTF_F_COMPRESS | CTF_F_NEWFUNCINFO
 					      | CTF_F_IDXSORTED))
 		    ? ", " : "",