summaryrefslogtreecommitdiff
path: root/usr.bin/ctfconv
AgeCommit message (Collapse)Author
2024-02-27Recent ctfconv refactoring broke support for long double types, asAnton Lindqvist
discovered by the regress tests.
2024-02-22Rewrite the it_cmp() function to use the common check bigger than, checkClaudio Jeker
smaller than logic. There was a bug in this code because of a badly placed ) which I only noticed after rewriting the function since I assumed that C integer promotion is playing tricks with us. OK mpi@
2024-02-22The ctt_size of integers and floating point numbers is in bytes not bits.Claudio Jeker
OK mpi@
2024-02-21In it_cmp() make sure that arrays are only considered equal if bothClaudio Jeker
have the same number of elements. This fixes an issue where arrays where too aggressivly merged and as a result the number of elements was mostly wrong in the CTF bits. Also it_cmp() should return 0 if both elements are considered equal. OK mpi@
2024-02-21Make DPRINTF() depend on DEBUG and add the missing ;Claudio Jeker
OK mpi@
2024-02-21Apply the void workaround also for typedefs.Claudio Jeker
The kernel has 'typedef VOID void' which needs this. OK mpi@
2024-02-21Handle DW_FORM_udata and DW_FORM_ref_udata in dav2val().Claudio Jeker
At least with clang enums use DW_FORM_udata and without this all enum values would be reported as -1. OK mpi@
2024-02-21Make sure dw_at2name() never returns NULL. This call is used in variousClaudio Jeker
printf calls that clang decided to optimise into puts calls that crash with a NULL argument. Also add DW_AT_noreturn which caused this when running ./ctfconv -d ./ctfconv OK mpi@
2023-04-19remove duplicate includesJonathan Gray
2022-12-26revert previous: just as i get to replying, i find sthen's note. this partJason McIntyre
of the diff is not for me.
2022-12-26emited -> emitted;Jason McIntyre
from paul tagliamonte
2022-10-02Remove unused DEBUG_LINE define.Martin Pieuchot
2022-08-14Use size_t, not off_t, for length parameters.Todd C. Miller
This matches how the functions are called and eliminates a few casts. OK tb@
2021-10-25Zap unused variables/functions under /usr/src/*bin/Klemens Nanni
OK deraadt
2021-07-12Change the error reporting pattern throughout the tree when unveilBob Beck
fails to report the path that the failure occured on. Suggested by deraadt@ after some tech discussion. Work done and verified by Ashton Fagg <ashton@fagg.id.au> ok deraadt@ semarie@ claudio@
2019-11-11Typo.Martin Pieuchot
From Mark Johnston, markj@FreeBSD
2019-11-07Don't stop parsing functions when variables are declared before arguments.Martin Pieuchot
Fix argument types of functions containing a static variable when compiled with clang(1).
2019-11-07Do a better job at guessing the name of localy defined static variables.Martin Pieuchot
Handle the "varname.id" schema used by gcc(1) and "funcname.varname" used by clang(1). Fix a shadowing issue with clang(1).
2019-11-07Stop remembering the type of local variables.Martin Pieuchot
Fix a shadowing issue reported by procter@.
2019-10-15Include the .SUNW_ctf section in bsd.gdbMartin Pieuchot
Once the section has been built from the DWARF symbols also add it to the debug kernel. That makes ddb(4) print the correct number of args in function backtraces in such kernel as well. While here make comment fit in 80 columns. ok jasper@
2019-05-27Use getopts instead of getopt(1)Jeremie Courreges-Anglas
getopts is a standard shell builtin (POSIX) and lets you handle whitespace in parameters. ok mpi@ sunil@
2019-02-18Using getopt(1) is more idiomatic and consistent with other scripts.Sunil Nimmagadda
Ok mpi@
2019-02-18Fix in-place stripping by using correct form of parameter substitution.Sunil Nimmagadda
Ok mpi@
2018-08-08add unveil(2) to ctfconv(1)Ricardo Mestre
Once we know what the input file is, usually /bsd.gdb, we can unveil it in read mode. If we also define as argument an output file we can additionally unveil that one with write/create permissions. We don't need to care about calling unveil(NULL, NULL) since we can call pledge(2) and reduce the permissions down the road depending on the code path. "reads OK" jasper@, "put it in if works" mpi@ prodded by deraadt@
2018-01-31Consider integer/float size during base type comparisons.Martin Pieuchot
Regression introduced when I added support for merging forward declarations with their corresponding types because they do not have a size.
2017-11-14Verify that every section header lies within the mapped file.Martin Pieuchot
Pointed out by Mark Johnston, Markj@FreeBSD
2017-11-06Use the symtab's sh_link to get the string table section.Martin Pieuchot
This is technically more correct than looking for ".strtab" and allows us to get rid of unportable ELF_STRTAB. We can also get rid of the hack for some incorrect ELF files since we no longer try to apply relocations for the string table. From Mark Johnston, markj@FreeBSD
2017-11-03Make dump_itype() dump enum members.Martin Pieuchot
From Mark Johnston, markj@FreeBSD
2017-11-03Fix a format string warning in dump_type().Martin Pieuchot
From Mark Johnston, markj@FreeBSD
2017-10-31Merge type forward declarations with real ones as soon as they are found.Martin Pieuchot
2017-10-28Document the use of a rbtree for resolving types inside a single CU.Martin Pieuchot
No functional changes.
2017-10-28Define nitems() locally and stop including <sys/param.h>Martin Pieuchot
2017-10-27Use <elf.h> rather than <sys/exec_elf.h>.Martin Pieuchot
The former is more portable.
2017-10-17add missing HISTORY; based on CVS logs and release announcementsIngo Schwarze
2017-09-30Add some more boundary checks and prevent an attempt to divide by zeroJonathan Gray
to resolve some additional crashes found by afl. ok mpi@ deraadt@
2017-09-29Check that the end of sections do not exceed the filesize for bothJonathan Gray
symtab and sections. Corrects behaviour that led to crashes found via afl. ok mpi@
2017-09-29Do not segfault when the string table is invalid or not present.Martin Pieuchot
Based on a diff from jsg@. Found independently by jsg@ with afl and markj@FreeBSD with a port.
2017-09-27Unserstand DW_OP_bregN locations.Martin Pieuchot
Sync with readdwarf(1).
2017-09-26Ignore file offset values in section headers that exceed the length ofJonathan Gray
the file. Avoids a crash found with afl. ok mpi@
2017-09-26Return the correct error value in generate().Martin Pieuchot
From Mark Johnston, markj@FreeBSD
2017-09-24Handle parse_base() returning NULL for DW_TAG_base_type to avoidJonathan Gray
attemping to insert a NULL iterator leading to a NULL deref crash. Found with afl. ok mpi@
2017-09-24Ignore DW_FORM_strp with size larger than elf section bufferJonathan Gray
fixes accessing memory out of bounds that led to a segfault. Found with afl. ok mpi@
2017-09-19fix fd leaks in error pathsJonathan Gray
ok mpi@
2017-09-04Fix typo in comment; ok mpi@anton
2017-08-29quarterly rescan of the tree: remove unneccessary sys/param.h, andTheo de Raadt
annotate the ones which are needed.
2017-08-28spelling/grammar fixes;Jason McIntyre
2017-08-15proper fix for previous and add missing quotesJasper Lievisse Adriaanse
from tb@ ok visa@ mpi@
2017-08-14simplify LABEL extraction; from tb@Jasper Lievisse Adriaanse
2017-08-13Fix arguments that are passed to strip(1). In particular,Visa Hankala
$INFILE should not appear twice. OK mpi@, jasper@
2017-08-12ouch - failed to spot typo in previous too, even though my spell checkerJason McIntyre
was doing one!