Index: head/devel/dwarves/Makefile =================================================================== --- head/devel/dwarves/Makefile (revision 418515) +++ head/devel/dwarves/Makefile (revision 418516) @@ -1,40 +1,40 @@ # Created by: Conrad Meyer # $FreeBSD$ PORTNAME= dwarves -PORTVERSION= 1.10 +PORTVERSION= 1.10.20160713 CATEGORIES= devel -MASTER_SITES= https://fedorapeople.org/~acme/dwarves/ -# http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.bz2 +#MASTER_SITES= https://fedorapeople.org/~acme/dwarves/ +MASTER_SITES= http://repo.or.cz/dwarves.git/snapshot/ +DISTFILES= b52386d041fac2dc6decf3a9e8e85385784a2de9.tar.gz # git: http://repo.or.cz/dwarves.git # ML: http://news.gmane.org/gmane.comp.debugging.dwarves MAINTAINER= cem@FreeBSD.org COMMENT= Debugging Information Manipulation Tools LICENSE= GPLv2 LICENSE_FILE_GPLv2= $(WRKSRC)/COPYING LIB_DEPENDS= libargp.so:devel/argp-standalone \ libdw.so:devel/elfutils BUILD_DEPENDS= cmake>=0:devel/cmake \ gnulib>=0:devel/gnulib -# Source is a tarbomb: -WRKSRC= $(WRKDIR) +WRKSRC= $(WRKDIR)/dwarves-b52386d USES= cmake:outsource localbase tar:bzip2 USE_LDCONFIG= yes -#CMAKE_VERBOSE= 1 +CMAKE_VERBOSE= 1 post-patch: @${CP} -a \ $(LOCALBASE)/share/gnulib/lib/gettext.h \ $(LOCALBASE)/share/gnulib/lib/obstack.c \ $(LOCALBASE)/share/gnulib/lib/obstack.h \ $(WRKSRC)/ @${REINPLACE_CMD} -e 's|_GL_ATTRIBUTE_PURE|__attribute__((__pure__))|g' \ $(WRKSRC)/obstack.h $(WRKSRC)/obstack.c .include Index: head/devel/dwarves/distinfo =================================================================== --- head/devel/dwarves/distinfo (revision 418515) +++ head/devel/dwarves/distinfo (revision 418516) @@ -1,3 +1,3 @@ -TIMESTAMP = 1468468005 -SHA256 (dwarves-1.10.tar.bz2) = 557306e1b58b475f689f44095ec62388877b1a8dd06174f97e309994c15bcc14 -SIZE (dwarves-1.10.tar.bz2) = 96919 +TIMESTAMP = 1468476328 +SHA256 (b52386d041fac2dc6decf3a9e8e85385784a2de9.tar.gz) = 7c86a956b273f26c2c3300db787de11a9e240b8e81a016cbb11e9c488e8fe248 +SIZE (b52386d041fac2dc6decf3a9e8e85385784a2de9.tar.gz) = 132977 Index: head/devel/dwarves/files/patch-CMakeLists.txt =================================================================== --- head/devel/dwarves/files/patch-CMakeLists.txt (revision 418515) +++ head/devel/dwarves/files/patch-CMakeLists.txt (revision 418516) @@ -1,66 +1,66 @@ ---- CMakeLists.txt.orig 2012-03-20 16:17:25 UTC +--- CMakeLists.txt.orig 2016-06-30 19:30:28 UTC +++ CMakeLists.txt @@ -31,11 +31,14 @@ add_definitions(-D_GNU_SOURCE -DDWARVES_ find_package(DWARF REQUIRED) find_package(ZLIB REQUIRED) -_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${__LIB}" "libdir") +# For argp-standalone +find_library(ARGP argp ${LOCALBASE}/lib) + +_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/lib${__LIB}" "libdir") set(dwarves_LIB_SRCS dwarves.c dwarves_fprintf.c gobuffer strings ctf_encoder.c ctf_loader.c libctf.c dwarf_loader.c - dutil.c elf_symtab.c rbtree.c) + dutil.c elf_symtab.c rbtree.c obstack.c) add_library(dwarves SHARED ${dwarves_LIB_SRCS}) set_target_properties(dwarves PROPERTIES VERSION 1.0.0 SOVERSION 1) - set_target_properties(dwarves PROPERTIES LINK_INTERFACE_LIBRARIES "") + set_target_properties(dwarves PROPERTIES INTERFACE_LINK_LIBRARIES "") @@ -53,11 +56,11 @@ target_link_libraries(dwarves_reorganize set(codiff_SRCS codiff.c) add_executable(codiff ${codiff_SRCS}) -target_link_libraries(codiff dwarves) +target_link_libraries(codiff dwarves ${ARGP}) set(ctracer_SRCS ctracer.c) add_executable(ctracer ${ctracer_SRCS}) -target_link_libraries(ctracer dwarves dwarves_emit dwarves_reorganize ${ELF_LIBRARY}) +target_link_libraries(ctracer dwarves dwarves_emit dwarves_reorganize ${ELF_LIBRARY} ${ARGP}) set(dtagnames_SRCS dtagnames.c) add_executable(dtagnames ${dtagnames_SRCS}) @@ -65,19 +68,19 @@ target_link_libraries(dtagnames dwarves) set(pahole_SRCS pahole.c) add_executable(pahole ${pahole_SRCS}) -target_link_libraries(pahole dwarves dwarves_reorganize) +target_link_libraries(pahole dwarves dwarves_reorganize ${ARGP}) set(pdwtags_SRCS pdwtags.c) add_executable(pdwtags ${pdwtags_SRCS}) -target_link_libraries(pdwtags dwarves) +target_link_libraries(pdwtags dwarves ${ARGP}) set(pglobal_SRCS pglobal.c) add_executable(pglobal ${pglobal_SRCS}) -target_link_libraries(pglobal dwarves) +target_link_libraries(pglobal dwarves ${ARGP}) set(pfunct_SRCS pfunct.c ) add_executable(pfunct ${pfunct_SRCS}) -target_link_libraries(pfunct dwarves dwarves_emit ${ELF_LIBRARY}) +target_link_libraries(pfunct dwarves dwarves_emit ${ELF_LIBRARY} ${ARGP}) set(prefcnt_SRCS prefcnt.c) add_executable(prefcnt ${prefcnt_SRCS}) @@ -89,7 +92,7 @@ target_link_libraries(scncopy dwarves ${ set(syscse_SRCS syscse.c) add_executable(syscse ${syscse_SRCS}) -target_link_libraries(syscse dwarves) +target_link_libraries(syscse dwarves ${ARGP}) install(TARGETS codiff ctracer dtagnames pahole pdwtags pfunct pglobal prefcnt scncopy syscse RUNTIME DESTINATION Index: head/devel/dwarves/files/patch-ctf__loader.c =================================================================== --- head/devel/dwarves/files/patch-ctf__loader.c (revision 418515) +++ head/devel/dwarves/files/patch-ctf__loader.c (revision 418516) @@ -1,10 +1,10 @@ ---- ctf_loader.c.orig 2012-03-20 16:17:25 UTC +--- ctf_loader.c.orig 2016-06-30 19:30:28 UTC +++ ctf_loader.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include Index: head/devel/dwarves/files/patch-dtagnames.c =================================================================== --- head/devel/dwarves/files/patch-dtagnames.c (revision 418515) +++ head/devel/dwarves/files/patch-dtagnames.c (revision 418516) @@ -1,37 +1,37 @@ ---- dtagnames.c.orig 2012-03-20 16:17:25 UTC +--- dtagnames.c.orig 2016-06-30 19:30:28 UTC +++ dtagnames.c @@ -9,16 +9,33 @@ #include #include -#include + +/* For mallctl */ +#include +#include +#include #include "dwarves.h" #include "dutil.h" static void print_malloc_stats(void) { +#if 0 struct mallinfo m = mallinfo(); fprintf(stderr, "size: %u\n", m.uordblks); +#else + size_t allocated, olen; + int rc; + + olen = sizeof(allocated); + rc = mallctl("stats.allocated", &allocated, &olen, NULL, 0); + if (rc != 0) { + errno = rc; + err(1, "mallctl stats.allocated"); + } + fprintf(stderr, "size: %zu\n", allocated); +#endif } - static int class__tag_name(struct tag *self, struct cu *cu __unused, + static int class__tag_name(struct tag *tag, struct cu *cu __unused, Index: head/devel/dwarves/files/patch-dutil.h =================================================================== --- head/devel/dwarves/files/patch-dutil.h (revision 418515) +++ head/devel/dwarves/files/patch-dutil.h (revision 418516) @@ -1,12 +1,30 @@ ---- dutil.h.orig 2012-03-20 16:17:25 UTC +--- dutil.h.orig 2016-06-30 19:30:28 UTC +++ dutil.h -@@ -25,7 +25,9 @@ +@@ -15,7 +15,17 @@ + #include + #include + #include ++#if 0 + #include ++#else ++# if defined(__LP64__) ++# define __BITS_PER_LONG 64 ++# elif defined(__ILP32__) ++# define __BITS_PER_LONG 32 ++# else ++# error What are you ++# endif /* __LP64__ */ ++#endif + #include "rbtree.h" + + #define BITS_PER_LONG __BITS_PER_LONG +@@ -28,7 +38,9 @@ #define __pure __attribute__ ((pure)) #endif +#ifndef roundup #define roundup(x,y) ((((x) + ((y) - 1)) / (y)) * (y)) +#endif static inline __attribute__((const)) bool is_power_of_2(unsigned long n) { Index: head/devel/dwarves/files/patch-dwarves.c =================================================================== --- head/devel/dwarves/files/patch-dwarves.c (revision 418515) +++ head/devel/dwarves/files/patch-dwarves.c (revision 418516) @@ -1,11 +1,11 @@ ---- dwarves.c.orig 2012-03-20 16:17:25 UTC +--- dwarves.c.orig 2016-06-30 19:30:28 UTC +++ dwarves.c @@ -16,6 +16,8 @@ #include #include #include +/* For PATH_MAX */ +#include #include #include #include Index: head/devel/dwarves/files/patch-dwarves__fprintf.c =================================================================== --- head/devel/dwarves/files/patch-dwarves__fprintf.c (revision 418515) +++ head/devel/dwarves/files/patch-dwarves__fprintf.c (revision 418516) @@ -1,35 +1,27 @@ ---- dwarves_fprintf.c.orig 2012-03-20 16:18:48 UTC +--- dwarves_fprintf.c.orig 2016-06-30 19:30:28 UTC +++ dwarves_fprintf.c @@ -9,6 +9,9 @@ published by the Free Software Foundation. */ +/* For CACHE_LINE_SIZE */ +#include + #include #include #include -@@ -74,7 +77,6 @@ static const char *dwarf_tag_names[] = { - [DW_TAG_unspecified_type] = "unspecified_type", - [DW_TAG_partial_unit] = "partial_unit", - [DW_TAG_imported_unit] = "imported_unit", -- [DW_TAG_mutable_type] = "mutable_type", - [DW_TAG_condition] = "condition", - [DW_TAG_shared_type] = "shared_type", - #ifdef STB_GNU_UNIQUE -@@ -1664,7 +1666,14 @@ void cus__print_error_msg(const char *pr +@@ -1699,7 +1702,14 @@ void cus__print_error_msg(const char *pr void dwarves__fprintf_init(uint16_t user_cacheline_size) { if (user_cacheline_size == 0) { +#if 0 long sys_cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); +#else + /* + * CEM: Ideally we could get this programmatically. + */ + long sys_cacheline_size = CACHE_LINE_SIZE; +#endif if (sys_cacheline_size > 0) cacheline_size = sys_cacheline_size; Index: head/devel/dwarves/files/patch-elf__symtab.c =================================================================== --- head/devel/dwarves/files/patch-elf__symtab.c (revision 418515) +++ head/devel/dwarves/files/patch-elf__symtab.c (revision 418516) @@ -1,12 +1,12 @@ ---- elf_symtab.c.orig 2012-03-20 16:17:25 UTC +--- elf_symtab.c.orig 2016-06-30 19:30:28 UTC +++ elf_symtab.c @@ -7,8 +7,8 @@ published by the Free Software Foundation. */ -#include #include +#include #include #include "dutil.h" Index: head/devel/dwarves/files/patch-exitfail.h =================================================================== --- head/devel/dwarves/files/patch-exitfail.h (revision 418515) +++ head/devel/dwarves/files/patch-exitfail.h (revision 418516) @@ -1,5 +1,5 @@ ---- exitfail.h.orig 2016-07-14 04:42:52 UTC +--- exitfail.h.orig 2016-07-14 06:29:38 UTC +++ exitfail.h @@ -0,0 +1,2 @@ +#pragma once +#define exit_failure EXIT_FAILURE Index: head/devel/dwarves/files/patch-libctf.c =================================================================== --- head/devel/dwarves/files/patch-libctf.c (revision 418515) +++ head/devel/dwarves/files/patch-libctf.c (revision 418516) @@ -1,12 +1,12 @@ ---- libctf.c.orig 2012-03-20 16:17:25 UTC +--- libctf.c.orig 2016-06-30 19:30:28 UTC +++ libctf.c @@ -1,7 +1,8 @@ +#include + #include #include #include -#include #include #include #include Index: head/devel/dwarves/files/patch-pdwtags.c =================================================================== --- head/devel/dwarves/files/patch-pdwtags.c (revision 418515) +++ head/devel/dwarves/files/patch-pdwtags.c (revision 418516) @@ -1,10 +1,10 @@ ---- pdwtags.c.orig 2012-05-14 22:41:11 UTC +--- pdwtags.c.orig 2016-06-30 19:30:28 UTC +++ pdwtags.c @@ -9,7 +9,6 @@ #include #include #include -#include #include "dwarves.h" #include "dutil.h" Index: head/devel/dwarves/files/patch-pglobal.c =================================================================== --- head/devel/dwarves/files/patch-pglobal.c (revision 418515) +++ head/devel/dwarves/files/patch-pglobal.c (revision 418516) @@ -1,38 +1,38 @@ ---- pglobal.c.orig 2012-03-20 16:17:25 UTC +--- pglobal.c.orig 2016-06-30 19:30:28 UTC +++ pglobal.c @@ -8,7 +8,6 @@ */ #include -#include #include #include #include @@ -92,7 +91,7 @@ static void extvar__add(const struct var nodep = tsearch(gvar, &tree, extvar__compare); if (nodep == NULL) oom("tsearch"); - else if (*nodep != gvar) + else if (*nodep != gvar) { if (gvar->var->declaration) { gvar->next = (*nodep)->next; (*nodep)->next = gvar; @@ -100,6 +99,7 @@ static void extvar__add(const struct var gvar->next = *nodep; *nodep = gvar; } + } } } -@@ -313,7 +313,10 @@ int main(int argc, char *argv[]) +@@ -315,7 +315,10 @@ int main(int argc, char *argv[]) twalk(tree, function_action__walk); } +#if 0 + /* Our search.h doesn't implement tdestroy; leak for now. */ tdestroy(tree, free_node); +#endif rc = EXIT_SUCCESS; out_cus_delete: cus__delete(cus); Index: head/devel/dwarves/files/patch-prefcnt.c =================================================================== --- head/devel/dwarves/files/patch-prefcnt.c (revision 418515) +++ head/devel/dwarves/files/patch-prefcnt.c (revision 418516) @@ -1,16 +1,16 @@ ---- prefcnt.c.orig 2012-03-20 16:17:25 UTC +--- prefcnt.c.orig 2016-06-30 19:30:28 UTC +++ prefcnt.c @@ -66,9 +66,11 @@ static void refcnt_tag(struct tag *tag, tag->visited = 1; - if (tag__is_struct(tag) || tag__is_union(tag)) - type__for_each_member(tag__type(tag), member) + if (tag__is_struct(tag) || tag__is_union(tag)) { + type__for_each_member(tag__type(tag), member) { refcnt_member(member, cu); + } + } } static void refcnt_lexblock(const struct lexblock *lexblock, const struct cu *cu) Index: head/devel/dwarves/files/patch-strings.c =================================================================== --- head/devel/dwarves/files/patch-strings.c (revision 418515) +++ head/devel/dwarves/files/patch-strings.c (revision 418516) @@ -1,13 +1,13 @@ ---- strings.c.orig 2012-03-20 16:17:25 UTC +--- strings.c.orig 2016-06-30 19:30:28 UTC +++ strings.c -@@ -39,7 +39,10 @@ void strings__delete(struct strings *sel +@@ -39,7 +39,10 @@ void strings__delete(struct strings *str { - if (self == NULL) + if (strs == NULL) return; +#if 0 + /* Our search.h doesn't implement tdestroy; leak for now. */ - tdestroy(self->tree, do_nothing); + tdestroy(strs->tree, do_nothing); +#endif - __gobuffer__delete(&self->gb); - free(self); + __gobuffer__delete(&strs->gb); + free(strs); }