aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/tools/ctf
Commit message (Collapse)AuthorAgeFilesLines
* Increase ctfconvert buffer sizeLeandro Lupori2019-02-251-1/+1
| | | | | | | | Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D19353 Notes: svn path=/head/; revision=344534
* Process CUs with a language attribute of DW_LANG_Mips_Assembler.Mark Johnston2018-06-111-1/+2
| | | | | | | | | | | At the moment ctfconvert(1) does not do much with such CUs, but that may not be true in the future, and we run ctfconvert on several assembly files during the build. X-MFC with: r334883 Notes: svn path=/head/; revision=334961
* Don't process DWARF generated from non-C/C++ code.Mark Johnston2018-06-091-3/+22
| | | | | | | | | | | | ctfconvert(1) is not designed to handle DWARF generated from such code, and will generally fail in non-obvious ways. Use an explicit check to help catch such potential failures. Reported by: Johannes Lundberg <johalun0@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=334883
* ctf dwarf: don't report "no dwarf entry" as if it were an errorMatt Macy2018-05-191-3/+6
| | | | Notes: svn path=/head/; revision=333885
* ctfconvert: silence useless enum has too many values warningMatt Macy2018-05-191-2/+0
| | | | Notes: svn path=/head/; revision=333872
* ctfconvert: Fix minor memory leaks in STABS parserConrad Meyer2018-03-271-1/+5
| | | | | | | | | | | In an error case, free leaked objects. Does anything use STABS anymore? Probably not. Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331656
* ctfconvert/ctfmerge: Fix a memory leak enumerating DWARF filesConrad Meyer2018-03-261-0/+1
| | | | | | | | Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331600
* Revert r253678, r253661:Pedro F. Giffuni2016-12-034-55/+6
| | | | | | | | | | | | | | | | Fix a segfault in ctfmerge(1) due to a bug in GCC. The change was correct and the bug real, but upstream didn't adopt it and we want to remain in sync. When/if upstream does something about it we can bring their version. The bug in question was fixed in GCC 4.9 which is now the default in FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2 platforms also has a workaround so no end-user should be harmed by the revert. Notes: svn path=/head/; revision=309490
* Fix handling of forward enum declarations in the CTF tools.Mark Johnston2016-08-132-1/+7
| | | | | | | | Reported by: mmacy MFC after: 2 weeks Notes: svn path=/head/; revision=304055
* Remove a dead local variable, missed in r274565.Mark Johnston2016-01-141-2/+0
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=293861
* DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_countMark Johnston2015-10-241-0/+4
| | | | | | | | | | | attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that array type sizes are encoded correctly. PR: 203772 MFC after: 1 week Notes: svn path=/head/; revision=289866
* Re-apply r274569. It was reverted in r276848 since that appeared to fixMark Johnston2015-08-281-1/+1
| | | | | | | | | | | | | | | | | | some ctfmerge crashes that started to occur on i386 weeks after r274569 was committed. Some later investigation indicated that the crashes were caused by malformed CTF info that led to a stack overflow. The issue with CTF info in i386 kernels seems to have been resolved by r261246, which updated libdwarf and libelf. r274569 fixes a bug which caused duplicate types to appear in the kernel's CTF info. This duplication generally does not cause problems when using DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type definitions in a CTF container. MFC after: 2 weeks Notes: svn path=/head/; revision=287234
* Add a missing format string argument.Mark Johnston2015-03-151-1/+1
| | | | | | | | PR: 197391 MFC after: 3 days Notes: svn path=/head/; revision=280125
* MFV r279822:Mark Johnston2015-03-101-2/+0
| | | | | | | | | | | | | | This merge is effectively a no-op since parts of it are already present in FreeBSD, and the rest is incorrect since gelf_newehdr(3) and gelf_newphdr(3) return pointers on FreeBSD rather than integers. Illumos issue: 5589 improper use of NULL in tools/ctf MFC after: 3 days Notes: svn path=/head/; revision=279861
* Initial version of DTrace on ARM32.George V. Neville-Neil2015-02-101-2/+2
| | | | | | | | Submitted by: Howard Su based on work by Oleksandr Tymoshenko Reviewed by: ian, andrew, rpaulo, markj Notes: svn path=/head/; revision=278529
* Mechanically convert cddl sun #ifdef's to illumosSteven Hartland2015-01-178-20/+20
| | | | | | | | | | | | | | | Since the upstream for cddl code is now illumos not sun, mechanically convert all sun #ifdef's to illumos #ifdef's which have been used in all newer code for some time. Also do a manual pass to correct the use if #ifdef comments as per style(9) as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=277300
* Revert r274569. It seems to be causing a crash when merging CTF data forMark Johnston2015-01-081-1/+1
| | | | | | | | | recent i386 GENERIC kernels. Reported by: David Wolfskill Notes: svn path=/head/; revision=276848
* MFV r275536:Xin LI2014-12-061-4/+4
| | | | | | | | | | Illumos issue: 3363 Mark non-returning functions in ctftools MFC after: 2 weeks Notes: svn path=/head/; revision=275563
* Only compare visitation counters if they've both been set for the currentMark Johnston2014-11-161-1/+1
| | | | | | | | | | | type graph walk. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274569
* Remove an incorrect optimization. The type IDs of each member of a struct orMark Johnston2014-11-161-11/+3
| | | | | | | | | | | | union must be checked when determine whether two types are equivalent. This bug could cause ctfmerge(1) to incorrectly merge distinct types. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274565
* Fix a couple of bugs around the handling of structs and unions of size zero.Mark Johnston2014-11-161-2/+8
| | | | | | | | | | | | These would cause ctfconvert(1) to return an error when attempting to resolve valid C types. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274564
* Only declare `bysz' variable under little endian archs.Kai Wang2014-01-291-1/+4
| | | | Notes: svn path=/head/; revision=261259
* Simplify DWARF version check.Kai Wang2014-01-251-8/+2
| | | | | | | Submitted by: emaste Notes: svn path=/projects/elftoolchain/; revision=261154
* Let ctfconvert accept DWARF version 3 and 4.Kai Wang2014-01-221-3/+6
| | | | Notes: svn path=/projects/elftoolchain/; revision=261025
* Clang 3.4 will sometimes emit DIE for struct/union member beforeKai Wang2014-01-201-3/+21
| | | | | | | | | | | | | | | | | | emitting the DIE for the type of that member. ctfconvert can not handle this properly and will calculate a wrong member bit offset. Same struct/union type from different .o file will be treated as different types when their member bit offsets are different, and gets added/merged multiple times. This will in turn cause many other structs/pointers/typedefs that refer to the duplicated struct/union gets added/merged multiple times and eventually causes numerous duplicated CTF types in the kernel.debug file. The simple workaround here is to make use of DW_AT_byte_size attribute of the member DIE to calculate the bits occupied by the member's type, without actually resolving the type. Notes: svn path=/projects/elftoolchain/; revision=260897
* * Make die_mem_offset() be able to handle DW_AT_data_member_locationKai Wang2014-01-191-9/+57
| | | | | | | | | | attributes generated by Clang 3.4. * Document how different compilers generate DW_AT_data_member_location attributes differently. * Document the quirks about DW_FORM_data[48]. Notes: svn path=/projects/elftoolchain/; revision=260880
* We should not set the unnamed DIE's name to "__anon__" since that willKai Wang2014-01-171-1/+1
| | | | | | | | | | bring back a known issue with DTrace regarding type name comparison. Instead, we can set the name to an empty string. Pointed out by: avg Notes: svn path=/projects/elftoolchain/; revision=260809
* If function die_name() finds a DIE without a name, set its name toKai Wang2014-01-161-0/+2
| | | | | | | | | | | "__anon__". This hack is used to workaround a issue that compilers like GCC could generate DW_TAG_base_type DIE without a name. Note that we didn't need this before because the old libdwarf internally set all the unnamed DIE's name to "__anon__". Notes: svn path=/projects/elftoolchain/; revision=260797
* Convert ctfconvert to use the new libdwarf API.Kai Wang2014-01-161-30/+34
| | | | Notes: svn path=/projects/elftoolchain/; revision=260795
* Merge various CTF fixes from illumosPedro F. Giffuni2013-08-261-5/+65
| | | | | | | | | | | | | | | | | | 2942 CTF tools need to handle files which legitimately lack data 2978 ctfconvert still needs to ignore legitimately dataless files on SPARC Illumos Revisions: 13745:6b3106b4250f 13754:7231b684c18b Reference: https://www.illumos.org/issues/2942 https://www.illumos.org/issues/2978 MFC after: 3 weeks Notes: svn path=/head/; revision=254941
* Style issue in r253661.Pedro F. Giffuni2013-07-261-1/+1
| | | | | | | | Pointed out by: avg MFC after: 1 month Notes: svn path=/head/; revision=253678
* Fix a segfault in ctfmerge due to a bug in gcc.Pedro F. Giffuni2013-07-264-6/+55
| | | | | | | | | | | | | | | | GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF. The issue was originaly detected in NetBSD but it has been adapted for portability and to avoid compiler warnings. Reference: https://www.illumos.org/issues/3776 Obtained from: NetBSD MFC after: 1 month Notes: svn path=/head/; revision=253661
* Fix -Wmissing-variable-declarations compiler warnings.Ed Schouten2013-04-194-8/+8
| | | | | | | | References: https://www.illumos.org/issues/3700 Notes: svn path=/head/; revision=249656
* Follow up to r247960 and rr247960 by also amending ctfmerge. For theDimitry Andric2013-04-011-2/+5
| | | | | | | | | | | | | only other case where STT_FILE symbols are used, in symit_next() in cddl/contrib/opensolaris/tools/ctf/cvt/input.c, save the basename of the symbol, instead of the full pathname. Reported by: avg Tested by: avg, jimharris MFC after: 1 week Notes: svn path=/head/; revision=248991
* Fix error in r247960: actually assign the basename to match.iim_file.Dimitry Andric2013-03-071-2/+1
| | | | | | | | | | Pointed out by: avg Pointy hat to: dim MFC after: 1 week X-MFC-With: r247960 Notes: svn path=/head/; revision=247962
* Make ctfconvert work correctly on clang-compiled object files. ClangDimitry Andric2013-03-071-0/+3
| | | | | | | | | | | | | | | | puts the full original source filename in the STT_FILE entry of the ELF symbol table, while gcc saves only the basename. Since the DWARF DW_AT_name attribute contains the full source filename, both for clang and gcc, ctfconvert takes just the basename of it, for matching with the STT_FILE entry. So when attempting to match with such an entry, use its basename, if necessary. Reported by: avg MFC after: 1 week Notes: svn path=/head/; revision=247960
* Maintain target's byte order for multi-byte fields in CTF structures.Oleksandr Tymoshenko2012-03-244-3/+121
| | | | | | | | | | | | | | | | | | | | | | | CTF format is not cross-platform by design, e.g. it is not guaranteed that data generated by ctfconvert/ctfmerge on one architecture will be successfuly read on another. CTF structures are saved/restored using naive approach. Roughly it looks like: write(fd, &ctf_struct, sizeof(ctf_struct)) read(fd, &ctf_struct, sizeof(ctf_struct)) By sheer luck memory layout of all type-related CTF structures is the same on amd64/i386/mips32/mips64. It's different on ARM though. sparc, ia64, powerpc, and powerpc64 were not tested. So in order to get file compatible with dtrace on ARM it should be compiled on ARM. Alternative solution would be to have "signatures" for every platform and ctfmerge should convert host's reperesentation of CTF structure to target's one using "signature" as template. This patch checks byte order of ELF files used for generating CTF record and makes sure that byte order of data written to resulting files is the same as target's byte order. Notes: svn path=/head/; revision=233407
* In cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c, a size_t is passedDimitry Andric2011-12-161-1/+1
| | | | | | | | | to fprintf as a field width. It should be an int instead, so cast it. MFC after: 1 week Notes: svn path=/head/; revision=228597
* MFV OpenSolaris DTrace userland bits.Rui Paulo2010-08-025-31/+78
| | | | Notes: svn path=/head/; revision=210767
* Catch up with r210324. d_buf will be NULL for SHT_NOBITS sections, do notNavdeep Parhar2010-07-231-1/+1
| | | | | | | | | attempt to copy from it in that case. MFC after: 1 month Notes: svn path=/head/; revision=210438
* Do not encode more than CTF_MAX_VLEN(1023) enum members.Alexander Kabaev2010-05-031-1/+8
| | | | | | | | | | | | | | CTF can not represent enums with more than CTF_MAX_VLEN members, but ctfconvert will happily ignore that limitation and create CTF section no other tool can interpret. This change is different from similar change from upstream, which just returns an error if big enum is encountered. Doing that means that every FreeBSD kernel with compiled in hwpmc will have no useable CTF information due to pmc_event enum having 1236+ members. Notes: svn path=/head/; revision=207578
* A lot of changes to make this code compile cleanly on FreeBSD.John Birrell2008-04-2623-224/+342
| | | | Notes: svn path=/head/; revision=178546
* Use FreeBSD's libdwarf which is BSD licensed instead of the GPL'd one thatJohn Birrell2008-04-261-137/+105
| | | | | | | is used in Solaris. Notes: svn path=/head/; revision=178545
* We need to be consistent with prototype definitions. It isn't OK toJohn Birrell2008-04-261-8/+55
| | | | | | | | | | use 'const' and just override it whenever we feel like it. If we use it at all, then we need to do it properly. Add a couple of functions that were useful in getting this code ported. Notes: svn path=/head/; revision=178544
* Make this file compile cleanly.John Birrell2008-04-261-25/+25
| | | | Notes: svn path=/head/; revision=178542
* This commit was generated by cvs2svn to compensate for changes in r178528,John Birrell2008-04-2626-527/+394
| | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=178529
* This commit was generated by cvs2svn to compensate for changes in r178481,John Birrell2008-04-2540-0/+13733
which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=178482