jcs's openbsd hax
openbsd

Print the size of more objects (basic types and enums) based on their ctt_size info. This helps to ensure that the reported sizes match. OK mpi@

claudio 4e6a2d21 76af8930

+7 -6
+7 -6
usr.bin/ctfdump/ctfdump.c
··· 1 - /* $OpenBSD: ctfdump.c,v 1.27 2022/08/14 15:01:18 millert Exp $ */ 1 + /* $OpenBSD: ctfdump.c,v 1.28 2024/02/22 13:21:03 claudio Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org> ··· 490 490 case CTF_K_INTEGER: 491 491 eob = *((uint32_t *)(p + toff)); 492 492 toff += sizeof(uint32_t); 493 - printf(" encoding=%s offset=%u bits=%u", 493 + printf(" encoding=%s offset=%u bits=%u (%llu bytes)", 494 494 ctf_enc2name(CTF_INT_ENCODING(eob)), CTF_INT_OFFSET(eob), 495 - CTF_INT_BITS(eob)); 495 + CTF_INT_BITS(eob), size); 496 496 break; 497 497 case CTF_K_FLOAT: 498 498 eob = *((uint32_t *)(p + toff)); 499 499 toff += sizeof(uint32_t); 500 - printf(" encoding=%s offset=%u bits=%u", 500 + printf(" encoding=%s offset=%u bits=%u (%llu bytes)", 501 501 ctf_fpenc2name(CTF_FP_ENCODING(eob)), CTF_FP_OFFSET(eob), 502 - CTF_FP_BITS(eob)); 502 + CTF_FP_BITS(eob), size); 503 503 break; 504 504 case CTF_K_ARRAY: 505 505 cta = (struct ctf_array *)(p + toff); ··· 563 563 } 564 564 break; 565 565 case CTF_K_ENUM: 566 - printf("\n"); 566 + printf(" (%llu bytes)\n", size); 567 + 567 568 for (i = 0; i < vlen; i++) { 568 569 struct ctf_enum *cte; 569 570