diff --git a/.gitignore b/.gitignore index a00336e..5ee4a67 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /valgrind-3.7.0.tar.bz2 +/valgrind-3.8.0-TEST1.tar.bz2 diff --git a/sources b/sources index 518c77d..fc41671 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a855fda56edf05614f099dca316d1775 valgrind-3.7.0.tar.bz2 +7f757e3e8fc47c5ea2766385bfacdf7e valgrind-3.8.0-TEST1.tar.bz2 diff --git a/valgrind-3.7.0-cachegrind-improvements.patch b/valgrind-3.7.0-cachegrind-improvements.patch deleted file mode 100644 index 71b73d0..0000000 --- a/valgrind-3.7.0-cachegrind-improvements.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- valgrind-3.7.0/cachegrind/cg_sim.c.jj 2011-10-26 23:24:32.000000000 +0200 -+++ valgrind-3.7.0/cachegrind/cg_sim.c 2011-12-09 17:31:19.256023683 +0100 -@@ -42,27 +42,30 @@ typedef struct { - Int size; /* bytes */ - Int assoc; - Int line_size; /* bytes */ -- Int sets; - Int sets_min_1; - Int line_size_bits; - Int tag_shift; -- Char desc_line[128]; - UWord* tags; --} cache_t2; -+ Char desc_line[128]; -+} cache_t2 -+#ifdef __GNUC__ -+__attribute__ ((aligned (8 * sizeof (Int)))) -+#endif -+; - - /* By this point, the size/assoc/line_size has been checked. */ - static void cachesim_initcache(cache_t config, cache_t2* c) - { -- Int i; -+ Int sets; - - c->size = config.size; - c->assoc = config.assoc; - c->line_size = config.line_size; - -- c->sets = (c->size / c->line_size) / c->assoc; -- c->sets_min_1 = c->sets - 1; -+ sets = (c->size / c->line_size) / c->assoc; -+ c->sets_min_1 = sets - 1; - c->line_size_bits = VG_(log2)(c->line_size); -- c->tag_shift = c->line_size_bits + VG_(log2)(c->sets); -+ c->tag_shift = c->line_size_bits + VG_(log2)(sets); - - if (c->assoc == 1) { - VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped", -@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c - c->size, c->line_size, c->assoc); - } - -- c->tags = VG_(malloc)("cg.sim.ci.1", -- sizeof(UWord) * c->sets * c->assoc); -- -- for (i = 0; i < c->sets * c->assoc; i++) -- c->tags[i] = 0; -+ c->tags = VG_(calloc)("cg.sim.ci.1", -+ sizeof(UWord), sets * c->assoc); - } - - /* This is done as a macro rather than by passing in the cache_t2 as an diff --git a/valgrind-3.7.0-capget.patch b/valgrind-3.7.0-capget.patch deleted file mode 100644 index 727defa..0000000 --- a/valgrind-3.7.0-capget.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2010-04-07 08:14:12.000000000 -0400 -+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2010-04-12 07:24:12.838876000 -0400 -@@ -1955,8 +1955,9 @@ PRE(sys_capget) - vki_cap_user_header_t, header, vki_cap_user_data_t, data); - PRE_MEM_READ( "capget(header)", ARG1, - sizeof(struct __vki_user_cap_header_struct) ); -- PRE_MEM_WRITE( "capget(data)", ARG2, -- sizeof(struct __vki_user_cap_data_struct) ); -+ if (ARG2 != (Addr)NULL) -+ PRE_MEM_WRITE( "capget(data)", ARG2, -+ sizeof(struct __vki_user_cap_data_struct) ); - } - POST(sys_capget) - { diff --git a/valgrind-3.7.0-config_h.patch b/valgrind-3.7.0-config_h.patch deleted file mode 100644 index 3833da3..0000000 --- a/valgrind-3.7.0-config_h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- valgrind/include/pub_tool_basics.h.jj 2011-10-26 23:24:32.000000000 +0200 -+++ valgrind/include/pub_tool_basics.h 2011-12-09 17:42:50.828630546 +0100 -@@ -290,7 +290,7 @@ static inline Bool sr_EQ ( SysRes sr1, S - #define VG_BUGS_TO "www.valgrind.org" - - /* Branch prediction hints. */ --#if defined(__GNUC__) -+#if defined(__GNUC__) && (__GNUC__ >= 3) - # define LIKELY(x) __builtin_expect(!!(x), 1) - # define UNLIKELY(x) __builtin_expect(!!(x), 0) - #else diff --git a/valgrind-3.7.0-debug-leak2.patch b/valgrind-3.7.0-debug-leak2.patch deleted file mode 100644 index 3ab3090..0000000 --- a/valgrind-3.7.0-debug-leak2.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12418) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12419) -@@ -3644,9 +3644,6 @@ void new_dwarf3_reader_wrk ( - cu_amount_used = cu_offset_now - cc.cu_start_offset; - } - -- if (cu_offset_now == debug_info_sz) -- break; -- - /* Preen to level -2. DIEs have level >= 0 so -2 cannot occur - anywhere else at all. Our fake the-entire-address-space - range is at level -1, so preening to -2 should completely -@@ -3655,6 +3652,9 @@ void new_dwarf3_reader_wrk ( - varstack_preen( &varparser, td3, -2 ); - /* Similarly, empty the type stack out. */ - typestack_preen( &typarser, td3, -2 ); -+ -+ if (cu_offset_now == debug_info_sz) -+ break; - /* else keep going */ - - TRACE_D3("set_abbv_Cursor cache: %lu queries, %lu misses\n", diff --git a/valgrind-3.7.0-debug-types.patch b/valgrind-3.7.0-debug-types.patch deleted file mode 100644 index c345a0d..0000000 --- a/valgrind-3.7.0-debug-types.patch +++ /dev/null @@ -1,1209 +0,0 @@ ---- valgrind-3.7.0/memcheck/tests/Makefile.am (revision 12490) -+++ valgrind-3.7.0/memcheck/tests/Makefile.am (revision 12491) -@@ -76,6 +76,7 @@ EXTRA_DIST = \ - deep_templates.stdout.exp deep_templates.stderr.exp \ - describe-block.stderr.exp describe-block.vgtest \ - doublefree.stderr.exp doublefree.vgtest \ -+ dw4.vgtest dw4.stderr.exp dw4.stdout.exp \ - err_disable1.vgtest err_disable1.stderr.exp \ - err_disable2.vgtest err_disable2.stderr.exp \ - err_disable3.vgtest err_disable3.stderr.exp \ -@@ -281,6 +282,9 @@ check_PROGRAMS = \ - wrap1 wrap2 wrap3 wrap4 wrap5 wrap6 wrap7 wrap7so.so wrap8 \ - writev1 - -+if DWARF4 -+check_PROGRAMS += dw4 -+endif - - AM_CFLAGS += $(AM_FLAG_M3264_PRI) - AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) -@@ -299,6 +303,8 @@ endif - deep_templates_SOURCES = deep_templates.cpp - deep_templates_CXXFLAGS = $(AM_CFLAGS) -O -gstabs - -+dw4_CFLAGS = $(AM_CFLAGS) -gdwarf-4 -fdebug-types-section -+ - err_disable3_LDADD = -lpthread - err_disable4_LDADD = -lpthread - ---- valgrind-3.7.0/memcheck/tests/dw4.c (revision 0) -+++ valgrind-3.7.0/memcheck/tests/dw4.c (revision 12491) -@@ -0,0 +1,54 @@ -+ -+/* Check of variable location identification when using .debug_types. */ -+ -+/* Relevant compile flags are: -+ -+ -Wall -g -I$prefix/include/valgrind -gdwarf-4 -fdebug-types-section -+ -+ eg -Wall -g -I`pwd`/Inst/include/valgrind -gdwarf-4 -fdebug-types-section -+*/ -+ -+#include -+#include -+#include -+#include "memcheck/memcheck.h" -+ -+/* Cause memcheck to complain about the address "a" and so to print -+ its best guess as to what "a" actually is. a must be -+ addressible. */ -+ -+void croak ( void* aV ) -+{ -+ char* a = (char*)aV; -+ char* undefp = malloc(1); -+ char saved = *a; -+ assert(undefp); -+ *a = *undefp; -+ VALGRIND_CHECK_MEM_IS_DEFINED(a, 1); -+ *a = saved; -+ free(undefp); -+} -+ -+struct s1 -+{ -+ char c; -+ short s; -+ int i; -+ long l; -+ float f; -+ double d; -+}; -+ -+struct s1 S2[30]; -+ -+int main ( void ) -+{ -+ struct s1 local; -+ struct s1* onheap = malloc(sizeof (struct s1)); -+ assert(onheap); -+ croak(&onheap->i); -+ -+ croak( &S2[0].i ); -+ croak( &local.i ); -+ return 0; -+} ---- valgrind-3.7.0/memcheck/tests/dw4.stderr.exp (revision 0) -+++ valgrind-3.7.0/memcheck/tests/dw4.stderr.exp (revision 12491) -@@ -0,0 +1,19 @@ -+Uninitialised byte(s) found during client check request -+ at 0x........: croak (dw4.c:27) -+ by 0x........: main (dw4.c:49) -+ Address 0x........ is 4 bytes inside a block of size 32 alloc'd -+ at 0x........: malloc (vg_replace_malloc.c:...) -+ by 0x........: main (dw4.c:47) -+ -+Uninitialised byte(s) found during client check request -+ at 0x........: croak (dw4.c:27) -+ by 0x........: main (dw4.c:51) -+ Location 0x........ is 0 bytes inside S2[0].i, -+ a global variable declared at dw4.c:42 -+ -+Uninitialised byte(s) found during client check request -+ at 0x........: croak (dw4.c:27) -+ by 0x........: main (dw4.c:52) -+ Location 0x........ is 0 bytes inside local.i, -+ declared at dw4.c:46, in frame #1 of thread 1 -+ ---- valgrind-3.7.0/memcheck/tests/dw4.vgtest (revision 0) -+++ valgrind-3.7.0/memcheck/tests/dw4.vgtest (revision 12491) -@@ -0,0 +1,2 @@ -+prog: dw4 -+vgopts: --read-var-info=yes -q ---- valgrind-3.7.0/configure.in (revision 12490) -+++ valgrind-3.7.0/configure.in (revision 12491) -@@ -1453,6 +1453,26 @@ AC_MSG_RESULT([no]) - CFLAGS=$safe_CFLAGS - - -+# does this compiler support -gdwarf-4 -fdebug-types-section ? -+ -+AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section]) -+ -+safe_CFLAGS=$CFLAGS -+CFLAGS="-gdwarf-4 -fdebug-types-section" -+ -+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ -+ return 0; -+]])], [ -+ac_have_dwarf4=yes -+AC_MSG_RESULT([yes]) -+], [ -+ac_have_dwarf4=no -+AC_MSG_RESULT([no]) -+]) -+AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes) -+CFLAGS=$safe_CFLAGS -+ -+ - # does the linker support -Wl,--build-id=none ? Note, it's - # important that we test indirectly via whichever C compiler - # is selected, rather than testing /usr/bin/ld or whatever ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf.c (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf.c (revision 12491) -@@ -1166,6 +1166,7 @@ void read_unitinfo_dwarf2( /*OUT*/UnitIn - void ML_(read_debuginfo_dwarf3) - ( struct _DebugInfo* di, - UChar* debug_info_img, Word debug_info_sz, /* .debug_info */ -+ UChar* debug_types_img, Word debug_types_sz, /* .debug_types */ - UChar* debug_abbv_img, Word debug_abbv_sz, /* .debug_abbrev */ - UChar* debug_line_img, Word debug_line_sz, /* .debug_line */ - UChar* debug_str_img, Word debug_str_sz ) /* .debug_str */ ---- valgrind-3.7.0/coregrind/m_debuginfo/readelf.c (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readelf.c (revision 12491) -@@ -2072,6 +2072,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - UChar* stabstr_img = NULL; /* .stabstr (stabs) */ - UChar* debug_line_img = NULL; /* .debug_line (dwarf2) */ - UChar* debug_info_img = NULL; /* .debug_info (dwarf2) */ -+ UChar* debug_types_img = NULL; /* .debug_types (dwarf4) */ - UChar* debug_abbv_img = NULL; /* .debug_abbrev (dwarf2) */ - UChar* debug_str_img = NULL; /* .debug_str (dwarf2) */ - UChar* debug_ranges_img = NULL; /* .debug_ranges (dwarf2) */ -@@ -2093,6 +2094,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - SizeT stabstr_sz = 0; - SizeT debug_line_sz = 0; - SizeT debug_info_sz = 0; -+ SizeT debug_types_sz = 0; - SizeT debug_abbv_sz = 0; - SizeT debug_str_sz = 0; - SizeT debug_ranges_sz = 0; -@@ -2168,6 +2170,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - - FIND(".debug_line", debug_line_sz, debug_line_img) - FIND(".debug_info", debug_info_sz, debug_info_img) -+ FIND(".debug_types", debug_types_sz, debug_types_img) - FIND(".debug_abbrev", debug_abbv_sz, debug_abbv_img) - FIND(".debug_str", debug_str_sz, debug_str_img) - FIND(".debug_ranges", debug_ranges_sz, debug_ranges_img) -@@ -2425,6 +2428,8 @@ Bool ML_(read_elf_debug_info) ( struct _ - FIND(need_stabs, ".stabstr", stabstr_sz, stabstr_img) - FIND(need_dwarf2, ".debug_line", debug_line_sz, debug_line_img) - FIND(need_dwarf2, ".debug_info", debug_info_sz, debug_info_img) -+ FIND(need_dwarf2, ".debug_types", debug_types_sz, -+ debug_types_img) - FIND(need_dwarf2, ".debug_abbrev", debug_abbv_sz, debug_abbv_img) - FIND(need_dwarf2, ".debug_str", debug_str_sz, debug_str_img) - FIND(need_dwarf2, ".debug_ranges", debug_ranges_sz, -@@ -2516,6 +2521,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - /* The old reader: line numbers and unwind info only */ - ML_(read_debuginfo_dwarf3) ( di, - debug_info_img, debug_info_sz, -+ debug_types_img, debug_types_sz, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz ); -@@ -2528,6 +2534,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - || VG_(clo_read_var_info) /* the user asked for it */) { - ML_(new_dwarf3_reader)( - di, debug_info_img, debug_info_sz, -+ debug_types_img, debug_types_sz, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz, ---- valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf.h (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf.h (revision 12491) -@@ -45,6 +45,7 @@ extern - void ML_(read_debuginfo_dwarf3) - ( struct _DebugInfo* di, - UChar* debug_info_img, Word debug_info_sz, /* .debug_info */ -+ UChar* debug_types_img, Word debug_types_sz, /* .debug_types */ - UChar* debug_abbv_img, Word debug_abbv_sz, /* .debug_abbrev */ - UChar* debug_line_img, Word debug_line_sz, /* .debug_line */ - UChar* debug_str_img, Word debug_str_sz ); /* .debug_str */ ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12491) -@@ -140,6 +140,8 @@ - #include "pub_core_libcassert.h" - #include "pub_core_libcprint.h" - #include "pub_core_libcsetjmp.h" // setjmp facilities -+#include "pub_core_hashtable.h" -+#include "pub_core_mallocfree.h" - #include "pub_core_options.h" - #include "pub_core_tooliface.h" /* VG_(needs) */ - #include "pub_core_xarray.h" -@@ -415,6 +416,9 @@ typedef - /* Where is .debug_info? */ - UChar* debug_info_img; - UWord debug_info_sz; -+ /* Where is .debug_types? */ -+ UChar* debug_types_img; -+ UWord debug_types_sz; - /* --- Needed so we can add stuff to the string table. --- */ - struct _DebugInfo* di; - /* --- a cache for set_abbv_Cursor --- */ -@@ -422,10 +426,57 @@ typedef - struct { ULong abbv_code; UWord posn; } saC_cache[N_ABBV_CACHE]; - UWord saC_cache_queries; - UWord saC_cache_misses; -+ -+ /* True if this came from .debug_types; otherwise it came from -+ .debug_info. */ -+ Bool is_type_unit; -+ /* For a unit coming from .debug_types, these hold the TU's type -+ signature and the uncooked DIE offset of the TU's signatured -+ type. For a unit coming from .debug_info, these are unused. */ -+ ULong type_signature; -+ ULong type_offset; -+ -+ /* Signatured type hash; computed once and then shared by all -+ CUs. */ -+ VgHashTable signature_types; - } - CUConst; - - -+/* Return the cooked value of DIE depending on whether CC represents a -+ .debug_types unit. To cook a DIE, we pretend that the .debug_info -+ and .debug_types sections form a contiguous whole, so that DIEs -+ coming from .debug_types are numbered starting at the end of -+ .debug_info. */ -+static UWord cook_die( CUConst* cc, UWord die ) -+{ -+ if (cc->is_type_unit) -+ die += cc->debug_info_sz; -+ return die; -+} -+ -+/* Like cook_die, but understand that DIEs coming from a -+ DW_FORM_ref_sig8 reference are already cooked. */ -+static UWord cook_die_using_form( CUConst *cc, UWord die, DW_FORM form) -+{ -+ if (form == DW_FORM_ref_sig8) -+ return die; -+ return cook_die( cc, die ); -+} -+ -+/* Return the uncooked offset of DIE and set *FLAG to true if the DIE -+ came from the .debug_types section. */ -+static UWord uncook_die( CUConst *cc, UWord die, /*OUT*/Bool *flag ) -+{ -+ if (die >= cc->debug_info_sz) { -+ *flag = True; -+ die -= cc->debug_info_sz; -+ } else { -+ *flag = False; -+ } -+ return die; -+} -+ - /*------------------------------------------------------------*/ - /*--- ---*/ - /*--- Helper functions for Guarded Expressions ---*/ -@@ -778,7 +829,8 @@ static __attribute__((noinline)) - void parse_CU_Header ( /*OUT*/CUConst* cc, - Bool td3, - Cursor* c, -- UChar* debug_abbv_img, UWord debug_abbv_sz ) -+ UChar* debug_abbv_img, UWord debug_abbv_sz, -+ Bool type_unit ) - { - UChar address_size; - UWord debug_abbrev_offset; -@@ -816,6 +868,13 @@ void parse_CU_Header ( /*OUT*/CUConst* c - cc->barf( "parse_CU_Header: invalid address_size" ); - TRACE_D3(" Pointer Size: %d\n", (Int)address_size ); - -+ cc->is_type_unit = type_unit; -+ -+ if (type_unit) { -+ cc->type_signature = get_ULong( c ); -+ cc->type_offset = get_Dwarfish_UWord( c, cc->is_dw64 ); -+ } -+ - /* Set up so that cc->debug_abbv points to the relevant table for - this CU. Set the szB so that at least we can't read off the end - of the debug_abbrev section -- potentially (and quite likely) -@@ -926,6 +985,50 @@ void set_abbv_Cursor ( /*OUT*/Cursor* c, - cc->saC_cache[N_ABBV_CACHE/2].posn = get_position_of_Cursor(c); - } - -+/* This represents a single signatured type. It maps a type signature -+ (a ULong) to a cooked DIE offset. Objects of this type are stored -+ in the type signature hash table. */ -+typedef -+ struct D3SignatureType { -+ struct D3SignatureType *next; -+ UWord data; -+ ULong type_signature; -+ UWord die; -+ } -+ D3SignatureType; -+ -+/* Record a signatured type in the hash table. */ -+static void record_signatured_type ( VgHashTable tab, -+ ULong type_signature, -+ UWord die ) -+{ -+ D3SignatureType *dstype = VG_(calloc) ( "di.readdwarf3.sigtype", -+ 1, sizeof(D3SignatureType) ); -+ dstype->data = (UWord) type_signature; -+ dstype->type_signature = type_signature; -+ dstype->die = die; -+ VG_(HT_add_node) ( tab, dstype ); -+} -+ -+/* Given a type signature hash table and a type signature, return the -+ cooked DIE offset of the type. If the type cannot be found, call -+ BARF. */ -+static UWord lookup_signatured_type ( VgHashTable tab, -+ ULong type_signature, -+ void (*barf)( HChar* ) __attribute__((noreturn)) ) -+{ -+ D3SignatureType *dstype = VG_(HT_lookup) ( tab, (UWord) type_signature ); -+ /* This may be unwarranted chumminess with the hash table -+ implementation. */ -+ while ( dstype != NULL && dstype->type_signature != type_signature) -+ dstype = dstype->next; -+ if (dstype == NULL) { -+ barf("lookup_signatured_type: could not find signatured type"); -+ /*NOTREACHED*/ -+ vg_assert(0); -+ } -+ return dstype->die; -+} - - /* From 'c', get the Form data into the lowest 1/2/4/8 bytes of *cts. - -@@ -1164,14 +1267,20 @@ void get_Form_contents ( /*OUT*/ULong* c - } - case DW_FORM_ref_sig8: { - ULong u64b; -- UChar* block = get_address_of_Cursor(c); -+ ULong signature = get_ULong (c); -+ ULong work = signature; - TRACE_D3("8 byte signature: "); - for (u64b = 8; u64b > 0; u64b--) { -- UChar u8 = get_UChar(c); -+ UChar u8 = work & 0xff; - TRACE_D3("%x ", (UInt)u8); -+ work >>= 8; - } -- *cts = (ULong)(UWord)block; -- *ctsMemSzB = 8; -+ /* Due to the way that the hash table is constructed, the -+ resulting DIE offset here is already "cooked". See -+ cook_die_using_form. */ -+ *cts = lookup_signatured_type (cc->signature_types, signature, -+ c->barf); -+ *ctsSzB = sizeof(UWord); - break; - } - case DW_FORM_indirect: -@@ -1468,10 +1577,11 @@ static void parse_var_DIE ( - - UWord saved_die_c_offset = get_position_of_Cursor( c_die ); - UWord saved_abbv_c_offset = get_position_of_Cursor( c_abbv ); -+ Bool debug_types_flag; - - varstack_preen( parser, td3, level-1 ); - -- if (dtag == DW_TAG_compile_unit) { -+ if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit) { - Bool have_lo = False; - Bool have_hi1 = False; - Bool have_range = False; -@@ -1685,7 +1795,7 @@ static void parse_var_DIE ( - VG_(addToXA)(gexprs, &gexpr); - } - if (attr == DW_AT_type && ctsSzB > 0) { -- typeR = (UWord)cts; -+ typeR = cook_die_using_form( cc, (UWord)cts, form ); - } - if (attr == DW_AT_external && ctsSzB > 0 && cts > 0) { - external = True; -@@ -1917,7 +2027,12 @@ static void parse_var_DIE ( - set_position_of_Cursor( c_die, saved_die_c_offset ); - set_position_of_Cursor( c_abbv, saved_abbv_c_offset ); - VG_(printf)("\nparse_var_DIE: confused by:\n"); -- VG_(printf)(" <%d><%lx>: %s\n", level, posn, ML_(pp_DW_TAG)( dtag ) ); -+ posn = uncook_die( cc, posn, &debug_types_flag ); -+ VG_(printf)(" <%d><%lx>: %s", level, posn, ML_(pp_DW_TAG)( dtag ) ); -+ if (debug_types_flag) { -+ VG_(printf)(" (in .debug_types)"); -+ } -+ VG_(printf)("\n"); - while (True) { - DW_AT attr = (DW_AT) get_ULEB128( c_abbv ); - DW_FORM form = (DW_FORM)get_ULEB128( c_abbv ); -@@ -2097,6 +2212,7 @@ static void parse_type_DIE ( /*MOD*/XArr - TyEnt atomE; - TyEnt fieldE; - TyEnt boundE; -+ Bool debug_types_flag; - - UWord saved_die_c_offset = get_position_of_Cursor( c_die ); - UWord saved_abbv_c_offset = get_position_of_Cursor( c_abbv ); -@@ -2111,7 +2227,7 @@ static void parse_type_DIE ( /*MOD*/XArr - its children. */ - typestack_preen( parser, td3, level-1 ); - -- if (dtag == DW_TAG_compile_unit) { -+ if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit) { - /* See if we can find DW_AT_language, since it is important for - establishing array bounds (see DW_TAG_subrange_type below in - this fn) */ -@@ -2272,7 +2388,7 @@ static void parse_type_DIE ( /*MOD*/XArr - typeE.Te.TyPorR.szB = cts; - } - if (attr == DW_AT_type && ctsSzB > 0) { -- typeE.Te.TyPorR.typeR = (UWord)cts; -+ typeE.Te.TyPorR.typeR = cook_die_using_form( cc, (UWord)cts, form ); - } - } - /* Do we have something that looks sane? */ -@@ -2317,8 +2433,23 @@ static void parse_type_DIE ( /*MOD*/XArr - /* we must know the size */ - /* but not for Ada, which uses such dummy - enumerations as helper for gdb ada mode. */ -- && parser->language != 'A') -- goto bad_DIE; -+ && parser->language != 'A') { -+ /* GCC has been seen to put an odd DIE like this into -+ .debug_types: -+ -+ <1>: DW_TAG_enumeration_type (in .debug_types) -+ DW_AT_name : (indirect string, offset: 0x3374a): exec_direction_kind -+ DW_AT_declaration : 1 -+ -+ It isn't clear what this means, but we accept it and -+ assume that the enum is int-sized. */ -+ if (cc->is_type_unit) { -+ typeE.Te.TyEnum.szB = sizeof(int); -+ } else { -+ goto bad_DIE; -+ } -+ } -+ - /* On't stack! */ - typestack_push( cc, parser, td3, &typeE, level ); - goto acquire_Type; -@@ -2487,7 +2618,7 @@ static void parse_type_DIE ( /*MOD*/XArr - (UChar*)(UWord)cts ); - } - if (attr == DW_AT_type && ctsSzB > 0) { -- fieldE.Te.Field.typeR = (UWord)cts; -+ fieldE.Te.Field.typeR = cook_die_using_form( cc, (UWord)cts, form ); - } - /* There are 2 different cases for DW_AT_data_member_location. - If it is a constant class attribute, it contains byte offset -@@ -2567,7 +2698,8 @@ static void parse_type_DIE ( /*MOD*/XArr - get_Form_contents( &cts, &ctsSzB, &ctsMemSzB, - cc, c_die, False/*td3*/, form ); - if (attr == DW_AT_type && ctsSzB > 0) { -- typeE.Te.TyArray.typeR = (UWord)cts; -+ typeE.Te.TyArray.typeR = cook_die_using_form( cc, (UWord)cts, -+ form ); - } - } - if (typeE.Te.TyArray.typeR == D3_INVALID_CUOFF) -@@ -2690,7 +2822,8 @@ static void parse_type_DIE ( /*MOD*/XArr - (UChar*)(UWord)cts ); - } - if (attr == DW_AT_type && ctsSzB > 0) { -- typeE.Te.TyTyDef.typeR = (UWord)cts; -+ typeE.Te.TyTyDef.typeR = cook_die_using_form( cc, (UWord)cts, -+ form ); - } - } - /* Do we have something that looks sane? */ -@@ -2733,7 +2866,7 @@ static void parse_type_DIE ( /*MOD*/XArr - get_Form_contents( &cts, &ctsSzB, &ctsMemSzB, - cc, c_die, False/*td3*/, form ); - if (attr == DW_AT_type && ctsSzB > 0) { -- typeE.Te.TyQual.typeR = (UWord)cts; -+ typeE.Te.TyQual.typeR = cook_die_using_form( cc, (UWord)cts, form ); - have_ty++; - } - } -@@ -2813,7 +2946,12 @@ static void parse_type_DIE ( /*MOD*/XArr - set_position_of_Cursor( c_die, saved_die_c_offset ); - set_position_of_Cursor( c_abbv, saved_abbv_c_offset ); - VG_(printf)("\nparse_type_DIE: confused by:\n"); -- VG_(printf)(" <%d><%lx>: %s\n", level, posn, ML_(pp_DW_TAG)( dtag ) ); -+ posn = uncook_die( cc, posn, &debug_types_flag ); -+ VG_(printf)(" <%d><%lx>: %s", level, posn, ML_(pp_DW_TAG)( dtag ) ); -+ if (debug_types_flag) { -+ VG_(printf)(" (in .debug_types)"); -+ } -+ VG_(printf)("\n"); - while (True) { - DW_AT attr = (DW_AT) get_ULEB128( c_abbv ); - DW_FORM form = (DW_FORM)get_ULEB128( c_abbv ); -@@ -3186,7 +3324,7 @@ static void read_DIE ( - UWord after_die_c_offset, after_abbv_c_offset; - - /* --- Deal with this DIE --- */ -- posn = get_position_of_Cursor( c ); -+ posn = cook_die( cc, get_position_of_Cursor( c ) ); - abbv_code = get_ULEB128( c ); - set_abbv_Cursor( &abbv, td3, cc, abbv_code ); - atag = get_ULEB128( &abbv ); -@@ -3284,6 +3422,7 @@ void new_dwarf3_reader_wrk ( - struct _DebugInfo* di, - __attribute__((noreturn)) void (*barf)( HChar* ), - UChar* debug_info_img, SizeT debug_info_sz, -+ UChar* debug_types_img, SizeT debug_types_sz, - UChar* debug_abbv_img, SizeT debug_abbv_sz, - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, -@@ -3310,6 +3449,8 @@ void new_dwarf3_reader_wrk ( - Word i, j, n; - Bool td3 = di->trace_symtab; - XArray* /* of TempVar* */ dioff_lookup_tab; -+ Int pass; -+ VgHashTable signature_types; - #if 0 - /* This doesn't work properly because it assumes all entries are - packed end to end, with no holes. But that doesn't always -@@ -3443,13 +3584,6 @@ void new_dwarf3_reader_wrk ( - } - TRACE_SYMTAB("\n"); - -- /* Now loop over the Compilation Units listed in the .debug_info -- section (see D3SPEC sec 7.5) paras 1 and 2. Each compilation -- unit contains a Compilation Unit Header followed by precisely -- one DW_TAG_compile_unit or DW_TAG_partial_unit DIE. */ -- init_Cursor( &info, debug_info_img, debug_info_sz, 0, barf, -- "Overrun whilst reading .debug_info section" ); -- - /* We'll park the harvested type information in here. Also create - a fake "void" entry with offset D3_FAKEVOID_CUOFF, so we always - have at least one type entry to refer to. D3_FAKEVOID_CUOFF is -@@ -3511,158 +3645,234 @@ void new_dwarf3_reader_wrk ( - VG_(memset)( &varparser, 0, sizeof(varparser) ); - varparser.sp = -1; - -- TRACE_D3("\n------ Parsing .debug_info section ------\n"); -- while (True) { -- UWord cu_start_offset, cu_offset_now; -- CUConst cc; -- /* It may be that the stated size of this CU is larger than the -- amount of stuff actually in it. icc9 seems to generate CUs -- thusly. We use these variables to figure out if this is -- indeed the case, and if so how many bytes we need to skip to -- get to the start of the next CU. Not skipping those bytes -- causes us to misidentify the start of the next CU, and it all -- goes badly wrong after that (not surprisingly). */ -- UWord cu_size_including_IniLen, cu_amount_used; -- -- /* It seems icc9 finishes the DIE info before debug_info_sz -- bytes have been used up. So be flexible, and declare the -- sequence complete if there is not enough remaining bytes to -- hold even the smallest conceivable CU header. (11 bytes I -- reckon). */ -- /* JRS 23Jan09: I suspect this is no longer necessary now that -- the code below contains a 'while (cu_amount_used < -- cu_size_including_IniLen ...' style loop, which skips over -- any leftover bytes at the end of a CU in the case where the -- CU's stated size is larger than its actual size (as -- determined by reading all its DIEs). However, for prudence, -- I'll leave the following test in place. I can't see that a -- CU header can be smaller than 11 bytes, so I don't think -- there's any harm possible through the test -- it just adds -- robustness. */ -- Word avail = get_remaining_length_Cursor( &info ); -- if (avail < 11) { -- if (avail > 0) -- TRACE_D3("new_dwarf3_reader_wrk: warning: " -- "%ld unused bytes after end of DIEs\n", avail); -- break; -- } -+ signature_types = VG_(HT_construct) ("signature_types"); -+ -+ /* Do an initial pass to scan the .debug_types section, if any, and -+ fill in the signatured types hash table. This lets us handle -+ mapping from a type signature to a (cooked) DIE offset directly -+ in get_Form_contents. */ -+ if (debug_types_img != NULL) { -+ init_Cursor( &info, debug_types_img, debug_types_sz, 0, barf, -+ "Overrun whilst reading .debug_types section" ); -+ TRACE_D3("\n------ Collecting signatures from .debug_types section ------\n"); - -- /* Check the varparser's stack is in a sane state. */ -- vg_assert(varparser.sp == -1); -- for (i = 0; i < N_D3_VAR_STACK; i++) { -- vg_assert(varparser.ranges[i] == NULL); -- vg_assert(varparser.level[i] == 0); -- } -- for (i = 0; i < N_D3_TYPE_STACK; i++) { -- vg_assert(typarser.qparentE[i].cuOff == D3_INVALID_CUOFF); -- vg_assert(typarser.qparentE[i].tag == Te_EMPTY); -- vg_assert(typarser.qlevel[i] == 0); -+ while (True) { -+ UWord cu_start_offset, cu_offset_now; -+ CUConst cc; -+ -+ cu_start_offset = get_position_of_Cursor( &info ); -+ TRACE_D3("\n"); -+ TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset); -+ /* parse_CU_header initialises the CU's set_abbv_Cursor cache -+ (saC_cache) */ -+ parse_CU_Header( &cc, td3, &info, -+ (UChar*)debug_abbv_img, debug_abbv_sz, -+ True ); -+ -+ /* Needed by cook_die. */ -+ cc.debug_info_sz = debug_info_sz; -+ -+ record_signatured_type( signature_types, cc.type_signature, -+ cook_die( &cc, cc.type_offset )); -+ -+ /* Until proven otherwise we assume we don't need the icc9 -+ workaround in this case; see the DIE-reading loop below -+ for details. */ -+ cu_offset_now = (cu_start_offset + cc.unit_length -+ + (cc.is_dw64 ? 12 : 4)); -+ -+ if (cu_offset_now == debug_types_sz) -+ break; -+ -+ set_position_of_Cursor ( &info, cu_offset_now ); - } -+ } - -- cu_start_offset = get_position_of_Cursor( &info ); -- TRACE_D3("\n"); -- TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset); -- /* parse_CU_header initialises the CU's set_abbv_Cursor cache -- (saC_cache) */ -- parse_CU_Header( &cc, td3, &info, -- (UChar*)debug_abbv_img, debug_abbv_sz ); -- cc.debug_str_img = debug_str_img; -- cc.debug_str_sz = debug_str_sz; -- cc.debug_ranges_img = debug_ranges_img; -- cc.debug_ranges_sz = debug_ranges_sz; -- cc.debug_loc_img = debug_loc_img; -- cc.debug_loc_sz = debug_loc_sz; -- cc.debug_line_img = debug_line_img; -- cc.debug_line_sz = debug_line_sz; -- cc.debug_info_img = debug_info_img; -- cc.debug_info_sz = debug_info_sz; -- cc.cu_start_offset = cu_start_offset; -- cc.di = di; -- /* The CU's svma can be deduced by looking at the AT_low_pc -- value in the top level TAG_compile_unit, which is the topmost -- DIE. We'll leave it for the 'varparser' to acquire that info -- and fill it in -- since it is the only party to want to know -- it. */ -- cc.cu_svma_known = False; -- cc.cu_svma = 0; -- -- /* Create a fake outermost-level range covering the entire -- address range. So we always have *something* to catch all -- variable declarations. */ -- varstack_push( &cc, &varparser, td3, -- unitary_range_list(0UL, ~0UL), -- -1, False/*isFunc*/, NULL/*fbGX*/ ); -- -- /* And set up the file name table. When we come across the top -- level DIE for this CU (which is what the next call to -- read_DIE should process) we will copy all the file names out -- of the .debug_line img area and use this table to look up the -- copies when we later see filename numbers in DW_TAG_variables -- etc. */ -- vg_assert(!varparser.filenameTable ); -- varparser.filenameTable -- = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5", -- ML_(dinfo_free), -- sizeof(UChar*) ); -- vg_assert(varparser.filenameTable); -+ /* Perform two DIE-reading passes. The first pass reads DIEs from -+ .debug_info, and the second pass reads DIEs from .debug_types. -+ Moving the body of this loop into a separate function would -+ require a large number of arguments to be passed in, so it is -+ kept inline instead. */ -+ for (pass = 0; pass < 2; ++pass) { -+ UWord section_size; -+ -+ if (pass == 0) { -+ /* Now loop over the Compilation Units listed in the .debug_info -+ section (see D3SPEC sec 7.5) paras 1 and 2. Each compilation -+ unit contains a Compilation Unit Header followed by precisely -+ one DW_TAG_compile_unit or DW_TAG_partial_unit DIE. */ -+ init_Cursor( &info, debug_info_img, debug_info_sz, 0, barf, -+ "Overrun whilst reading .debug_info section" ); -+ section_size = debug_info_sz; - -- /* Now read the one-and-only top-level DIE for this CU. */ -- vg_assert(varparser.sp == 0); -- read_DIE( rangestree, -- tyents, tempvars, gexprs, -- &typarser, &varparser, -- &info, td3, &cc, 0 ); -- -- cu_offset_now = get_position_of_Cursor( &info ); -- -- if (0) VG_(printf)("Travelled: %lu size %llu\n", -- cu_offset_now - cc.cu_start_offset, -- cc.unit_length + (cc.is_dw64 ? 12 : 4)); -- -- /* How big the CU claims it is .. */ -- cu_size_including_IniLen = cc.unit_length + (cc.is_dw64 ? 12 : 4); -- /* .. vs how big we have found it to be */ -- cu_amount_used = cu_offset_now - cc.cu_start_offset; -- -- if (1) TRACE_D3("offset now %ld, d-i-size %ld\n", -- cu_offset_now, debug_info_sz); -- if (cu_offset_now > debug_info_sz) -- barf("toplevel DIEs beyond end of CU"); -- -- /* If the CU is bigger than it claims to be, we've got a serious -- problem. */ -- if (cu_amount_used > cu_size_including_IniLen) -- barf("CU's actual size appears to be larger than it claims it is"); -- -- /* If the CU is smaller than it claims to be, we need to skip some -- bytes. Loop updates cu_offset_new and cu_amount_used. */ -- while (cu_amount_used < cu_size_including_IniLen -- && get_remaining_length_Cursor( &info ) > 0) { -- if (0) VG_(printf)("SKIP\n"); -- (void)get_UChar( &info ); -- cu_offset_now = get_position_of_Cursor( &info ); -- cu_amount_used = cu_offset_now - cc.cu_start_offset; -+ TRACE_D3("\n------ Parsing .debug_info section ------\n"); -+ } else { -+ if (debug_types_img == NULL) -+ continue; -+ init_Cursor( &info, debug_types_img, debug_types_sz, 0, barf, -+ "Overrun whilst reading .debug_types section" ); -+ section_size = debug_types_sz; -+ -+ TRACE_D3("\n------ Parsing .debug_types section ------\n"); - } - -- /* Preen to level -2. DIEs have level >= 0 so -2 cannot occur -- anywhere else at all. Our fake the-entire-address-space -- range is at level -1, so preening to -2 should completely -- empty the stack out. */ -- TRACE_D3("\n"); -- varstack_preen( &varparser, td3, -2 ); -- /* Similarly, empty the type stack out. */ -- typestack_preen( &typarser, td3, -2 ); -+ while (True) { -+ UWord cu_start_offset, cu_offset_now; -+ CUConst cc; -+ /* It may be that the stated size of this CU is larger than the -+ amount of stuff actually in it. icc9 seems to generate CUs -+ thusly. We use these variables to figure out if this is -+ indeed the case, and if so how many bytes we need to skip to -+ get to the start of the next CU. Not skipping those bytes -+ causes us to misidentify the start of the next CU, and it all -+ goes badly wrong after that (not surprisingly). */ -+ UWord cu_size_including_IniLen, cu_amount_used; -+ -+ /* It seems icc9 finishes the DIE info before debug_info_sz -+ bytes have been used up. So be flexible, and declare the -+ sequence complete if there is not enough remaining bytes to -+ hold even the smallest conceivable CU header. (11 bytes I -+ reckon). */ -+ /* JRS 23Jan09: I suspect this is no longer necessary now that -+ the code below contains a 'while (cu_amount_used < -+ cu_size_including_IniLen ...' style loop, which skips over -+ any leftover bytes at the end of a CU in the case where the -+ CU's stated size is larger than its actual size (as -+ determined by reading all its DIEs). However, for prudence, -+ I'll leave the following test in place. I can't see that a -+ CU header can be smaller than 11 bytes, so I don't think -+ there's any harm possible through the test -- it just adds -+ robustness. */ -+ Word avail = get_remaining_length_Cursor( &info ); -+ if (avail < 11) { -+ if (avail > 0) -+ TRACE_D3("new_dwarf3_reader_wrk: warning: " -+ "%ld unused bytes after end of DIEs\n", avail); -+ break; -+ } -+ -+ /* Check the varparser's stack is in a sane state. */ -+ vg_assert(varparser.sp == -1); -+ for (i = 0; i < N_D3_VAR_STACK; i++) { -+ vg_assert(varparser.ranges[i] == NULL); -+ vg_assert(varparser.level[i] == 0); -+ } -+ for (i = 0; i < N_D3_TYPE_STACK; i++) { -+ vg_assert(typarser.qparentE[i].cuOff == D3_INVALID_CUOFF); -+ vg_assert(typarser.qparentE[i].tag == Te_EMPTY); -+ vg_assert(typarser.qlevel[i] == 0); -+ } -+ -+ cu_start_offset = get_position_of_Cursor( &info ); -+ TRACE_D3("\n"); -+ TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset); -+ /* parse_CU_header initialises the CU's set_abbv_Cursor cache -+ (saC_cache) */ -+ parse_CU_Header( &cc, td3, &info, -+ (UChar*)debug_abbv_img, debug_abbv_sz, -+ pass != 0 ); -+ cc.debug_str_img = debug_str_img; -+ cc.debug_str_sz = debug_str_sz; -+ cc.debug_ranges_img = debug_ranges_img; -+ cc.debug_ranges_sz = debug_ranges_sz; -+ cc.debug_loc_img = debug_loc_img; -+ cc.debug_loc_sz = debug_loc_sz; -+ cc.debug_line_img = debug_line_img; -+ cc.debug_line_sz = debug_line_sz; -+ cc.debug_info_img = debug_info_img; -+ cc.debug_info_sz = debug_info_sz; -+ cc.debug_types_img = debug_types_img; -+ cc.debug_types_sz = debug_types_sz; -+ cc.cu_start_offset = cu_start_offset; -+ cc.di = di; -+ /* The CU's svma can be deduced by looking at the AT_low_pc -+ value in the top level TAG_compile_unit, which is the topmost -+ DIE. We'll leave it for the 'varparser' to acquire that info -+ and fill it in -- since it is the only party to want to know -+ it. */ -+ cc.cu_svma_known = False; -+ cc.cu_svma = 0; -+ -+ cc.signature_types = signature_types; -+ -+ /* Create a fake outermost-level range covering the entire -+ address range. So we always have *something* to catch all -+ variable declarations. */ -+ varstack_push( &cc, &varparser, td3, -+ unitary_range_list(0UL, ~0UL), -+ -1, False/*isFunc*/, NULL/*fbGX*/ ); -+ -+ /* And set up the file name table. When we come across the top -+ level DIE for this CU (which is what the next call to -+ read_DIE should process) we will copy all the file names out -+ of the .debug_line img area and use this table to look up the -+ copies when we later see filename numbers in DW_TAG_variables -+ etc. */ -+ vg_assert(!varparser.filenameTable ); -+ varparser.filenameTable -+ = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5", -+ ML_(dinfo_free), -+ sizeof(UChar*) ); -+ vg_assert(varparser.filenameTable); -+ -+ /* Now read the one-and-only top-level DIE for this CU. */ -+ vg_assert(varparser.sp == 0); -+ read_DIE( rangestree, -+ tyents, tempvars, gexprs, -+ &typarser, &varparser, -+ &info, td3, &cc, 0 ); - -- if (cu_offset_now == debug_info_sz) -- break; -- /* else keep going */ -+ cu_offset_now = get_position_of_Cursor( &info ); - -- TRACE_D3("set_abbv_Cursor cache: %lu queries, %lu misses\n", -- cc.saC_cache_queries, cc.saC_cache_misses); -+ if (0) VG_(printf)("Travelled: %lu size %llu\n", -+ cu_offset_now - cc.cu_start_offset, -+ cc.unit_length + (cc.is_dw64 ? 12 : 4)); -+ -+ /* How big the CU claims it is .. */ -+ cu_size_including_IniLen = cc.unit_length + (cc.is_dw64 ? 12 : 4); -+ /* .. vs how big we have found it to be */ -+ cu_amount_used = cu_offset_now - cc.cu_start_offset; - -- vg_assert(varparser.filenameTable ); -- VG_(deleteXA)( varparser.filenameTable ); -- varparser.filenameTable = NULL; -+ if (1) TRACE_D3("offset now %ld, d-i-size %ld\n", -+ cu_offset_now, section_size); -+ if (cu_offset_now > section_size) -+ barf("toplevel DIEs beyond end of CU"); -+ -+ /* If the CU is bigger than it claims to be, we've got a serious -+ problem. */ -+ if (cu_amount_used > cu_size_including_IniLen) -+ barf("CU's actual size appears to be larger than it claims it is"); -+ -+ /* If the CU is smaller than it claims to be, we need to skip some -+ bytes. Loop updates cu_offset_new and cu_amount_used. */ -+ while (cu_amount_used < cu_size_including_IniLen -+ && get_remaining_length_Cursor( &info ) > 0) { -+ if (0) VG_(printf)("SKIP\n"); -+ (void)get_UChar( &info ); -+ cu_offset_now = get_position_of_Cursor( &info ); -+ cu_amount_used = cu_offset_now - cc.cu_start_offset; -+ } -+ -+ /* Preen to level -2. DIEs have level >= 0 so -2 cannot occur -+ anywhere else at all. Our fake the-entire-address-space -+ range is at level -1, so preening to -2 should completely -+ empty the stack out. */ -+ TRACE_D3("\n"); -+ varstack_preen( &varparser, td3, -2 ); -+ /* Similarly, empty the type stack out. */ -+ typestack_preen( &typarser, td3, -2 ); -+ -+ TRACE_D3("set_abbv_Cursor cache: %lu queries, %lu misses\n", -+ cc.saC_cache_queries, cc.saC_cache_misses); -+ -+ vg_assert(varparser.filenameTable ); -+ VG_(deleteXA)( varparser.filenameTable ); -+ varparser.filenameTable = NULL; -+ -+ if (cu_offset_now == section_size) -+ break; -+ /* else keep going */ -+ } - } - - /* From here on we're post-processing the stuff we got -@@ -3973,14 +4183,10 @@ void new_dwarf3_reader_wrk ( - ML_(dinfo_free)( tyents_to_keep_cache ); - tyents_to_keep_cache = NULL; - -- /* and the file name table (just the array, not the entries -- themselves). (Apparently, 2008-Oct-23, varparser.filenameTable -- can be NULL here, for icc9 generated Dwarf3. Not sure what that -- signifies (a deeper problem with the reader?)) */ -- if (varparser.filenameTable) { -- VG_(deleteXA)( varparser.filenameTable ); -- varparser.filenameTable = NULL; -- } -+ vg_assert( varparser.filenameTable == NULL ); -+ -+ /* And the signatured type hash. */ -+ VG_(HT_destruct) ( signature_types ); - - /* record the GExprs in di so they can be freed later */ - vg_assert(!di->admin_gexprs); -@@ -4011,6 +4217,7 @@ void - ML_(new_dwarf3_reader) ( - struct _DebugInfo* di, - UChar* debug_info_img, SizeT debug_info_sz, -+ UChar* debug_types_img, SizeT debug_types_sz, - UChar* debug_abbv_img, SizeT debug_abbv_sz, - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, -@@ -4034,6 +4241,7 @@ ML_(new_dwarf3_reader) ( - /* try this ... */ - new_dwarf3_reader_wrk( di, barf, - debug_info_img, debug_info_sz, -+ debug_types_img, debug_types_sz, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz, ---- valgrind-3.7.0/coregrind/m_debuginfo/readmacho.c (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readmacho.c (revision 12491) -@@ -1068,6 +1068,7 @@ Bool ML_(read_macho_debug_info)( struct - /* The old reader: line numbers and unwind info only */ - ML_(read_debuginfo_dwarf3) ( di, - debug_info_img, debug_info_sz, -+ NULL, 0, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz ); -@@ -1080,6 +1081,7 @@ Bool ML_(read_macho_debug_info)( struct - || VG_(clo_read_var_info) /* the user asked for it */) { - ML_(new_dwarf3_reader)( - di, debug_info_img, debug_info_sz, -+ NULL, 0, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz, ---- valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf3.h (revision 12490) -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf3.h (revision 12491) -@@ -43,6 +43,7 @@ void - ML_(new_dwarf3_reader) ( - struct _DebugInfo* di, - UChar* debug_info_img, SizeT debug_info_sz, -+ UChar* debug_types_img, SizeT debug_types_sz, - UChar* debug_abbv_img, SizeT debug_abbv_sz, - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, ---- valgrind-3.7.0/memcheck/tests/Makefile.in.jj 2011-11-05 12:26:53.000000000 +0100 -+++ valgrind-3.7.0/memcheck/tests/Makefile.in 2012-05-07 12:23:12.109680621 +0200 -@@ -105,9 +105,11 @@ check_PROGRAMS = addressable$(EXEEXT) at - vcpu_fbench$(EXEEXT) vcpu_fnfns$(EXEEXT) xml1$(EXEEXT) \ - wrap1$(EXEEXT) wrap2$(EXEEXT) wrap3$(EXEEXT) wrap4$(EXEEXT) \ - wrap5$(EXEEXT) wrap6$(EXEEXT) wrap7$(EXEEXT) \ -- wrap7so.so$(EXEEXT) wrap8$(EXEEXT) writev1$(EXEEXT) --@VGCONF_PLATFORMS_INCLUDE_ARM_LINUX_TRUE@am__append_9 = -mfloat-abi=softfp -+ wrap7so.so$(EXEEXT) wrap8$(EXEEXT) writev1$(EXEEXT) \ -+ $(am__EXEEXT_1) -+@DWARF4_TRUE@am__append_9 = dw4 - @VGCONF_PLATFORMS_INCLUDE_ARM_LINUX_TRUE@am__append_10 = -mfloat-abi=softfp -+@VGCONF_PLATFORMS_INCLUDE_ARM_LINUX_TRUE@am__append_11 = -mfloat-abi=softfp - subdir = memcheck/tests - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/configure.in -@@ -117,6 +119,7 @@ mkinstalldirs = $(install_sh) -d - CONFIG_HEADER = $(top_builddir)/config.h - CONFIG_CLEAN_FILES = - CONFIG_CLEAN_VPATH_FILES = -+@DWARF4_TRUE@am__EXEEXT_1 = dw4$(EXEEXT) - addressable_SOURCES = addressable.c - addressable_OBJECTS = addressable.$(OBJEXT) - addressable_LDADD = $(LDADD) -@@ -178,6 +181,11 @@ describe_block_LDADD = $(LDADD) - doublefree_SOURCES = doublefree.c - doublefree_OBJECTS = doublefree.$(OBJEXT) - doublefree_LDADD = $(LDADD) -+dw4_SOURCES = dw4.c -+dw4_OBJECTS = dw4-dw4.$(OBJEXT) -+dw4_LDADD = $(LDADD) -+dw4_LINK = $(CCLD) $(dw4_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ -+ $@ - err_disable1_SOURCES = err_disable1.c - err_disable1_OBJECTS = err_disable1.$(OBJEXT) - err_disable1_LDADD = $(LDADD) -@@ -548,7 +556,7 @@ SOURCES = addressable.c atomic_incs.c ba - badjump.c badjump2.c badloop.c badpoll.c badrw.c \ - big_blocks_freed_list.c brk2.c buflen_check.c \ - calloc-overflow.c clientperm.c custom-overlap.c custom_alloc.c \ -- $(deep_templates_SOURCES) describe-block.c doublefree.c \ -+ $(deep_templates_SOURCES) describe-block.c doublefree.c dw4.c \ - err_disable1.c err_disable2.c err_disable3.c err_disable4.c \ - erringfds.c error_counts.c errs1.c execve1.c execve2.c \ - exitprog.c file_locking.c fprw.c fwrite.c \ -@@ -578,7 +586,7 @@ DIST_SOURCES = addressable.c atomic_incs - badjump.c badjump2.c badloop.c badpoll.c badrw.c \ - big_blocks_freed_list.c brk2.c buflen_check.c \ - calloc-overflow.c clientperm.c custom-overlap.c custom_alloc.c \ -- $(deep_templates_SOURCES) describe-block.c doublefree.c \ -+ $(deep_templates_SOURCES) describe-block.c doublefree.c dw4.c \ - err_disable1.c err_disable2.c err_disable3.c err_disable4.c \ - erringfds.c error_counts.c errs1.c execve1.c execve2.c \ - exitprog.c file_locking.c fprw.c fwrite.c \ -@@ -920,9 +928,9 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_sr - # Nb: Tools need to augment these flags with an arch-selection option, such - # as $(AM_FLAG_M3264_PRI). - AM_CFLAGS = -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) \ -- $(am__append_9) --AM_CXXFLAGS = -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) \ - $(am__append_10) -+AM_CXXFLAGS = -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) \ -+ $(am__append_11) - # Include AM_CPPFLAGS in AM_CCASFLAGS to allow for older versions of - # automake; see comments in Makefile.all.am for more detail. - AM_CCASFLAGS = $(AM_CPPFLAGS) -@@ -968,6 +976,7 @@ EXTRA_DIST = \ - deep_templates.stdout.exp deep_templates.stderr.exp \ - describe-block.stderr.exp describe-block.vgtest \ - doublefree.stderr.exp doublefree.vgtest \ -+ dw4.vgtest dw4.stderr.exp dw4.stdout.exp \ - err_disable1.vgtest err_disable1.stderr.exp \ - err_disable2.vgtest err_disable2.stderr.exp \ - err_disable3.vgtest err_disable3.stderr.exp \ -@@ -1108,6 +1117,7 @@ EXTRA_DIST = \ - @VGCONF_OS_IS_DARWIN_TRUE@atomic_incs_CFLAGS = $(AM_CFLAGS) -mdynamic-no-pic - deep_templates_SOURCES = deep_templates.cpp - deep_templates_CXXFLAGS = $(AM_CFLAGS) -O -gstabs -+dw4_CFLAGS = $(AM_CFLAGS) -gdwarf-4 -fdebug-types-section - err_disable3_LDADD = -lpthread - err_disable4_LDADD = -lpthread - error_counts_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ -@@ -1281,6 +1291,9 @@ describe-block$(EXEEXT): $(describe_bloc - doublefree$(EXEEXT): $(doublefree_OBJECTS) $(doublefree_DEPENDENCIES) - @rm -f doublefree$(EXEEXT) - $(LINK) $(doublefree_OBJECTS) $(doublefree_LDADD) $(LIBS) -+dw4$(EXEEXT): $(dw4_OBJECTS) $(dw4_DEPENDENCIES) -+ @rm -f dw4$(EXEEXT) -+ $(dw4_LINK) $(dw4_OBJECTS) $(dw4_LDADD) $(LIBS) - err_disable1$(EXEEXT): $(err_disable1_OBJECTS) $(err_disable1_DEPENDENCIES) - @rm -f err_disable1$(EXEEXT) - $(LINK) $(err_disable1_OBJECTS) $(err_disable1_LDADD) $(LIBS) -@@ -1610,6 +1623,7 @@ distclean-compile: - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deep_templates-deep_templates.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/describe-block.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doublefree.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dw4-dw4.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err_disable1.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err_disable2.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err_disable3.Po@am__quote@ -@@ -1738,6 +1752,20 @@ atomic_incs-atomic_incs.obj: atomic_incs - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomic_incs_CFLAGS) $(CFLAGS) -c -o atomic_incs-atomic_incs.obj `if test -f 'atomic_incs.c'; then $(CYGPATH_W) 'atomic_incs.c'; else $(CYGPATH_W) '$(srcdir)/atomic_incs.c'; fi` - -+dw4-dw4.o: dw4.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dw4_CFLAGS) $(CFLAGS) -MT dw4-dw4.o -MD -MP -MF $(DEPDIR)/dw4-dw4.Tpo -c -o dw4-dw4.o `test -f 'dw4.c' || echo '$(srcdir)/'`dw4.c -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dw4-dw4.Tpo $(DEPDIR)/dw4-dw4.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dw4.c' object='dw4-dw4.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dw4_CFLAGS) $(CFLAGS) -c -o dw4-dw4.o `test -f 'dw4.c' || echo '$(srcdir)/'`dw4.c -+ -+dw4-dw4.obj: dw4.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dw4_CFLAGS) $(CFLAGS) -MT dw4-dw4.obj -MD -MP -MF $(DEPDIR)/dw4-dw4.Tpo -c -o dw4-dw4.obj `if test -f 'dw4.c'; then $(CYGPATH_W) 'dw4.c'; else $(CYGPATH_W) '$(srcdir)/dw4.c'; fi` -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dw4-dw4.Tpo $(DEPDIR)/dw4-dw4.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dw4.c' object='dw4-dw4.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dw4_CFLAGS) $(CFLAGS) -c -o dw4-dw4.obj `if test -f 'dw4.c'; then $(CYGPATH_W) 'dw4.c'; else $(CYGPATH_W) '$(srcdir)/dw4.c'; fi` -+ - error_counts-error_counts.o: error_counts.c - @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(error_counts_CFLAGS) $(CFLAGS) -MT error_counts-error_counts.o -MD -MP -MF $(DEPDIR)/error_counts-error_counts.Tpo -c -o error_counts-error_counts.o `test -f 'error_counts.c' || echo '$(srcdir)/'`error_counts.c - @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/error_counts-error_counts.Tpo $(DEPDIR)/error_counts-error_counts.Po ---- valgrind-3.7.0/configure.jj 2012-05-07 11:35:16.000000000 +0200 -+++ valgrind-3.7.0/configure 2012-05-07 12:23:03.219647763 +0200 -@@ -631,6 +631,8 @@ BUILD_SSSE3_TESTS_TRUE - BUILD_SSE3_TESTS_FALSE - BUILD_SSE3_TESTS_TRUE - FLAG_NO_BUILD_ID -+DWARF4_FALSE -+DWARF4_TRUE - FLAG_UNLIMITED_INLINE_UNIT_GROWTH - FLAG_FNO_STACK_PROTECTOR - FLAG_W_EXTRA -@@ -7580,6 +7582,52 @@ rm -f core conftest.err conftest.$ac_obj - CFLAGS=$safe_CFLAGS - - -+# does this compiler support -gdwarf-4 -fdebug-types-section ? -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc accepts -gdwarf-4 -fdebug-types-section" >&5 -+$as_echo_n "checking if gcc accepts -gdwarf-4 -fdebug-types-section... " >&6; } -+ -+safe_CFLAGS=$CFLAGS -+CFLAGS="-gdwarf-4 -fdebug-types-section" -+ -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ return 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+ac_have_dwarf4=yes -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+else -+ -+ac_have_dwarf4=no -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ if test x$ac_have_dwarf4 = xyes; then -+ DWARF4_TRUE= -+ DWARF4_FALSE='#' -+else -+ DWARF4_TRUE='#' -+ DWARF4_FALSE= -+fi -+ -+CFLAGS=$safe_CFLAGS -+ -+ - # does the linker support -Wl,--build-id=none ? Note, it's - # important that we test indirectly via whichever C compiler - # is selected, rather than testing /usr/bin/ld or whatever -@@ -9292,6 +9340,10 @@ if test -z "${HAVE_PTHREAD_CREATE_GLIBC_ - as_fn_error "conditional \"HAVE_PTHREAD_CREATE_GLIBC_2_0\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${DWARF4_TRUE}" && test -z "${DWARF4_FALSE}"; then -+ as_fn_error "conditional \"DWARF4\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - if test -z "${BUILD_SSE3_TESTS_TRUE}" && test -z "${BUILD_SSE3_TESTS_FALSE}"; then - as_fn_error "conditional \"BUILD_SSE3_TESTS\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/valgrind-3.7.0-dwz.patch b/valgrind-3.7.0-dwz.patch deleted file mode 100644 index a7c90c4..0000000 --- a/valgrind-3.7.0-dwz.patch +++ /dev/null @@ -1,909 +0,0 @@ -diff -ru valgrind-3.7.0.orig/config.h valgrind-3.7.0/config.h ---- valgrind-3.7.0.orig/config.h 2012-07-25 12:33:29.212949007 +0200 -+++ valgrind-3.7.0/config.h 2012-07-25 12:44:42.847307554 +0200 -@@ -29,7 +29,7 @@ - /* #undef GLIBC_2_10 */ - - /* Define to 1 if you're using glibc 2.11.x */ --#define GLIBC_2_11 1 -+/* #undef GLIBC_2_11 */ - - /* Define to 1 if you're using glibc 2.12.x */ - /* #undef GLIBC_2_12 */ -@@ -38,7 +38,10 @@ - /* #undef GLIBC_2_13 */ - - /* Define to 1 if you're using glibc 2.14.x */ --/* #undef GLIBC_2_14 */ -+#define GLIBC_2_14 1 -+ -+/* Define to 1 if you're using glibc 2.15.x */ -+/* #undef GLIBC_2_15 */ - - /* Define to 1 if you're using glibc 2.2.x */ - /* #undef GLIBC_2_2 */ -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/d3basics.c valgrind-3.7.0/coregrind/m_debuginfo/d3basics.c ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/d3basics.c 2012-07-25 12:33:29.191948686 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/d3basics.c 2012-07-25 12:44:30.217112438 +0200 -@@ -180,6 +180,8 @@ - case DW_FORM_exprloc: return "DW_FORM_exprloc"; - case DW_FORM_flag_present:return "DW_FORM_flag_present"; - case DW_FORM_ref_sig8: return "DW_FORM_ref_sig8"; -+ case DW_FORM_GNU_ref_alt:return "DW_FORM_GNU_ref_alt"; -+ case DW_FORM_GNU_strp_alt:return "DW_FORM_GNU_strp_alt"; - default: return "DW_FORM_???"; - } - } -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/debuginfo.c valgrind-3.7.0/coregrind/m_debuginfo/debuginfo.c ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/debuginfo.c 2012-07-25 12:33:29.191948686 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/debuginfo.c 2012-07-25 12:44:30.219112468 +0200 -@@ -859,7 +859,7 @@ - - /* We're only interested in mappings of object files. */ - # if defined(VGO_linux) -- if (!ML_(is_elf_object_file)( buf1k, (SizeT)sr_Res(preadres) )) -+ if (!ML_(is_elf_object_file)( buf1k, (SizeT)sr_Res(preadres), False )) - return 0; - # elif defined(VGO_darwin) - if (!ML_(is_macho_object_file)( buf1k, (SizeT)sr_Res(preadres) )) -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_d3basics.h valgrind-3.7.0/coregrind/m_debuginfo/priv_d3basics.h ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_d3basics.h 2012-07-25 12:33:29.192948701 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_d3basics.h 2012-07-25 12:44:30.235112717 +0200 -@@ -199,7 +199,11 @@ - DW_FORM_sec_offset = 0x17, - DW_FORM_exprloc = 0x18, - DW_FORM_flag_present = 0x19, -- DW_FORM_ref_sig8 = 0x20 -+ DW_FORM_ref_sig8 = 0x20, -+ /* Extensions for DWZ multifile. -+ See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */ -+ DW_FORM_GNU_ref_alt = 0x1f20, -+ DW_FORM_GNU_strp_alt = 0x1f21 - } - DW_FORM; - -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readdwarf3.h valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf3.h ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readdwarf3.h 2012-07-25 12:33:29.192948701 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf3.h 2012-07-25 12:44:30.237112747 +0200 -@@ -48,7 +48,11 @@ - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, - UChar* debug_ranges_img, SizeT debug_ranges_sz, -- UChar* debug_loc_img, SizeT debug_loc_sz -+ UChar* debug_loc_img, SizeT debug_loc_sz, -+ UChar* debug_info_alt_img, SizeT debug_info_alt_sz, -+ UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz, -+ UChar* debug_line_alt_img, SizeT debug_line_alt_sz, -+ UChar* debug_str_alt_img, SizeT debug_str_alt_sz - ); - - #endif /* ndef __PRIV_READDWARF3_H */ -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readdwarf.h valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf.h ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readdwarf.h 2012-07-25 12:33:29.192948701 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_readdwarf.h 2012-07-25 12:44:30.238112762 +0200 -@@ -48,7 +48,8 @@ - UChar* debug_types_img, Word debug_types_sz, /* .debug_types */ - UChar* debug_abbv_img, Word debug_abbv_sz, /* .debug_abbrev */ - UChar* debug_line_img, Word debug_line_sz, /* .debug_line */ -- UChar* debug_str_img, Word debug_str_sz ); /* .debug_str */ -+ UChar* debug_str_img, Word debug_str_sz, /* .debug_str */ -+ UChar* debug_str_alt_img, Word debug_str_alt_sz ); /* .debug_str */ - - /* -------------------- - DWARF1 reader -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readelf.h valgrind-3.7.0/coregrind/m_debuginfo/priv_readelf.h ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/priv_readelf.h 2012-07-25 12:33:29.192948701 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_readelf.h 2012-07-25 12:44:30.239112777 +0200 -@@ -40,7 +40,7 @@ - - /* Identify an ELF object file by peering at the first few bytes of - it. */ --extern Bool ML_(is_elf_object_file)( void* image, SizeT n_image ); -+extern Bool ML_(is_elf_object_file)( void* image, SizeT n_image, Bool rel_ok ); - - /* The central function for reading ELF debug info. For the - object/exe specified by the SegInfo, find ELF sections, then read -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/readdwarf3.c valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/readdwarf3.c 2012-07-25 12:33:29.192948701 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c 2012-07-25 12:44:30.240112792 +0200 -@@ -420,6 +420,16 @@ - /* Where is .debug_types? */ - UChar* debug_types_img; - UWord debug_types_sz; -+ /* Where is alternate .debug_info? */ -+ UChar* debug_info_alt_img; -+ UWord debug_info_alt_sz; -+ /* Where is alternate .debug_str ? */ -+ UChar* debug_str_alt_img; -+ UWord debug_str_alt_sz; -+ /* How much to add to .debug_types resp. alternate .debug_info offsets -+ in cook_die*. */ -+ UWord types_cuOff_bias; -+ UWord alt_cuOff_bias; - /* --- Needed so we can add stuff to the string table. --- */ - struct _DebugInfo* di; - /* --- a cache for set_abbv_Cursor --- */ -@@ -440,40 +450,58 @@ - /* Signatured type hash; computed once and then shared by all - CUs. */ - VgHashTable signature_types; -+ -+ /* True if this came from alternate .debug_info; otherwise -+ it came from normal .debug_info or .debug_types. */ -+ Bool is_alt_info; - } - CUConst; - - - /* Return the cooked value of DIE depending on whether CC represents a -- .debug_types unit. To cook a DIE, we pretend that the .debug_info -- and .debug_types sections form a contiguous whole, so that DIEs -- coming from .debug_types are numbered starting at the end of -- .debug_info. */ -+ .debug_types unit. To cook a DIE, we pretend that the .debug_info, -+ .debug_types and optional alternate .debug_info sections form -+ a contiguous whole, so that DIEs coming from .debug_types are numbered -+ starting at the end of .debug_info and DIEs coming from alternate -+ .debug_info are numbered starting at the end of .debug_types. */ - static UWord cook_die( CUConst* cc, UWord die ) - { - if (cc->is_type_unit) -- die += cc->debug_info_sz; -+ die += cc->types_cuOff_bias; -+ else if (cc->is_alt_info) -+ die += cc->alt_cuOff_bias; - return die; - } - - /* Like cook_die, but understand that DIEs coming from a -- DW_FORM_ref_sig8 reference are already cooked. */ -+ DW_FORM_ref_sig8 reference are already cooked. Also, handle -+ DW_FORM_GNU_ref_alt from within primary .debug_info or .debug_types -+ as reference to alternate .debug_info. */ - static UWord cook_die_using_form( CUConst *cc, UWord die, DW_FORM form) - { - if (form == DW_FORM_ref_sig8) - return die; -+ if (form == DW_FORM_GNU_ref_alt) -+ return die + cc->alt_cuOff_bias; - return cook_die( cc, die ); - } - --/* Return the uncooked offset of DIE and set *FLAG to true if the DIE -- came from the .debug_types section. */ --static UWord uncook_die( CUConst *cc, UWord die, /*OUT*/Bool *flag ) -+/* Return the uncooked offset of DIE and set *TYPE_FLAG to true if the DIE -+ came from the .debug_types section and *ALT_FLAG to true if the DIE -+ came from alternate .debug_info section. */ -+static UWord uncook_die( CUConst *cc, UWord die, /*OUT*/Bool *type_flag, -+ Bool *alt_flag ) - { -+ *alt_flag = False; -+ *type_flag = False; - if (die >= cc->debug_info_sz) { -- *flag = True; -- die -= cc->debug_info_sz; -- } else { -- *flag = False; -+ if (die >= cc->debug_info_sz + cc->debug_types_sz) { -+ *alt_flag = True; -+ die -= cc->debug_info_sz + cc->debug_types_sz; -+ } else { -+ *type_flag = True; -+ die -= cc->debug_info_sz; -+ } - } - return die; - } -@@ -831,7 +859,8 @@ - Bool td3, - Cursor* c, - UChar* debug_abbv_img, UWord debug_abbv_sz, -- Bool type_unit ) -+ Bool type_unit, -+ Bool alt_info ) - { - UChar address_size; - UWord debug_abbrev_offset; -@@ -870,6 +899,7 @@ - TRACE_D3(" Pointer Size: %d\n", (Int)address_size ); - - cc->is_type_unit = type_unit; -+ cc->is_alt_info = alt_info; - - if (type_unit) { - cc->type_signature = get_ULong( c ); -@@ -1289,6 +1319,37 @@ - (DW_FORM)get_ULEB128(c)); - return; - -+ case DW_FORM_GNU_ref_alt: -+ *cts = get_Dwarfish_UWord(c, cc->is_dw64); -+ *ctsSzB = cc->is_dw64 ? sizeof(ULong) : sizeof(UInt); -+ TRACE_D3("0x%lx", (UWord)*cts); -+ if (0) VG_(printf)("DW_FORM_GNU_ref_alt 0x%lx\n", (UWord)*cts); -+ if (/* the following 2 are surely impossible, but ... */ -+ cc->debug_info_alt_img == NULL || cc->debug_info_alt_sz == 0 -+ || *cts >= (ULong)cc->debug_info_alt_sz) { -+ /* Hmm. Offset is nonsensical for this object's .debug_info -+ section. Be safe and reject it. */ -+ cc->barf("get_Form_contents: DW_FORM_ref_addr points " -+ "outside alternate .debug_info"); -+ } -+ break; -+ -+ case DW_FORM_GNU_strp_alt: { -+ /* this is an offset into alternate .debug_str */ -+ UChar* str; -+ UWord uw = (UWord)get_Dwarfish_UWord( c, cc->is_dw64 ); -+ if (cc->debug_str_alt_img == NULL || uw >= cc->debug_str_alt_sz) -+ cc->barf("get_Form_contents: DW_FORM_GNU_strp_alt " -+ "points outside alternate .debug_str"); -+ /* FIXME: check the entire string lies inside debug_str, -+ not just the first byte of it. */ -+ str = (UChar*)cc->debug_str_alt_img + uw; -+ TRACE_D3("(indirect alt string, offset: 0x%lx): %s", uw, str); -+ *cts = (ULong)(UWord)str; -+ *ctsMemSzB = 1 + (ULong)VG_(strlen)(str); -+ break; -+ } -+ - default: - VG_(printf)( - "get_Form_contents: unhandled %d (%s) at <%lx>\n", -@@ -1579,10 +1640,13 @@ - UWord saved_die_c_offset = get_position_of_Cursor( c_die ); - UWord saved_abbv_c_offset = get_position_of_Cursor( c_abbv ); - Bool debug_types_flag; -+ Bool alt_flag; - - varstack_preen( parser, td3, level-1 ); - -- if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit) { -+ if (dtag == DW_TAG_compile_unit -+ || dtag == DW_TAG_type_unit -+ || dtag == DW_TAG_partial_unit) { - Bool have_lo = False; - Bool have_hi1 = False; - Bool have_range = False; -@@ -2028,11 +2092,14 @@ - set_position_of_Cursor( c_die, saved_die_c_offset ); - set_position_of_Cursor( c_abbv, saved_abbv_c_offset ); - VG_(printf)("\nparse_var_DIE: confused by:\n"); -- posn = uncook_die( cc, posn, &debug_types_flag ); -+ posn = uncook_die( cc, posn, &debug_types_flag, &alt_flag ); - VG_(printf)(" <%d><%lx>: %s", level, posn, ML_(pp_DW_TAG)( dtag ) ); - if (debug_types_flag) { - VG_(printf)(" (in .debug_types)"); - } -+ else if (alt_flag) { -+ VG_(printf)(" (in alternate .debug_info)"); -+ } - VG_(printf)("\n"); - while (True) { - DW_AT attr = (DW_AT) get_ULEB128( c_abbv ); -@@ -2214,6 +2281,7 @@ - TyEnt fieldE; - TyEnt boundE; - Bool debug_types_flag; -+ Bool alt_flag; - - UWord saved_die_c_offset = get_position_of_Cursor( c_die ); - UWord saved_abbv_c_offset = get_position_of_Cursor( c_abbv ); -@@ -2228,7 +2296,9 @@ - its children. */ - typestack_preen( parser, td3, level-1 ); - -- if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit) { -+ if (dtag == DW_TAG_compile_unit -+ || dtag == DW_TAG_type_unit -+ || dtag == DW_TAG_partial_unit) { - /* See if we can find DW_AT_language, since it is important for - establishing array bounds (see DW_TAG_subrange_type below in - this fn) */ -@@ -2947,10 +3017,12 @@ - set_position_of_Cursor( c_die, saved_die_c_offset ); - set_position_of_Cursor( c_abbv, saved_abbv_c_offset ); - VG_(printf)("\nparse_type_DIE: confused by:\n"); -- posn = uncook_die( cc, posn, &debug_types_flag ); -+ posn = uncook_die( cc, posn, &debug_types_flag, &alt_flag ); - VG_(printf)(" <%d><%lx>: %s", level, posn, ML_(pp_DW_TAG)( dtag ) ); - if (debug_types_flag) { - VG_(printf)(" (in .debug_types)"); -+ } else if (alt_flag) { -+ VG_(printf)(" (in alternate .debug_info)"); - } - VG_(printf)("\n"); - while (True) { -@@ -3428,7 +3500,11 @@ - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, - UChar* debug_ranges_img, SizeT debug_ranges_sz, -- UChar* debug_loc_img, SizeT debug_loc_sz -+ UChar* debug_loc_img, SizeT debug_loc_sz, -+ UChar* debug_info_alt_img, SizeT debug_info_alt_sz, -+ UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz, -+ UChar* debug_line_alt_img, SizeT debug_line_alt_sz, -+ UChar* debug_str_alt_img, SizeT debug_str_alt_sz - ) - { - XArray* /* of TyEnt */ tyents; -@@ -3668,10 +3744,10 @@ - (saC_cache) */ - parse_CU_Header( &cc, td3, &info, - (UChar*)debug_abbv_img, debug_abbv_sz, -- True ); -+ True, False ); - - /* Needed by cook_die. */ -- cc.debug_info_sz = debug_info_sz; -+ cc.types_cuOff_bias = debug_info_sz; - - record_signatured_type( signature_types, cc.type_signature, - cook_die( &cc, cc.type_offset )); -@@ -3689,15 +3765,29 @@ - } - } - -- /* Perform two DIE-reading passes. The first pass reads DIEs from -- .debug_info, and the second pass reads DIEs from .debug_types. -+ /* Perform three DIE-reading passes. The first pass reads DIEs from -+ alternate .debug_info (if any), the second pass reads DIEs from -+ .debug_info, and the third pass reads DIEs from .debug_types. - Moving the body of this loop into a separate function would - require a large number of arguments to be passed in, so it is - kept inline instead. */ -- for (pass = 0; pass < 2; ++pass) { -+ for (pass = 0; pass < 3; ++pass) { - UWord section_size; - - if (pass == 0) { -+ if (debug_info_alt_img == NULL) -+ continue; -+ /* Now loop over the Compilation Units listed in the alternate -+ .debug_info section (see D3SPEC sec 7.5) paras 1 and 2. -+ Each compilation unit contains a Compilation Unit Header -+ followed by precisely one DW_TAG_compile_unit or -+ DW_TAG_partial_unit DIE. */ -+ init_Cursor( &info, debug_info_alt_img, debug_info_alt_sz, 0, barf, -+ "Overrun whilst reading alternate .debug_info section" ); -+ section_size = debug_info_alt_sz; -+ -+ TRACE_D3("\n------ Parsing alternate .debug_info section ------\n"); -+ } else if (pass == 1) { - /* Now loop over the Compilation Units listed in the .debug_info - section (see D3SPEC sec 7.5) paras 1 and 2. Each compilation - unit contains a Compilation Unit Header followed by precisely -@@ -3769,21 +3859,32 @@ - TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset); - /* parse_CU_header initialises the CU's set_abbv_Cursor cache - (saC_cache) */ -- parse_CU_Header( &cc, td3, &info, -- (UChar*)debug_abbv_img, debug_abbv_sz, -- pass != 0 ); -- cc.debug_str_img = debug_str_img; -- cc.debug_str_sz = debug_str_sz; -+ if (pass == 0) -+ parse_CU_Header( &cc, td3, &info, -+ (UChar*)debug_abbv_alt_img, debug_abbv_alt_sz, -+ False, True ); -+ else -+ parse_CU_Header( &cc, td3, &info, -+ (UChar*)debug_abbv_img, debug_abbv_sz, -+ pass == 2, False ); -+ cc.debug_str_img = pass == 0 ? debug_str_alt_img : debug_str_img; -+ cc.debug_str_sz = pass == 0 ? debug_str_alt_sz : debug_str_sz; - cc.debug_ranges_img = debug_ranges_img; - cc.debug_ranges_sz = debug_ranges_sz; - cc.debug_loc_img = debug_loc_img; - cc.debug_loc_sz = debug_loc_sz; -- cc.debug_line_img = debug_line_img; -- cc.debug_line_sz = debug_line_sz; -- cc.debug_info_img = debug_info_img; -- cc.debug_info_sz = debug_info_sz; -+ cc.debug_line_img = pass == 0 ? debug_line_alt_img : debug_line_img; -+ cc.debug_line_sz = pass == 0 ? debug_line_alt_sz : debug_line_sz; -+ cc.debug_info_img = pass == 0 ? debug_info_alt_img : debug_info_img; -+ cc.debug_info_sz = pass == 0 ? debug_info_alt_sz : debug_info_sz; - cc.debug_types_img = debug_types_img; - cc.debug_types_sz = debug_types_sz; -+ cc.debug_info_alt_img = debug_info_alt_img; -+ cc.debug_info_alt_sz = debug_info_alt_sz; -+ cc.debug_str_alt_img = debug_str_alt_img; -+ cc.debug_str_alt_sz = debug_str_alt_sz; -+ cc.types_cuOff_bias = debug_info_sz; -+ cc.alt_cuOff_bias = debug_info_sz + debug_types_sz; - cc.cu_start_offset = cu_start_offset; - cc.di = di; - /* The CU's svma can be deduced by looking at the AT_low_pc -@@ -3966,10 +4067,19 @@ - vg_assert(dioff_lookup_tab); - - n = VG_(sizeXA)( tempvars ); -+ Word first_primary_var; -+ for (first_primary_var = 0; -+ debug_info_alt_sz && first_primary_var < n; -+ first_primary_var++) { -+ varp = *(TempVar**)VG_(indexXA)( tempvars, first_primary_var ); -+ if (varp->dioff < debug_info_sz + debug_types_sz) -+ break; -+ } - for (i = 0; i < n; i++) { -- varp = *(TempVar**)VG_(indexXA)( tempvars, i ); -- if (i > 0) { -- varp2 = *(TempVar**)VG_(indexXA)( tempvars, i-1 ); -+ varp = *(TempVar**)VG_(indexXA)( tempvars, (i + first_primary_var) % n ); -+ if (i > first_primary_var) { -+ varp2 = *(TempVar**)VG_(indexXA)( tempvars, -+ (i + first_primary_var - 1) % n ); - /* why should this hold? Only, I think, because we've - constructed the array by reading .debug_info sequentially, - and so the array .dioff fields should reflect that, and be -@@ -4223,7 +4333,11 @@ - UChar* debug_line_img, SizeT debug_line_sz, - UChar* debug_str_img, SizeT debug_str_sz, - UChar* debug_ranges_img, SizeT debug_ranges_sz, -- UChar* debug_loc_img, SizeT debug_loc_sz -+ UChar* debug_loc_img, SizeT debug_loc_sz, -+ UChar* debug_info_alt_img, SizeT debug_info_alt_sz, -+ UChar* debug_abbv_alt_img, SizeT debug_abbv_alt_sz, -+ UChar* debug_line_alt_img, SizeT debug_line_alt_sz, -+ UChar* debug_str_alt_img, SizeT debug_str_alt_sz - ) - { - volatile Int jumped; -@@ -4247,7 +4361,11 @@ - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz, - debug_ranges_img, debug_ranges_sz, -- debug_loc_img, debug_loc_sz ); -+ debug_loc_img, debug_loc_sz, -+ debug_info_alt_img, debug_info_alt_sz, -+ debug_abbv_alt_img, debug_abbv_alt_sz, -+ debug_line_alt_img, debug_line_alt_sz, -+ debug_str_alt_img, debug_str_alt_sz); - d3rd_jmpbuf_valid = False; - TRACE_D3("\n------ .debug_info reading was successful ------\n"); - } else { -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/readdwarf.c valgrind-3.7.0/coregrind/m_debuginfo/readdwarf.c ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/readdwarf.c 2012-07-25 12:33:29.191948686 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf.c 2012-07-25 12:44:30.257113055 +0200 -@@ -985,7 +985,8 @@ - void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, - UChar* unitblock_img, - UChar* debugabbrev_img, -- UChar* debugstr_img ) -+ UChar* debugstr_img, -+ UChar* debugstr_alt_img ) - { - UInt acode, abcode; - ULong atoffs, blklen; -@@ -1128,6 +1129,14 @@ - case 0x18: /* FORM_exprloc */ p += read_leb128U( &p ); break; - case 0x19: /* FORM_flag_present */break; - case 0x20: /* FORM_ref_sig8 */ p += 8; break; -+ case 0x1f20: /* FORM_GNU_ref_alt */ p += ui->dw64 ? 8 : 4; break; -+ case 0x1f21: /* FORM_GNU_strp_alt */ -+ if (debugstr_alt_img && !ui->dw64) -+ sval = debugstr_alt_img + ML_(read_UInt)(p); -+ if (debugstr_alt_img && ui->dw64) -+ sval = debugstr_alt_img + ML_(read_ULong)(p); -+ p += ui->dw64 ? 8 : 4; -+ break; - - default: - VG_(printf)( "### unhandled dwarf2 abbrev form code 0x%x\n", form ); -@@ -1169,7 +1178,8 @@ - UChar* debug_types_img, Word debug_types_sz, /* .debug_types */ - UChar* debug_abbv_img, Word debug_abbv_sz, /* .debug_abbrev */ - UChar* debug_line_img, Word debug_line_sz, /* .debug_line */ -- UChar* debug_str_img, Word debug_str_sz ) /* .debug_str */ -+ UChar* debug_str_img, Word debug_str_sz, /* .debug_str */ -+ UChar* debug_str_alt_img, Word debug_str_alt_sz ) /* .debug_str */ - { - UnitInfo ui; - UShort ver; -@@ -1218,7 +1228,8 @@ - VG_(printf)( "Reading UnitInfo at 0x%lx.....\n", - block_img - debug_info_img + 0UL ); - read_unitinfo_dwarf2( &ui, block_img, -- debug_abbv_img, debug_str_img ); -+ debug_abbv_img, debug_str_img, -+ debug_str_alt_img ); - if (0) - VG_(printf)( " => LINES=0x%llx NAME=%s DIR=%s\n", - ui.stmt_list, ui.name, ui.compdir ); -diff -ru valgrind-3.7.0.orig/coregrind/m_debuginfo/readelf.c valgrind-3.7.0/coregrind/m_debuginfo/readelf.c ---- valgrind-3.7.0.orig/coregrind/m_debuginfo/readelf.c 2012-07-25 12:33:29.191948686 +0200 -+++ valgrind-3.7.0/coregrind/m_debuginfo/readelf.c 2012-07-25 12:53:09.377151832 +0200 -@@ -111,7 +111,7 @@ - /* Identify an ELF object file by peering at the first few bytes of - it. */ - --Bool ML_(is_elf_object_file)( void* image, SizeT n_image ) -+Bool ML_(is_elf_object_file)( void* image, SizeT n_image, Bool rel_ok ) - { - ElfXX_Ehdr* ehdr = (ElfXX_Ehdr*)image; - Int ok = 1; -@@ -126,12 +126,14 @@ - ok &= (ehdr->e_ident[EI_CLASS] == VG_ELF_CLASS - && ehdr->e_ident[EI_DATA] == VG_ELF_DATA2XXX - && ehdr->e_ident[EI_VERSION] == EV_CURRENT); -- ok &= (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN); -+ ok &= (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN -+ || (rel_ok && ehdr->e_type == ET_REL)); - ok &= (ehdr->e_machine == VG_ELF_MACHINE); - ok &= (ehdr->e_version == EV_CURRENT); - ok &= (ehdr->e_shstrndx != SHN_UNDEF); - ok &= (ehdr->e_shoff != 0 && ehdr->e_shnum != 0); -- ok &= (ehdr->e_phoff != 0 && ehdr->e_phnum != 0); -+ ok &= ((ehdr->e_phoff != 0 && ehdr->e_phnum != 0) -+ || ehdr->e_type == ET_REL); - - if (ok) - return True; -@@ -887,7 +889,7 @@ - * http://fedoraproject.org/wiki/RolandMcGrath/BuildID - */ - static --Char *find_buildid(Addr image, UWord n_image) -+Char *find_buildid(Addr image, UWord n_image, Bool rel_ok) - { - Char* buildid = NULL; - __attribute__((unused)) /* on Android, at least */ -@@ -895,7 +897,7 @@ - - #ifdef NT_GNU_BUILD_ID - if (n_image >= sizeof(ElfXX_Ehdr) && -- ML_(is_elf_object_file)(ehdr, n_image)) { -+ ML_(is_elf_object_file)(ehdr, n_image, rel_ok)) { - Word i; - - for (i = 0; i < ehdr->e_phnum; i++) { -@@ -927,7 +929,41 @@ - + ((note->n_descsz + 3) & ~3); - } - } -- } -+ } -+ -+ if (buildid || !rel_ok) -+ return buildid; -+ -+ for (i = 0; i < ehdr->e_shnum; i++) { -+ ElfXX_Shdr* shdr -+ = (ElfXX_Shdr*)(image + ehdr->e_shoff + i * ehdr->e_shentsize); -+ -+ if (shdr->sh_type == SHT_NOTE) { -+ ElfXX_Off offset = shdr->sh_offset; -+ -+ while (offset < shdr->sh_offset + shdr->sh_size) { -+ ElfXX_Nhdr* note = (ElfXX_Nhdr*)(image + offset); -+ Char* name = (Char *)note + sizeof(ElfXX_Nhdr); -+ UChar *desc = (UChar *)name + ((note->n_namesz + 3) & ~3); -+ Word j2; -+ -+ if (VG_(strcmp)(name, ELF_NOTE_GNU) == 0 && -+ note->n_type == NT_GNU_BUILD_ID) { -+ buildid = ML_(dinfo_zalloc)("di.fbi.1", -+ note->n_descsz * 2 + 1); -+ -+ for (j2 = 0; j2 < note->n_descsz; j2++) { -+ VG_(sprintf)(buildid + VG_(strlen)(buildid), -+ "%02x", desc[j2]); -+ } -+ } -+ -+ offset = offset + sizeof(ElfXX_Nhdr) -+ + ((note->n_namesz + 3) & ~3) -+ + ((note->n_descsz + 3) & ~3); -+ } -+ } -+ } - } - #endif - -@@ -1009,7 +1045,8 @@ - * not match the value from the main object file. - */ - static --Addr open_debug_file( Char* name, Char* buildid, UInt crc, /*OUT*/UWord* size ) -+Addr open_debug_file( Char* name, Char* buildid, UInt crc, Bool rel_ok, -+ /*OUT*/UWord* size ) - { - SysRes fd, sres; - struct vg_stat stat_buf; -@@ -1038,7 +1075,7 @@ - return 0; - - if (buildid) { -- Char* debug_buildid = find_buildid(sr_Res(sres), *size); -+ Char* debug_buildid = find_buildid(sr_Res(sres), *size, rel_ok); - if (debug_buildid == NULL || VG_(strcmp)(buildid, debug_buildid) != 0) { - SysRes res = VG_(am_munmap_valgrind)(sr_Res(sres), *size); - vg_assert(!sr_isError(res)); -@@ -1157,7 +1194,7 @@ - static - void find_debug_file( struct _DebugInfo* di, - Char* objpath, Char* buildid, -- Char* debugname, UInt crc, -+ Char* debugname, UInt crc, Bool rel_ok, - /*OUT*/Addr* dimage, - /*OUT*/SizeT* n_dimage ) - { -@@ -1175,13 +1212,14 @@ - VG_(sprintf)(debugpath, "/usr/lib/debug/.build-id/%c%c/%s.debug", - buildid[0], buildid[1], buildid + 2); - -- if ((addr = open_debug_file(debugpath, buildid, 0, &size)) == 0) { -+ if ((addr = open_debug_file(debugpath, buildid, 0, -+ rel_ok, &size)) == 0) { - ML_(dinfo_free)(debugpath); - debugpath = NULL; - } - } - -- if (addr == 0 && debugname != NULL) { -+ if (addr == 0 && debugname != NULL && !rel_ok) { - Char *objdir = ML_(dinfo_strdup)("di.fdf.2", objpath); - Char *objdirptr; - -@@ -1194,11 +1232,11 @@ - - VG_(sprintf)(debugpath, "%s/%s", objdir, debugname); - -- if ((addr = open_debug_file(debugpath, NULL, crc, &size)) == 0) { -+ if ((addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size)) == 0) { - VG_(sprintf)(debugpath, "%s/.debug/%s", objdir, debugname); -- if ((addr = open_debug_file(debugpath, NULL, crc, &size)) == 0) { -+ if ((addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size)) == 0) { - VG_(sprintf)(debugpath, "/usr/lib/debug%s/%s", objdir, debugname); -- addr = open_debug_file(debugpath, NULL, crc, &size); -+ addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size); - } - } - -@@ -1283,7 +1321,7 @@ - /* TOPLEVEL */ - Bool res, ok; - SysRes fd, sres; -- Word i; -+ Word i, i2; - Bool dynbss_present = False; - Bool sdynbss_present = False; - -@@ -1295,6 +1333,10 @@ - Addr dimage = 0; - UWord n_dimage = 0; - -+ /* Ditto for alternate ELF debuginfo file that we might happen to load. */ -+ Addr aimage = 0; -+ UWord n_aimage = 0; -+ - /* ELF header for the main file. Should == oimage since is at - start of file. */ - ElfXX_Ehdr* ehdr_img = NULL; -@@ -1417,7 +1459,7 @@ - ehdr_img = (ElfXX_Ehdr*)oimage; - - if (ok) -- ok &= ML_(is_elf_object_file)(ehdr_img, n_oimage); -+ ok &= ML_(is_elf_object_file)(ehdr_img, n_oimage, False); - - if (!ok) { - ML_(symerr)(di, True, "Invalid ELF Header"); -@@ -2068,6 +2110,7 @@ - UChar* dynstr_img = NULL; /* .dynstr */ - ElfXX_Sym* dynsym_img = NULL; /* .dynsym */ - UChar* debuglink_img = NULL; /* .gnu_debuglink */ -+ UChar* debugaltlink_img = NULL; /* .gnu_debugaltlink */ - UChar* stab_img = NULL; /* .stab (stabs) */ - UChar* stabstr_img = NULL; /* .stabstr (stabs) */ - UChar* debug_line_img = NULL; /* .debug_line (dwarf2) */ -@@ -2078,6 +2121,10 @@ - UChar* debug_ranges_img = NULL; /* .debug_ranges (dwarf2) */ - UChar* debug_loc_img = NULL; /* .debug_loc (dwarf2) */ - UChar* debug_frame_img = NULL; /* .debug_frame (dwarf2) */ -+ UChar* debug_line_alt_img = NULL; /* .debug_line (alternate) */ -+ UChar* debug_info_alt_img = NULL; /* .debug_info (alternate) */ -+ UChar* debug_abbv_alt_img = NULL; /* .debug_abbrev (alternate) */ -+ UChar* debug_str_alt_img = NULL; /* .debug_str (alternate) */ - UChar* dwarf1d_img = NULL; /* .debug (dwarf1) */ - UChar* dwarf1l_img = NULL; /* .line (dwarf1) */ - UChar* opd_img = NULL; /* .opd (dwarf2, -@@ -2090,16 +2137,21 @@ - SizeT dynstr_sz = 0; - SizeT dynsym_sz = 0; - SizeT debuglink_sz = 0; -+ SizeT debugaltlink_sz = 0; - SizeT stab_sz = 0; - SizeT stabstr_sz = 0; - SizeT debug_line_sz = 0; - SizeT debug_info_sz = 0; -- SizeT debug_types_sz = 0; -+ SizeT debug_types_sz = 0; - SizeT debug_abbv_sz = 0; - SizeT debug_str_sz = 0; - SizeT debug_ranges_sz = 0; - SizeT debug_loc_sz = 0; - SizeT debug_frame_sz = 0; -+ SizeT debug_line_alt_sz = 0; -+ SizeT debug_info_alt_sz = 0; -+ SizeT debug_abbv_alt_sz = 0; -+ SizeT debug_str_alt_sz = 0; - SizeT dwarf1d_sz = 0; - SizeT dwarf1l_sz = 0; - SizeT opd_sz_unused = 0; -@@ -2164,6 +2216,7 @@ - FIND(".strtab", strtab_sz, strtab_img) - - FIND(".gnu_debuglink", debuglink_sz, debuglink_img) -+ FIND(".gnu_debugaltlink", debugaltlink_sz, debugaltlink_img) - - FIND(".stab", stab_sz, stab_img) - FIND(".stabstr", stabstr_sz, stabstr_img) -@@ -2209,7 +2262,7 @@ - vg_assert(dimage == 0 && n_dimage == 0); - - /* Look for a build-id */ -- buildid = find_buildid(oimage, n_oimage); -+ buildid = find_buildid(oimage, n_oimage, False); - - /* Look for a debug image */ - if (buildid != NULL || debuglink_img != NULL) { -@@ -2225,11 +2278,11 @@ - - /* See if we can find a matching debug file */ - find_debug_file( di, di->fsm.filename, buildid, -- debuglink_img, crc, &dimage, &n_dimage ); -+ debuglink_img, crc, False, &dimage, &n_dimage ); - } else { - /* See if we can find a matching debug file */ - find_debug_file( di, di->fsm.filename, buildid, -- NULL, 0, &dimage, &n_dimage ); -+ NULL, 0, False, &dimage, &n_dimage ); - } - } - -@@ -2252,7 +2305,7 @@ - SVMA/bias/size and image addresses out of it. */ - if (dimage != 0 - && n_dimage >= sizeof(ElfXX_Ehdr) -- && ML_(is_elf_object_file)((void*)dimage, n_dimage)) { -+ && ML_(is_elf_object_file)((void*)dimage, n_dimage, False)) { - - /* Pull out and validate program header and section header info */ - ElfXX_Ehdr* ehdr_dimg = (ElfXX_Ehdr*)dimage; -@@ -2437,6 +2490,8 @@ - FIND(need_dwarf2, ".debug_loc", debug_loc_sz, debug_loc_img) - FIND(need_dwarf2, ".debug_frame", debug_frame_sz, - debug_frame_img) -+ FIND(need_dwarf2, ".gnu_debugaltlink", debugaltlink_sz, -+ debugaltlink_img) - FIND(need_dwarf1, ".debug", dwarf1d_sz, dwarf1d_img) - FIND(need_dwarf1, ".line", dwarf1l_sz, dwarf1l_img) - -@@ -2444,6 +2499,100 @@ - } /* Find all interesting sections */ - } /* do we have a debug image? */ - -+ /* Look for alternate debug image */ -+ if (debugaltlink_img != NULL) { -+ UInt buildid_offset = VG_(strlen)(debugaltlink_img)+1; -+ -+ vg_assert(buildid_offset < debugaltlink_sz); -+ -+ Char *altbuildid -+ = ML_(dinfo_zalloc)("di.fbi.4", -+ (debugaltlink_sz - buildid_offset) -+ * 2 + 1); -+ -+ for (i2 = 0; i2 < debugaltlink_sz - buildid_offset; i2++) -+ VG_(sprintf)(altbuildid + 2 * i2, -+ "%02x", debugaltlink_img[buildid_offset + i2]); -+ -+ /* See if we can find a matching debug file */ -+ find_debug_file( di, di->fsm.filename, altbuildid, -+ NULL, 0, True, &aimage, &n_aimage ); -+ -+ ML_(dinfo_free)(altbuildid); -+ } -+ -+ /* TOPLEVEL */ -+ /* If we were successful in finding alternate debug image, pull various -+ size and image addresses out of it. */ -+ if (aimage != 0 -+ && n_aimage >= sizeof(ElfXX_Ehdr) -+ && ML_(is_elf_object_file)((void*)aimage, n_aimage, True)) { -+ -+ /* Pull out and validate program header and section header info */ -+ ElfXX_Ehdr* ehdr_aimg = (ElfXX_Ehdr*)aimage; -+ ElfXX_Shdr* shdr_aimg = (ElfXX_Shdr*)( ((UChar*)ehdr_aimg) -+ + ehdr_aimg->e_shoff ); -+ UWord shdr_dnent = ehdr_aimg->e_shnum; -+ UWord shdr_dent_szB = ehdr_aimg->e_shentsize; -+ UChar* shdr_strtab_aimg = NULL; -+ -+ if (shdr_dnent == 0 -+ || !contained_within( -+ aimage, n_aimage, -+ (Addr)shdr_aimg, shdr_dnent * shdr_dent_szB)) { -+ ML_(symerr)(di, True, -+ "Missing or invalid ELF Section Header Table" -+ " (alternate debuginfo file)"); -+ goto out; -+ } -+ -+ /* Also find the section header's string table, and validate. */ -+ /* checked previously by is_elf_object_file: */ -+ vg_assert( ehdr_aimg->e_shstrndx != SHN_UNDEF ); -+ -+ shdr_strtab_aimg -+ = (UChar*)( ((UChar*)ehdr_aimg) -+ + shdr_aimg[ehdr_aimg->e_shstrndx].sh_offset); -+ if (!contained_within( -+ aimage, n_aimage, -+ (Addr)shdr_strtab_aimg, -+ 1/*bogus, but we don't know the real size*/ )) { -+ ML_(symerr)(di, True, -+ "Invalid ELF Section Header String Table" -+ " (alternate debuginfo file)"); -+ goto out; -+ } -+ -+ /* Find all interesting sections */ -+ for (i = 0; i < ehdr_aimg->e_shnum; i++) { -+ -+# define FIND(sec_name, sec_size, sec_img) \ -+ do { ElfXX_Shdr* shdr \ -+ = INDEX_BIS( shdr_aimg, i, shdr_dent_szB ); \ -+ if (0 == VG_(strcmp)(sec_name, \ -+ shdr_strtab_aimg + shdr->sh_name)) { \ -+ if (0 != sec_img) \ -+ VG_(core_panic)("repeated section!\n"); \ -+ sec_img = (void*)(aimage + shdr->sh_offset); \ -+ sec_size = shdr->sh_size; \ -+ TRACE_SYMTAB( "%18s: aimg %p .. %p\n", \ -+ sec_name, \ -+ (UChar*)sec_img, \ -+ ((UChar*)sec_img) + sec_size - 1); \ -+ } \ -+ } while (0); -+ -+ /* NAME SIZE IMAGE addr */ -+ FIND(".debug_line", debug_line_alt_sz, debug_line_alt_img) -+ FIND(".debug_info", debug_info_alt_sz, debug_info_alt_img) -+ FIND(".debug_abbrev", debug_abbv_alt_sz, debug_abbv_alt_img) -+ FIND(".debug_str", debug_str_alt_sz, debug_str_alt_img) -+ -+# undef FIND -+ } /* Find all interesting sections */ -+ } /* do we have a debug image? */ -+ -+ - /* TOPLEVEL */ - /* Check some sizes */ - vg_assert((dynsym_sz % sizeof(ElfXX_Sym)) == 0); -@@ -2524,7 +2673,8 @@ - debug_types_img, debug_types_sz, - debug_abbv_img, debug_abbv_sz, - debug_line_img, debug_line_sz, -- debug_str_img, debug_str_sz ); -+ debug_str_img, debug_str_sz, -+ debug_str_alt_img, debug_str_alt_sz ); - - /* The new reader: read the DIEs in .debug_info to acquire - information on variable types and locations. But only if -@@ -2539,7 +2689,11 @@ - debug_line_img, debug_line_sz, - debug_str_img, debug_str_sz, - debug_ranges_img, debug_ranges_sz, -- debug_loc_img, debug_loc_sz -+ debug_loc_img, debug_loc_sz, -+ debug_info_alt_img, debug_info_alt_sz, -+ debug_abbv_alt_img, debug_abbv_alt_sz, -+ debug_line_alt_img, debug_line_alt_sz, -+ debug_str_alt_img, debug_str_alt_sz - ); - } - } diff --git a/valgrind-3.7.0-enable-armv5.patch b/valgrind-3.7.0-enable-armv5.patch deleted file mode 100644 index 4d05cb8..0000000 --- a/valgrind-3.7.0-enable-armv5.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- valgrind-3.7.0.old/configure.in 2012-03-05 15:16:23.000000000 -0500 -+++ valgrind-3.7.0/configure.in 2012-03-05 13:49:04.000000000 -0500 -@@ -175,7 +175,7 @@ case "${host_cpu}" in - ARCH_MAX="s390x" - ;; - -- armv7*) -+ armv[57]*) - AC_MSG_RESULT([ok (${host_cpu})]) - ARCH_MAX="arm" - ;; ---- valgrind-3.7.0.old/configure 2012-03-05 15:16:23.000000000 -0500 -+++ valgrind-3.7.0/configure 2012-03-05 13:49:04.000000000 -0500 -@@ -5279,7 +5279,7 @@ - ARCH_MAX="s390x" - ;; - -- armv7*) -+ armv[57]*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${host_cpu})" >&5 - $as_echo "ok (${host_cpu})" >&6; } - ARCH_MAX="arm" diff --git a/valgrind-3.7.0-f-sgetown-ex.patch b/valgrind-3.7.0-f-sgetown-ex.patch deleted file mode 100644 index dbb5486..0000000 --- a/valgrind-3.7.0-f-sgetown-ex.patch +++ /dev/null @@ -1,180 +0,0 @@ ---- valgrind-3.7.0/include/vki/vki-ppc64-linux.h.jj 2010-10-08 11:14:21.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-ppc64-linux.h 2012-01-27 16:45:19.418707191 +0100 -@@ -386,6 +386,16 @@ struct vki_sigcontext { - #define VKI_F_SETSIG 10 /* for sockets. */ - #define VKI_F_GETSIG 11 /* for sockets. */ - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - /* for F_[GET|SET]FL */ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - ---- valgrind-3.7.0/include/vki/vki-arm-linux.h.jj 2011-03-28 16:09:17.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-arm-linux.h 2012-01-27 16:44:48.356887209 +0100 -@@ -270,6 +270,16 @@ struct vki_sigcontext { - #define VKI_F_SETLK64 13 - #define VKI_F_SETLKW64 14 - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - /* for F_[GET|SET]FL */ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - ---- valgrind-3.7.0/include/vki/vki-x86-linux.h.jj 2010-10-08 11:14:21.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-x86-linux.h 2012-01-27 16:43:45.727249836 +0100 -@@ -308,6 +308,16 @@ struct vki_sigcontext { - #define VKI_F_SETLK64 13 - #define VKI_F_SETLKW64 14 - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - /* for F_[GET|SET]FL */ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - ---- valgrind-3.7.0/include/vki/vki-ppc32-linux.h.jj 2010-10-08 11:14:21.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-ppc32-linux.h 2012-01-27 16:45:11.912752106 +0100 -@@ -337,6 +337,16 @@ struct vki_sigcontext { - #define VKI_F_SETLK64 13 - #define VKI_F_SETLKW64 14 - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - /* for F_[GET|SET]FL */ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - ---- valgrind-3.7.0/include/vki/vki-s390x-linux.h.jj 2011-06-08 17:26:29.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-s390x-linux.h 2012-01-27 16:45:31.078639504 +0100 -@@ -332,6 +332,16 @@ typedef struct vki_sigaltstack { - #define VKI_F_SETSIG 10 /* for sockets. */ - #define VKI_F_GETSIG 11 /* for sockets. */ - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - - #define VKI_F_LINUX_SPECIFIC_BASE 1024 ---- valgrind-3.7.0/include/vki/vki-amd64-linux.h.jj 2010-10-08 11:14:21.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-amd64-linux.h 2012-01-27 16:44:23.592030914 +0100 -@@ -268,6 +268,16 @@ struct vki_sigcontext { - #define VKI_F_SETSIG 10 /* for sockets. */ - #define VKI_F_GETSIG 11 /* for sockets. */ - -+#define VKI_F_SETOWN_EX 15 -+#define VKI_F_GETOWN_EX 16 -+ -+struct vki_f_owner_ex -+{ -+ enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP } -+ type; /* Owner type of ID. */ -+ __vki_kernel_pid_t pid; /* ID of owner. */ -+}; -+ - #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */ - - #define VKI_F_LINUX_SPECIFIC_BASE 1024 ---- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2011-08-02 14:49:29.000000000 +0200 -+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2012-01-27 17:08:11.621732289 +0100 -@@ -3778,6 +3778,22 @@ PRE(sys_fcntl) - struct flock64 *, lock); - break; - -+ case VKI_F_SETOWN_EX: -+ PRINT("sys_fcntl[F_SETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); -+ PRE_REG_READ3(long, "fcntl", -+ unsigned int, fd, unsigned int, cmd, -+ struct vki_f_owner_ex *, arg); -+ PRE_MEM_READ("fcntl(F_SETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex)); -+ break; -+ -+ case VKI_F_GETOWN_EX: -+ PRINT("sys_fcntl[F_GETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); -+ PRE_REG_READ3(long, "fcntl", -+ unsigned int, fd, unsigned int, cmd, -+ struct vki_f_owner_ex *, arg); -+ PRE_MEM_WRITE("fcntl(F_GETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex)); -+ break; -+ - default: - PRINT("sys_fcntl[UNKNOWN] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); - I_die_here; -@@ -3812,6 +3828,8 @@ POST(sys_fcntl) - if (VG_(clo_track_fds)) - ML_(record_fd_open_named)(tid, RES); - } -+ } else if (ARG2 == VKI_F_GETOWN_EX) { -+ POST_MEM_WRITE(ARG3, sizeof(struct vki_f_owner_ex)); - } - } - -@@ -3857,6 +3875,22 @@ PRE(sys_fcntl64) - unsigned int, fd, unsigned int, cmd, - struct flock64 *, lock); - break; -+ -+ case VKI_F_SETOWN_EX: -+ PRINT("sys_fcntl[F_SETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); -+ PRE_REG_READ3(long, "fcntl", -+ unsigned int, fd, unsigned int, cmd, -+ struct vki_f_owner_ex *, arg); -+ PRE_MEM_READ("fcntl(F_SETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex)); -+ break; -+ -+ case VKI_F_GETOWN_EX: -+ PRINT("sys_fcntl[F_GETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); -+ PRE_REG_READ3(long, "fcntl", -+ unsigned int, fd, unsigned int, cmd, -+ struct vki_f_owner_ex *, arg); -+ PRE_MEM_WRITE("fcntl(F_GETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex)); -+ break; - } - - # if defined(VGP_x86_linux) -@@ -3887,6 +3921,8 @@ POST(sys_fcntl64) - if (VG_(clo_track_fds)) - ML_(record_fd_open_named)(tid, RES); - } -+ } else if (ARG2 == VKI_F_GETOWN_EX) { -+ POST_MEM_WRITE(ARG3, sizeof(struct vki_f_owner_ex)); - } - } - diff --git a/valgrind-3.7.0-glibc-2.15.patch b/valgrind-3.7.0-glibc-2.15.patch deleted file mode 100644 index cca6674..0000000 --- a/valgrind-3.7.0-glibc-2.15.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- valgrind-3.7.0/configure.in.jj 2011-11-05 12:13:30.000000000 +0100 -+++ valgrind-3.7.0/configure.in 2011-12-09 17:48:21.409848842 +0100 -@@ -775,6 +775,13 @@ case "${GLIBC_VERSION}" in - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.15) -+ AC_MSG_RESULT(2.15 family) -+ AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x]) -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - AC_MSG_RESULT(Darwin) - AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) -@@ -788,7 +795,7 @@ case "${GLIBC_VERSION}" in - - *) - AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) -- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14]) -+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15]) - AC_MSG_ERROR([or Darwin libc]) - ;; - esac ---- valgrind-3.7.0/config.h.in.jj 2011-10-26 23:25:55.000000000 +0200 -+++ valgrind-3.7.0/config.h.in 2011-12-09 17:47:42.385804043 +0100 -@@ -39,6 +39,9 @@ - /* Define to 1 if you're using glibc 2.14.x */ - #undef GLIBC_2_14 - -+/* Define to 1 if you're using glibc 2.15.x */ -+#undef GLIBC_2_15 -+ - /* Define to 1 if you're using glibc 2.2.x */ - #undef GLIBC_2_2 - ---- valgrind-3.7.0/configure.jj 2011-11-05 12:24:39.000000000 +0100 -+++ valgrind-3.7.0/configure 2011-12-09 17:48:58.371930777 +0100 -@@ -6402,6 +6402,16 @@ $as_echo "#define GLIBC_2_14 1" >>confde - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.15) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.15 family" >&5 -+$as_echo "2.15 family" >&6; } -+ -+$as_echo "#define GLIBC_2_15 1" >>confdefs.h -+ -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5 - $as_echo "Darwin" >&6; } -@@ -6422,7 +6432,7 @@ $as_echo "#define BIONIC_LIBC 1" >>confd - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported version ${GLIBC_VERSION}" >&5 - $as_echo "unsupported version ${GLIBC_VERSION}" >&6; } -- as_fn_error "Valgrind requires glibc version 2.2 - 2.14" "$LINENO" 5 -+ as_fn_error "Valgrind requires glibc version 2.2 - 2.15" "$LINENO" 5 - as_fn_error "or Darwin libc" "$LINENO" 5 - ;; - esac diff --git a/valgrind-3.7.0-glibc-2.16.patch b/valgrind-3.7.0-glibc-2.16.patch deleted file mode 100644 index 911549d..0000000 --- a/valgrind-3.7.0-glibc-2.16.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -ur valgrind-3.7.0.orig/configure valgrind-3.7.0/configure ---- valgrind-3.7.0.orig/configure 2012-07-25 15:08:56.846744849 +0200 -+++ valgrind-3.7.0/configure 2012-07-25 15:12:59.690471999 +0200 -@@ -6414,6 +6426,16 @@ - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.16) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.16 family" >&5 -+$as_echo "2.16 family" >&6; } -+ -+$as_echo "#define GLIBC_2_16 1" >>confdefs.h -+ -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5 - $as_echo "Darwin" >&6; } -@@ -6434,8 +6456,8 @@ - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported version ${GLIBC_VERSION}" >&5 - $as_echo "unsupported version ${GLIBC_VERSION}" >&6; } -- as_fn_error "Valgrind requires glibc version 2.2 - 2.15" "$LINENO" 5 -- as_fn_error "or Darwin libc" "$LINENO" 5 -+ as_fn_error "Valgrind requires glibc version 2.2 - 2.16" "$LINENO" 5 -+ as_fn_error "or Darwin libc" "$LINENO" 5 - ;; - esac - -diff -ur valgrind-3.7.0.orig/configure.in valgrind-3.7.0/configure.in ---- valgrind-3.7.0.orig/configure.in 2012-07-25 15:08:56.757743484 +0200 -+++ valgrind-3.7.0/configure.in 2012-07-25 15:11:40.138250933 +0200 -@@ -782,6 +782,13 @@ - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.16) -+ AC_MSG_RESULT(2.16 family) -+ AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x]) -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - AC_MSG_RESULT(Darwin) - AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) -@@ -795,7 +802,7 @@ - - *) - AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) -- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15]) -+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.16]) - AC_MSG_ERROR([or Darwin libc]) - ;; - esac diff --git a/valgrind-3.7.0-helgrind-race-supp.patch b/valgrind-3.7.0-helgrind-race-supp.patch deleted file mode 100644 index 2fe5e07..0000000 --- a/valgrind-3.7.0-helgrind-race-supp.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- valgrind/glibc-2.34567-NPTL-helgrind.supp.jj 2009-08-19 15:37:48.000000000 +0200 -+++ valgrind/glibc-2.34567-NPTL-helgrind.supp 2009-10-21 16:46:31.000000000 +0200 -@@ -88,6 +88,12 @@ - obj:/lib*/libpthread-2.*so* - } - { -+ helgrind-glibc2X-102a -+ Helgrind:Race -+ fun:mythread_wrapper -+ obj:*vgpreload_helgrind*.so -+} -+{ - helgrind-glibc2X-103 - Helgrind:Race - fun:pthread_cond_*@@GLIBC_2.* diff --git a/valgrind-3.7.0-ldso-supp.patch b/valgrind-3.7.0-ldso-supp.patch deleted file mode 100644 index 1f999b8..0000000 --- a/valgrind-3.7.0-ldso-supp.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- valgrind-3.7.0/glibc-2.X.supp.in.jj 2011-10-26 23:24:45.000000000 +0200 -+++ valgrind-3.7.0/glibc-2.X.supp.in 2012-05-07 10:55:20.395942656 +0200 -@@ -124,7 +124,7 @@ - glibc-2.5.x-on-SUSE-10.2-(PPC)-2a - Memcheck:Cond - fun:index -- obj:*ld-@GLIBC_VERSION@.*.so -+ obj:*ld-@GLIBC_VERSION@*.so - } - { - glibc-2.5.x-on-SuSE-10.2-(PPC)-2b -@@ -136,14 +136,14 @@ - glibc-2.5.5-on-SuSE-10.2-(PPC)-2c - Memcheck:Addr4 - fun:index -- obj:*ld-@GLIBC_VERSION@.*.so -+ obj:*ld-@GLIBC_VERSION@*.so - } - { - glibc-2.3.5-on-SuSE-10.1-(PPC)-3 - Memcheck:Addr4 - fun:*wordcopy_fwd_dest_aligned* - fun:mem*cpy -- obj:*lib*@GLIBC_VERSION@.*.so -+ obj:*lib*@GLIBC_VERSION@*.so - } - - { diff --git a/valgrind-3.7.0-openat.patch b/valgrind-3.7.0-openat.patch deleted file mode 100644 index 26070ef..0000000 --- a/valgrind-3.7.0-openat.patch +++ /dev/null @@ -1,38 +0,0 @@ -Testcase: -#define _GNU_SOURCE -#include -#include - -int -main (void) -{ - int dfd = open ("/tmp", O_RDONLY); - int fd1 = openat (dfd, "abc", O_RDONLY); - int fd2 = openat (0x12345678, "/tmp/abc", O_RDONLY); - int fd3 = openat (AT_FDCWD, "abc", O_RDONLY); - /* This is the only one that should warn. */ - int fd4 = openat (0x12345678, "abc", O_RDONLY); - return 0; -} - ---- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2007-12-11 00:18:43.000000000 +0100 -+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2008-03-03 11:35:15.000000000 +0100 -@@ -2455,10 +2455,15 @@ PRE(sys_openat) - int, dfd, const char *, filename, int, flags); - } - -- if (ARG1 != VKI_AT_FDCWD && !ML_(fd_allowed)(ARG1, "openat", tid, False)) -+ PRE_MEM_RASCIIZ( "openat(filename)", ARG2 ); -+ -+ /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD, -+ filename is relative to cwd. */ -+ if (ML_(safe_to_deref)( (void*)ARG2, 1 ) -+ && *(Char *)ARG2 != '/' -+ && ARG1 != VKI_AT_FDCWD -+ && !ML_(fd_allowed)(ARG1, "openat", tid, False)) - SET_STATUS_Failure( VKI_EBADF ); -- else -- PRE_MEM_RASCIIZ( "openat(filename)", ARG2 ); - - /* Handle the case where the open is of /proc/self/cmdline or - /proc//cmdline, and just give it a copy of the fd for the diff --git a/valgrind-3.7.0-pie.patch b/valgrind-3.7.0-pie.patch deleted file mode 100644 index 26c976b..0000000 --- a/valgrind-3.7.0-pie.patch +++ /dev/null @@ -1,40 +0,0 @@ -From eb8d355b64e72bfdf1c8dd2534b1625d5d0118e0 Mon Sep 17 00:00:00 2001 -From: Dodji Seketeli -Date: Thu, 13 Jan 2011 16:04:39 +0100 -Subject: [PATCH] Fix crash loading certain binaries on ppc64 - -Increase the space left for VDSO on ppc64 compiled with 64KB page -size. the size of VDSO is at least 2 pages: one for the code and one -for the data. We ought to leave more than two page space then. The -patch leaves 8 pages space to comply with what is done already for 4KB -page sizes. ---- - coregrind/m_ume/elf.c | 10 ++++++---- - 1 files changed, 6 insertions(+), 4 deletions(-) - ---- valgrind/coregrind/m_ume/elf.c -+++ valgrind/coregrind/m_ume/elf.c -@@ -327,6 +327,7 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) - /* The kernel maps position-independent executables at TASK_SIZE*2/3; - duplicate this behavior as close as we can. */ - if (e->e.e_type == ET_DYN && ebase == 0) { -+ ESZ(Addr) hacky_load_address; - ebase = VG_PGROUNDDN(info->exe_base - + (info->exe_end - info->exe_base) * 2 / 3); - /* We really don't want to load PIEs at zero or too close. It -@@ -336,10 +337,11 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) - nonpointers. So, hackily, move it above 1MB. */ - /* Later .. is appears ppc32-linux tries to put [vdso] at 1MB, - which totally screws things up, because nothing else can go -- there. So bump the hacky load addess along by 0x8000, to -- 0x108000. */ -- if (ebase < 0x108000) -- ebase = 0x108000; -+ there. The size of [vdso] is around 2 or 3 pages, so bump -+ the hacky load addess along by 8 * VKI_PAGE_SIZE to be safe. */ -+ hacky_load_address = 0x100000 + 8 * VKI_PAGE_SIZE; -+ if (ebase < hacky_load_address) -+ ebase = hacky_load_address; - } - - info->phnum = e->e.e_phnum; diff --git a/valgrind-3.7.0-ref_addr.patch b/valgrind-3.7.0-ref_addr.patch deleted file mode 100644 index d62cb79..0000000 --- a/valgrind-3.7.0-ref_addr.patch +++ /dev/null @@ -1,29 +0,0 @@ -r12545 | sewardj | 2012-04-29 13:35:37 +0200 (Sun, 29 Apr 2012) | 3 lines - -Correctly parse DW_FORM_ref_addr -- its format is different in Dwarf2 -vs Dwarf3 and later. Fixes #298864. (Tom Tromey, tromey@redhat.com) - -Index: coregrind/m_debuginfo/readdwarf3.c -=================================================================== ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12544) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12545) -@@ -1152,9 +1152,17 @@ - So for the moment we merely range-check, to see that they - actually do specify a plausible offset within this - object's .debug_info, and return the value unchanged. -+ -+ In DWARF 2, DW_FORM_ref_addr is address-sized, but in -+ DWARF 3 and later, it is offset-sized. - */ -- *cts = (ULong)(UWord)get_UWord(c); -- *ctsSzB = sizeof(UWord); -+ if (cc->version == 2) { -+ *cts = (ULong)(UWord)get_UWord(c); -+ *ctsSzB = sizeof(UWord); -+ } else { -+ *cts = get_Dwarfish_UWord(c, cc->is_dw64); -+ *ctsSzB = cc->is_dw64 ? sizeof(ULong) : sizeof(UInt); -+ } - TRACE_D3("0x%lx", (UWord)*cts); - if (0) VG_(printf)("DW_FORM_ref_addr 0x%lx\n", (UWord)*cts); - if (/* the following 2 are surely impossible, but ... */ diff --git a/valgrind-3.7.0-rvalue-ref.patch b/valgrind-3.7.0-rvalue-ref.patch deleted file mode 100644 index 677c4a3..0000000 --- a/valgrind-3.7.0-rvalue-ref.patch +++ /dev/null @@ -1,201 +0,0 @@ ---- valgrind-3.7.0/coregrind/m_debuginfo/tytypes.c (revision 12361) -+++ valgrind-3.7.0/coregrind/m_debuginfo/tytypes.c (revision 12362) -@@ -54,9 +54,10 @@ Bool ML_(TyEnt__is_type)( TyEnt* te ) - case Te_EMPTY: case Te_INDIR: case Te_UNKNOWN: - case Te_Atom: case Te_Field: case Te_Bound: - return False; -- case Te_TyBase: case Te_TyPorR: case Te_TyTyDef: -- case Te_TyStOrUn: case Te_TyEnum: case Te_TyArray: -- case Te_TyFn: case Te_TyQual: case Te_TyVoid: -+ case Te_TyBase: case Te_TyPtr: case Te_TyRef: -+ case Te_TyPtrMbr: case Te_TyRvalRef: case Te_TyTyDef: -+ case Te_TyStOrUn: case Te_TyEnum: case Te_TyArray: -+ case Te_TyFn: case Te_TyQual: case Te_TyVoid: - return True; - default: - vg_assert(0); -@@ -127,10 +128,20 @@ void ML_(pp_TyEnt)( TyEnt* te ) - te->Te.TyBase.name ? te->Te.TyBase.name - : (UChar*)"(null)" ); - break; -- case Te_TyPorR: -- VG_(printf)("Te_TyPorR(%d,%c,0x%05lx)", -- te->Te.TyPorR.szB, -- te->Te.TyPorR.isPtr ? 'P' : 'R', -+ case Te_TyPtr: -+ VG_(printf)("Te_TyPtr(%d,0x%05lx)", te->Te.TyPorR.szB, -+ te->Te.TyPorR.typeR); -+ break; -+ case Te_TyRef: -+ VG_(printf)("Te_TyRef(%d,0x%05lx)", te->Te.TyPorR.szB, -+ te->Te.TyPorR.typeR); -+ break; -+ case Te_TyPtrMbr: -+ VG_(printf)("Te_TyMbr(%d,0x%05lx)", te->Te.TyPorR.szB, -+ te->Te.TyPorR.typeR); -+ break; -+ case Te_TyRvalRef: -+ VG_(printf)("Te_TyRvalRef(%d,0x%05lx)", te->Te.TyPorR.szB, - te->Te.TyPorR.typeR); - break; - case Te_TyTyDef: -@@ -237,9 +248,21 @@ void ML_(pp_TyEnt_C_ishly)( XArray* /* o - if (!ent->Te.TyBase.name) goto unhandled; - VG_(printf)("%s", ent->Te.TyBase.name); - break; -- case Te_TyPorR: -+ case Te_TyPtr: - ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyPorR.typeR); -- VG_(printf)("%s", ent->Te.TyPorR.isPtr ? "*" : "&"); -+ VG_(printf)("*"); -+ break; -+ case Te_TyRef: -+ ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyPorR.typeR); -+ VG_(printf)("&"); -+ break; -+ case Te_TyPtrMbr: -+ ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyPorR.typeR); -+ VG_(printf)("*"); -+ break; -+ case Te_TyRvalRef: -+ ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyPorR.typeR); -+ VG_(printf)("&&"); - break; - case Te_TyEnum: - if (!ent->Te.TyEnum.name) goto unhandled; -@@ -503,12 +526,13 @@ Word ML_(TyEnt__cmp_by_all_except_cuOff) - if (r != 0) return r; - r = Asciiz__cmp(te1->Te.TyBase.name, te2->Te.TyBase.name); - return r; -- case Te_TyPorR: -+ case Te_TyPtr: -+ case Te_TyRef: -+ case Te_TyPtrMbr: -+ case Te_TyRvalRef: - r = Int__cmp(te1->Te.TyPorR.szB, te2->Te.TyPorR.szB); - if (r != 0) return r; - r = UWord__cmp(te1->Te.TyPorR.typeR, te2->Te.TyPorR.typeR); -- if (r != 0) return r; -- r = Bool__cmp(te1->Te.TyPorR.isPtr, te2->Te.TyPorR.isPtr); - return r; - case Te_TyTyDef: - r = UWord__cmp(te1->Te.TyTyDef.typeR, te2->Te.TyTyDef.typeR); -@@ -584,7 +608,10 @@ void ML_(TyEnt__make_EMPTY) ( TyEnt* te - case Te_TyBase: - if (te->Te.TyBase.name) ML_(dinfo_free)(te->Te.TyBase.name); - break; -- case Te_TyPorR: -+ case Te_TyPtr: -+ case Te_TyRef: -+ case Te_TyPtrMbr: -+ case Te_TyRvalRef: - break; - case Te_TyTyDef: - if (te->Te.TyTyDef.name) ML_(dinfo_free)(te->Te.TyTyDef.name); -@@ -661,7 +688,10 @@ MaybeULong ML_(sizeOfType)( XArray* /* o - if (ent2->tag == Te_UNKNOWN) - return mk_MaybeULong_Nothing(); /*UNKNOWN*/ - return ML_(sizeOfType)( tyents, ent->Te.TyTyDef.typeR ); -- case Te_TyPorR: -+ case Te_TyPtr: -+ case Te_TyRef: -+ case Te_TyPtrMbr: -+ case Te_TyRvalRef: - vg_assert(ent->Te.TyPorR.szB == 4 || ent->Te.TyPorR.szB == 8); - return mk_MaybeULong_Just( ent->Te.TyPorR.szB ); - case Te_TyStOrUn: -@@ -738,7 +768,10 @@ XArray* /*UChar*/ ML_(describe_type)( /* - case Te_TyEnum: - case Te_TyFn: - case Te_TyVoid: -- case Te_TyPorR: -+ case Te_TyPtr: -+ case Te_TyRef: -+ case Te_TyPtrMbr: -+ case Te_TyRvalRef: - case Te_TyBase: - goto done; - ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12361) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12362) -@@ -2221,19 +2221,41 @@ static void parse_type_DIE ( /*MOD*/XArr - goto acquire_Type; - } - -+ /* -+ * An example of DW_TAG_rvalue_reference_type: -+ * -+ * $ readelf --debug-dump /usr/lib/debug/usr/lib/libstdc++.so.6.0.16.debug -+ * <1><1014>: Abbrev Number: 55 (DW_TAG_rvalue_reference_type) -+ * <1015> DW_AT_byte_size : 4 -+ * <1016> DW_AT_type : <0xe52> -+ */ - if (dtag == DW_TAG_pointer_type || dtag == DW_TAG_reference_type -- || dtag == DW_TAG_ptr_to_member_type) { -+ || dtag == DW_TAG_ptr_to_member_type -+ || dtag == DW_TAG_rvalue_reference_type) { - /* This seems legit for _pointer_type and _reference_type. I - don't know if rolling _ptr_to_member_type in here really is - legit, but it's better than not handling it at all. */ - VG_(memset)(&typeE, 0, sizeof(typeE)); - typeE.cuOff = D3_INVALID_CUOFF; -- typeE.tag = Te_TyPorR; -+ switch (dtag) { -+ case DW_TAG_pointer_type: -+ typeE.tag = Te_TyPtr; -+ break; -+ case DW_TAG_reference_type: -+ typeE.tag = Te_TyRef; -+ break; -+ case DW_TAG_ptr_to_member_type: -+ typeE.tag = Te_TyPtrMbr; -+ break; -+ case DW_TAG_rvalue_reference_type: -+ typeE.tag = Te_TyRvalRef; -+ break; -+ default: -+ vg_assert(False); -+ } - /* target type defaults to void */ - typeE.Te.TyPorR.typeR = D3_FAKEVOID_CUOFF; -- typeE.Te.TyPorR.isPtr = dtag == DW_TAG_pointer_type -- || dtag == DW_TAG_ptr_to_member_type; -- /* These three type kinds don't *have* to specify their size, in -+ /* These four type kinds don't *have* to specify their size, in - which case we assume it's a machine word. But if they do - specify it, it must be a machine word :-) This probably - assumes that the word size of the Dwarf3 we're reading is the -@@ -2882,7 +2904,10 @@ static Bool TyEnt__subst_R_fields ( XArr - break; - case Te_TyBase: - break; -- case Te_TyPorR: -+ case Te_TyPtr: -+ case Te_TyRef: -+ case Te_TyPtrMbr: -+ case Te_TyRvalRef: - te->Te.TyPorR.typeR - = chase_cuOff( &b, ents, ents_cache, te->Te.TyPorR.typeR ); - if (b) changed = True; ---- valgrind-3.7.0/coregrind/m_debuginfo/priv_tytypes.h (revision 12361) -+++ valgrind-3.7.0/coregrind/m_debuginfo/priv_tytypes.h (revision 12362) -@@ -45,7 +45,10 @@ typedef - Te_Field, /* struct/class field defn */ - Te_Bound, /* array bounds indication, for one dimension */ - Te_TyBase, /* base type */ -- Te_TyPorR, /* pointer or reference type */ -+ Te_TyPtr, /* pointer type */ -+ Te_TyRef, /* reference type */ -+ Te_TyPtrMbr, /* pointer to member type */ -+ Te_TyRvalRef,/* rvalue reference type */ - Te_TyTyDef, /* a renaming of some other type */ - Te_TyStOrUn, /* structure or union type */ - Te_TyEnum, /* an enum type */ -@@ -101,7 +104,6 @@ typedef - struct { - Int szB; - UWord typeR; -- Bool isPtr; - } TyPorR; - struct { - UChar* name; /* in mallocville */ diff --git a/valgrind-3.7.0-scsi-ioctls.patch b/valgrind-3.7.0-scsi-ioctls.patch deleted file mode 100644 index 37890f4..0000000 --- a/valgrind-3.7.0-scsi-ioctls.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- valgrind-3.7.0/include/vki/vki-linux.h.jj 2011-10-26 23:24:31.000000000 +0200 -+++ valgrind-3.7.0/include/vki/vki-linux.h 2012-01-27 16:11:53.373379491 +0100 -@@ -1730,6 +1730,15 @@ typedef struct vki_sg_scsi_id { /* used - #define VKI_SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1 */ - - //---------------------------------------------------------------------- -+// From linux-2.6.34/include/scsi/scsi.h and scsi/scsi_ioctl.h -+//---------------------------------------------------------------------- -+ -+#define VKI_SCSI_IOCTL_DOORLOCK 0x5380 /* Lock the eject mechanism. */ -+#define VKI_SCSI_IOCTL_DOORUNLOCK 0x5381 /* Unlock the mechanism. */ -+#define VKI_SCSI_IOCTL_GET_IDLUN 0x5382 -+#define VKI_SCSI_IOCTL_GET_BUS_NUMBER 0x5386 -+ -+//---------------------------------------------------------------------- - // From linux-2.6.8.1/include/linux/cdrom.h - //---------------------------------------------------------------------- - ---- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2012-01-27 13:27:26.000000000 +0100 -+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2012-01-27 16:18:05.377177786 +0100 -@@ -3935,6 +3935,10 @@ PRE(sys_ioctl) - case VKI_SNDRV_TIMER_IOCTL_STOP: - case VKI_SNDRV_TIMER_IOCTL_CONTINUE: - case VKI_SNDRV_TIMER_IOCTL_PAUSE: -+ -+ /* SCSI no operand */ -+ case VKI_SCSI_IOCTL_DOORLOCK: -+ case VKI_SCSI_IOCTL_DOORUNLOCK: - PRINT("sys_ioctl ( %ld, 0x%lx )",ARG1,ARG2); - PRE_REG_READ2(long, "ioctl", - unsigned int, fd, unsigned int, request); -@@ -4420,6 +4424,14 @@ PRE(sys_ioctl) - VKI_SIZEOF_STRUCT_HD_DRIVEID ); - break; - -+ /* SCSI */ -+ case VKI_SCSI_IOCTL_GET_IDLUN: /* 0x5382 */ -+ PRE_MEM_WRITE( "ioctl(SCSI_IOCTL_GET_IDLUN)", ARG3, 2*sizeof(int)); -+ break; -+ case VKI_SCSI_IOCTL_GET_BUS_NUMBER: /* 0x5386 */ -+ PRE_MEM_WRITE( "ioctl(SCSI_IOCTL_GET_BUS_NUMBER)", ARG3, sizeof(int)); -+ break; -+ - /* CD ROM stuff (??) */ - case VKI_CDROM_GET_MCN: - PRE_MEM_READ( "ioctl(CDROM_GET_MCN)", ARG3, -@@ -5521,6 +5533,10 @@ POST(sys_ioctl) - case VKI_SNDRV_TIMER_IOCTL_STOP: - case VKI_SNDRV_TIMER_IOCTL_CONTINUE: - case VKI_SNDRV_TIMER_IOCTL_PAUSE: -+ -+ /* SCSI no operand */ -+ case VKI_SCSI_IOCTL_DOORLOCK: -+ case VKI_SCSI_IOCTL_DOORUNLOCK: - break; - - /* Real Time Clock (/dev/rtc) ioctls */ -@@ -5587,6 +5603,14 @@ POST(sys_ioctl) - POST_MEM_WRITE(ARG3, VKI_SIZEOF_STRUCT_HD_DRIVEID ); - break; - -+ /* SCSI */ -+ case VKI_SCSI_IOCTL_GET_IDLUN: /* 0x5382 */ -+ POST_MEM_WRITE(ARG3, 2*sizeof(int)); -+ break; -+ case VKI_SCSI_IOCTL_GET_BUS_NUMBER: /* 0x5386 */ -+ POST_MEM_WRITE(ARG3, sizeof(int)); -+ break; -+ - /* CD ROM stuff (??) */ - case VKI_CDROMSUBCHNL: - POST_MEM_WRITE(ARG3, sizeof(struct vki_cdrom_subchnl)); diff --git a/valgrind-3.7.0-stat_h.patch b/valgrind-3.7.0-stat_h.patch deleted file mode 100644 index 2b9304e..0000000 --- a/valgrind-3.7.0-stat_h.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- valgrind/include/vki/vki-amd64-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 -+++ valgrind/include/vki/vki-amd64-linux.h 2010-01-20 04:41:52.662552000 -0500 -@@ -310,6 +310,9 @@ struct vki_stat { - long st_blksize; - long st_blocks; /* Number 512-byte blocks allocated. */ - -+#undef st_atime -+#undef st_mtime -+#undef st_ctime - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; ---- valgrind/include/vki/vki-x86-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 -+++ valgrind/include/vki/vki-x86-linux.h 2010-01-20 04:42:19.649995000 -0500 -@@ -348,6 +348,9 @@ struct vki_stat { - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; -+#undef st_atime -+#undef st_mtime -+#undef st_ctime - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; ---- valgrind/include/vki/vki-ppc32-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 -+++ valgrind/include/vki/vki-ppc32-linux.h 2010-01-20 04:42:44.861651000 -0500 -@@ -392,6 +392,9 @@ struct vki_stat { - long st_size; - unsigned long st_blksize; - unsigned long st_blocks; -+#undef st_atime -+#undef st_mtime -+#undef st_ctime - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; ---- valgrind/include/vki/vki-ppc64-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 -+++ valgrind/include/vki/vki-ppc64-linux.h 2010-01-20 04:43:05.579922000 -0500 -@@ -428,6 +428,9 @@ struct vki_stat { - long st_size; - unsigned long st_blksize; - unsigned long st_blocks; -+#undef st_atime -+#undef st_mtime -+#undef st_ctime - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; diff --git a/valgrind-3.7.0-tests.patch b/valgrind-3.7.0-tests.patch deleted file mode 100644 index 1c12693..0000000 --- a/valgrind-3.7.0-tests.patch +++ /dev/null @@ -1,60 +0,0 @@ -Disable some hanging tests, fix up bug125959-x86.c undefined behavior. - ---- valgrind-3.7.0/helgrind/tests/Makefile.am.jj 2011-10-26 23:24:25.000000000 +0200 -+++ valgrind-3.7.0/helgrind/tests/Makefile.am 2012-01-27 15:01:58.955624195 +0100 -@@ -94,7 +94,6 @@ EXTRA_DIST = \ - # XXX: tc18_semabuse uses operations that are unsupported on Darwin. It - # should be conditionally compiled like tc20_verifywrap is. - check_PROGRAMS = \ -- annotate_hbefore \ - cond_timedwait_invalid \ - free_is_write \ - hg01_all_ok \ ---- valgrind-3.7.0/helgrind/tests/Makefile.in.jj 2011-11-05 12:26:51.000000000 +0100 -+++ valgrind-3.7.0/helgrind/tests/Makefile.in 2012-01-27 15:02:40.285383038 +0100 -@@ -46,8 +46,7 @@ host_triplet = @host@ - DIST_COMMON = $(dist_noinst_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/Makefile.all.am \ - $(top_srcdir)/Makefile.tool-tests.am --check_PROGRAMS = annotate_hbefore$(EXEEXT) \ -- cond_timedwait_invalid$(EXEEXT) free_is_write$(EXEEXT) \ -+check_PROGRAMS = cond_timedwait_invalid$(EXEEXT) free_is_write$(EXEEXT) \ - hg01_all_ok$(EXEEXT) hg02_deadlock$(EXEEXT) \ - hg03_inherit$(EXEEXT) hg04_race$(EXEEXT) hg05_race2$(EXEEXT) \ - hg06_readshared$(EXEEXT) locked_vs_unlocked1$(EXEEXT) \ ---- valgrind-3.7.0/none/tests/x86/bug125959-x86.c.jj 2011-10-26 23:24:38.000000000 +0200 -+++ valgrind-3.7.0/none/tests/x86/bug125959-x86.c 2012-01-27 15:00:11.648250429 +0100 -@@ -22,7 +22,8 @@ static int lookup ( int i ) - - int main(void) - { -- int i, j; -+ int i; -+ unsigned int j; - for (i = 0; i < 256; i++) - buf[i] = (unsigned char) i; - ---- valgrind-3.7.0/gdbserver_tests/Makefile.am.jj 2011-10-26 23:24:26.000000000 +0200 -+++ valgrind-3.7.0/gdbserver_tests/Makefile.am 2012-01-27 14:56:43.369465872 +0100 -@@ -102,9 +102,7 @@ check_PROGRAMS = \ - clean_after_fork \ - fork_chain \ - passsigalrm \ -- sleepers \ - main_pic \ -- t \ - watchpoints - - AM_CFLAGS += $(AM_FLAG_M3264_PRI) ---- valgrind-3.7.0/gdbserver_tests/Makefile.in.jj 2011-11-05 12:26:51.000000000 +0100 -+++ valgrind-3.7.0/gdbserver_tests/Makefile.in 2012-01-27 14:57:30.278191493 +0100 -@@ -47,8 +47,7 @@ DIST_COMMON = $(dist_noinst_SCRIPTS) $(s - $(srcdir)/Makefile.in $(top_srcdir)/Makefile.all.am \ - $(top_srcdir)/Makefile.tool-tests.am - check_PROGRAMS = clean_after_fork$(EXEEXT) fork_chain$(EXEEXT) \ -- passsigalrm$(EXEEXT) sleepers$(EXEEXT) main_pic$(EXEEXT) \ -- t$(EXEEXT) watchpoints$(EXEEXT) -+ passsigalrm$(EXEEXT) main_pic$(EXEEXT) watchpoints$(EXEEXT) - subdir = gdbserver_tests - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/configure.in diff --git a/valgrind-3.7.0-unspecified-type.patch b/valgrind-3.7.0-unspecified-type.patch deleted file mode 100644 index f1940cc..0000000 --- a/valgrind-3.7.0-unspecified-type.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12337) -+++ valgrind-3.7.0/coregrind/m_debuginfo/readdwarf3.c (revision 12338) -@@ -2723,6 +2723,21 @@ static void parse_type_DIE ( /*MOD*/XArr - goto bad_DIE; - } - -+ /* -+ * Treat DW_TAG_unspecified_type as type void. An example of DW_TAG_unspecified_type: -+ * -+ * $ readelf --debug-dump /usr/lib/debug/usr/lib/libstdc++.so.6.0.16.debug -+ * <1><10d4>: Abbrev Number: 53 (DW_TAG_unspecified_type) -+ * <10d5> DW_AT_name : (indirect string, offset: 0xdb7): decltype(nullptr) -+ */ -+ if (dtag == DW_TAG_unspecified_type) { -+ VG_(memset)(&typeE, 0, sizeof(typeE)); -+ typeE.cuOff = D3_INVALID_CUOFF; -+ typeE.tag = Te_TyQual; -+ typeE.Te.TyQual.typeR = D3_FAKEVOID_CUOFF; -+ goto acquire_Type; -+ } -+ - /* else ignore this DIE */ - return; - /*NOTREACHED*/ diff --git a/valgrind-3.8.0-cachegrind-improvements.patch b/valgrind-3.8.0-cachegrind-improvements.patch new file mode 100644 index 0000000..b74af5c --- /dev/null +++ b/valgrind-3.8.0-cachegrind-improvements.patch @@ -0,0 +1,54 @@ +--- valgrind-3.8.0/cachegrind/cg_sim.c.jj 2011-10-26 23:24:32.000000000 +0200 ++++ valgrind-3.8.0/cachegrind/cg_sim.c 2011-12-09 17:31:19.256023683 +0100 +@@ -42,27 +42,30 @@ typedef struct { + Int size; /* bytes */ + Int assoc; + Int line_size; /* bytes */ +- Int sets; + Int sets_min_1; + Int line_size_bits; + Int tag_shift; +- Char desc_line[128]; + UWord* tags; +-} cache_t2; ++ Char desc_line[128]; ++} cache_t2 ++#ifdef __GNUC__ ++__attribute__ ((aligned (8 * sizeof (Int)))) ++#endif ++; + + /* By this point, the size/assoc/line_size has been checked. */ + static void cachesim_initcache(cache_t config, cache_t2* c) + { +- Int i; ++ Int sets; + + c->size = config.size; + c->assoc = config.assoc; + c->line_size = config.line_size; + +- c->sets = (c->size / c->line_size) / c->assoc; +- c->sets_min_1 = c->sets - 1; ++ sets = (c->size / c->line_size) / c->assoc; ++ c->sets_min_1 = sets - 1; + c->line_size_bits = VG_(log2)(c->line_size); +- c->tag_shift = c->line_size_bits + VG_(log2)(c->sets); ++ c->tag_shift = c->line_size_bits + VG_(log2)(sets); + + if (c->assoc == 1) { + VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped", +@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c + c->size, c->line_size, c->assoc); + } + +- c->tags = VG_(malloc)("cg.sim.ci.1", +- sizeof(UWord) * c->sets * c->assoc); +- +- for (i = 0; i < c->sets * c->assoc; i++) +- c->tags[i] = 0; ++ c->tags = VG_(calloc)("cg.sim.ci.1", ++ sizeof(UWord), sets * c->assoc); + } + + /* This is done as a macro rather than by passing in the cache_t2 as an diff --git a/valgrind-3.8.0-capget.patch b/valgrind-3.8.0-capget.patch new file mode 100644 index 0000000..562cdec --- /dev/null +++ b/valgrind-3.8.0-capget.patch @@ -0,0 +1,14 @@ +--- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2010-04-07 08:14:12.000000000 -0400 ++++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2010-04-12 07:24:12.838876000 -0400 +@@ -2212,8 +2212,9 @@ PRE(sys_capget) + vki_cap_user_header_t, header, vki_cap_user_data_t, data); + PRE_MEM_READ( "capget(header)", ARG1, + sizeof(struct __vki_user_cap_header_struct) ); +- PRE_MEM_WRITE( "capget(data)", ARG2, +- sizeof(struct __vki_user_cap_data_struct) ); ++ if (ARG2 != (Addr)NULL) ++ PRE_MEM_WRITE( "capget(data)", ARG2, ++ sizeof(struct __vki_user_cap_data_struct) ); + } + POST(sys_capget) + { diff --git a/valgrind-3.8.0-config_h.patch b/valgrind-3.8.0-config_h.patch new file mode 100644 index 0000000..47a498f --- /dev/null +++ b/valgrind-3.8.0-config_h.patch @@ -0,0 +1,11 @@ +--- valgrind/include/pub_tool_basics.h.jj 2011-10-26 23:24:32.000000000 +0200 ++++ valgrind/include/pub_tool_basics.h 2011-12-09 17:42:50.828630546 +0100 +@@ -297,7 +297,7 @@ static inline Bool sr_EQ ( SysRes sr1, S + #define VG_BUGS_TO "www.valgrind.org" + + /* Branch prediction hints. */ +-#if defined(__GNUC__) ++#if defined(__GNUC__) && (__GNUC__ >= 3) + # define LIKELY(x) __builtin_expect(!!(x), 1) + # define UNLIKELY(x) __builtin_expect(!!(x), 0) + #else diff --git a/valgrind-3.8.0-enable-armv5.patch b/valgrind-3.8.0-enable-armv5.patch new file mode 100644 index 0000000..9f9a66f --- /dev/null +++ b/valgrind-3.8.0-enable-armv5.patch @@ -0,0 +1,22 @@ +--- valgrind-3.7.0.old/configure.in 2012-03-05 15:16:23.000000000 -0500 ++++ valgrind-3.7.0/configure.in 2012-03-05 13:49:04.000000000 -0500 +@@ -186,7 +186,7 @@ case "${host_cpu}" in + ARCH_MAX="s390x" + ;; + +- armv7*) ++ armv[57]*) + AC_MSG_RESULT([ok (${host_cpu})]) + ARCH_MAX="arm" + ;; +--- valgrind-3.7.0.old/configure 2012-03-05 15:16:23.000000000 -0500 ++++ valgrind-3.7.0/configure 2012-03-05 13:49:04.000000000 -0500 +@@ -5335,7 +5335,7 @@ + ARCH_MAX="s390x" + ;; + +- armv7*) ++ armv[57]*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${host_cpu})" >&5 + $as_echo "ok (${host_cpu})" >&6; } + ARCH_MAX="arm" diff --git a/valgrind-3.8.0-helgrind-race-supp.patch b/valgrind-3.8.0-helgrind-race-supp.patch new file mode 100644 index 0000000..759d151 --- /dev/null +++ b/valgrind-3.8.0-helgrind-race-supp.patch @@ -0,0 +1,15 @@ +--- valgrind/glibc-2.34567-NPTL-helgrind.supp.jj 2009-08-19 15:37:48.000000000 +0200 ++++ valgrind/glibc-2.34567-NPTL-helgrind.supp 2009-10-21 16:46:31.000000000 +0200 +@@ -88,6 +88,12 @@ + obj:*/lib*/libpthread-2.*so* + } + { ++ helgrind-glibc2X-102a ++ Helgrind:Race ++ fun:mythread_wrapper ++ obj:*vgpreload_helgrind*.so ++} ++{ + helgrind-glibc2X-103 + Helgrind:Race + fun:pthread_cond_*@@GLIBC_2.* diff --git a/valgrind-3.8.0-ldso-supp.patch b/valgrind-3.8.0-ldso-supp.patch new file mode 100644 index 0000000..1f999b8 --- /dev/null +++ b/valgrind-3.8.0-ldso-supp.patch @@ -0,0 +1,28 @@ +--- valgrind-3.7.0/glibc-2.X.supp.in.jj 2011-10-26 23:24:45.000000000 +0200 ++++ valgrind-3.7.0/glibc-2.X.supp.in 2012-05-07 10:55:20.395942656 +0200 +@@ -124,7 +124,7 @@ + glibc-2.5.x-on-SUSE-10.2-(PPC)-2a + Memcheck:Cond + fun:index +- obj:*ld-@GLIBC_VERSION@.*.so ++ obj:*ld-@GLIBC_VERSION@*.so + } + { + glibc-2.5.x-on-SuSE-10.2-(PPC)-2b +@@ -136,14 +136,14 @@ + glibc-2.5.5-on-SuSE-10.2-(PPC)-2c + Memcheck:Addr4 + fun:index +- obj:*ld-@GLIBC_VERSION@.*.so ++ obj:*ld-@GLIBC_VERSION@*.so + } + { + glibc-2.3.5-on-SuSE-10.1-(PPC)-3 + Memcheck:Addr4 + fun:*wordcopy_fwd_dest_aligned* + fun:mem*cpy +- obj:*lib*@GLIBC_VERSION@.*.so ++ obj:*lib*@GLIBC_VERSION@*.so + } + + { diff --git a/valgrind-3.8.0-openat.patch b/valgrind-3.8.0-openat.patch new file mode 100644 index 0000000..87a4098 --- /dev/null +++ b/valgrind-3.8.0-openat.patch @@ -0,0 +1,38 @@ +Testcase: +#define _GNU_SOURCE +#include +#include + +int +main (void) +{ + int dfd = open ("/tmp", O_RDONLY); + int fd1 = openat (dfd, "abc", O_RDONLY); + int fd2 = openat (0x12345678, "/tmp/abc", O_RDONLY); + int fd3 = openat (AT_FDCWD, "abc", O_RDONLY); + /* This is the only one that should warn. */ + int fd4 = openat (0x12345678, "abc", O_RDONLY); + return 0; +} + +--- valgrind-3.8.0/coregrind/m_syswrap/syswrap-linux.c.jj 2007-12-11 00:18:43.000000000 +0100 ++++ valgrind-3.8.0/coregrind/m_syswrap/syswrap-linux.c 2008-03-03 11:35:15.000000000 +0100 +@@ -3308,10 +3308,15 @@ PRE(sys_openat) + int, dfd, const char *, filename, int, flags); + } + +- if (ARG1 != VKI_AT_FDCWD && !ML_(fd_allowed)(ARG1, "openat", tid, False)) ++ PRE_MEM_RASCIIZ( "openat(filename)", ARG2 ); ++ ++ /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD, ++ filename is relative to cwd. */ ++ if (ML_(safe_to_deref)( (void*)ARG2, 1 ) ++ && *(Char *)ARG2 != '/' ++ && ARG1 != VKI_AT_FDCWD ++ && !ML_(fd_allowed)(ARG1, "openat", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +- else +- PRE_MEM_RASCIIZ( "openat(filename)", ARG2 ); + + /* Handle the case where the open is of /proc/self/cmdline or + /proc//cmdline, and just give it a copy of the fd for the diff --git a/valgrind-3.8.0-pie.patch b/valgrind-3.8.0-pie.patch new file mode 100644 index 0000000..26c976b --- /dev/null +++ b/valgrind-3.8.0-pie.patch @@ -0,0 +1,40 @@ +From eb8d355b64e72bfdf1c8dd2534b1625d5d0118e0 Mon Sep 17 00:00:00 2001 +From: Dodji Seketeli +Date: Thu, 13 Jan 2011 16:04:39 +0100 +Subject: [PATCH] Fix crash loading certain binaries on ppc64 + +Increase the space left for VDSO on ppc64 compiled with 64KB page +size. the size of VDSO is at least 2 pages: one for the code and one +for the data. We ought to leave more than two page space then. The +patch leaves 8 pages space to comply with what is done already for 4KB +page sizes. +--- + coregrind/m_ume/elf.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +--- valgrind/coregrind/m_ume/elf.c ++++ valgrind/coregrind/m_ume/elf.c +@@ -327,6 +327,7 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) + /* The kernel maps position-independent executables at TASK_SIZE*2/3; + duplicate this behavior as close as we can. */ + if (e->e.e_type == ET_DYN && ebase == 0) { ++ ESZ(Addr) hacky_load_address; + ebase = VG_PGROUNDDN(info->exe_base + + (info->exe_end - info->exe_base) * 2 / 3); + /* We really don't want to load PIEs at zero or too close. It +@@ -336,10 +337,11 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) + nonpointers. So, hackily, move it above 1MB. */ + /* Later .. is appears ppc32-linux tries to put [vdso] at 1MB, + which totally screws things up, because nothing else can go +- there. So bump the hacky load addess along by 0x8000, to +- 0x108000. */ +- if (ebase < 0x108000) +- ebase = 0x108000; ++ there. The size of [vdso] is around 2 or 3 pages, so bump ++ the hacky load addess along by 8 * VKI_PAGE_SIZE to be safe. */ ++ hacky_load_address = 0x100000 + 8 * VKI_PAGE_SIZE; ++ if (ebase < hacky_load_address) ++ ebase = hacky_load_address; + } + + info->phnum = e->e.e_phnum; diff --git a/valgrind-3.8.0-stat_h.patch b/valgrind-3.8.0-stat_h.patch new file mode 100644 index 0000000..628dd79 --- /dev/null +++ b/valgrind-3.8.0-stat_h.patch @@ -0,0 +1,48 @@ +--- valgrind/include/vki/vki-amd64-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 ++++ valgrind/include/vki/vki-amd64-linux.h 2010-01-20 04:41:52.662552000 -0500 +@@ -328,6 +328,9 @@ struct vki_stat { + long st_blksize; + long st_blocks; /* Number 512-byte blocks allocated. */ + ++#undef st_atime ++#undef st_mtime ++#undef st_ctime + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; +--- valgrind/include/vki/vki-x86-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 ++++ valgrind/include/vki/vki-x86-linux.h 2010-01-20 04:42:19.649995000 -0500 +@@ -366,6 +366,9 @@ struct vki_stat { + unsigned long st_size; + unsigned long st_blksize; + unsigned long st_blocks; ++#undef st_atime ++#undef st_mtime ++#undef st_ctime + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; +--- valgrind/include/vki/vki-ppc32-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 ++++ valgrind/include/vki/vki-ppc32-linux.h 2010-01-20 04:42:44.861651000 -0500 +@@ -410,6 +410,9 @@ struct vki_stat { + long st_size; + unsigned long st_blksize; + unsigned long st_blocks; ++#undef st_atime ++#undef st_mtime ++#undef st_ctime + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; +--- valgrind/include/vki/vki-ppc64-linux.h.jj 2009-08-19 09:37:07.000000000 -0400 ++++ valgrind/include/vki/vki-ppc64-linux.h 2010-01-20 04:43:05.579922000 -0500 +@@ -446,6 +446,9 @@ struct vki_stat { + long st_size; + unsigned long st_blksize; + unsigned long st_blocks; ++#undef st_atime ++#undef st_mtime ++#undef st_ctime + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; diff --git a/valgrind-3.8.0-tests.patch b/valgrind-3.8.0-tests.patch new file mode 100644 index 0000000..f94b73f --- /dev/null +++ b/valgrind-3.8.0-tests.patch @@ -0,0 +1,48 @@ +Disable some hanging tests. + +--- valgrind-3.8.0/helgrind/tests/Makefile.am.jj 2011-10-26 23:24:25.000000000 +0200 ++++ valgrind-3.8.0/helgrind/tests/Makefile.am 2012-01-27 15:01:58.955624195 +0100 +@@ -96,7 +96,6 @@ EXTRA_DIST = \ + # XXX: tc18_semabuse uses operations that are unsupported on Darwin. It + # should be conditionally compiled like tc20_verifywrap is. + check_PROGRAMS = \ +- annotate_hbefore \ + cond_timedwait_invalid \ + free_is_write \ + hg01_all_ok \ +--- valgrind-3.8.0/helgrind/tests/Makefile.in.jj 2011-11-05 12:26:51.000000000 +0100 ++++ valgrind-3.8.0/helgrind/tests/Makefile.in 2012-01-27 15:02:40.285383038 +0100 +@@ -54,8 +54,7 @@ + @VGCONF_HAVE_PLATFORM_SEC_TRUE@am__append_2 = -DVGA_SEC_@VGCONF_ARCH_SEC@=1 \ + @VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 + +-check_PROGRAMS = annotate_hbefore$(EXEEXT) \ +- cond_timedwait_invalid$(EXEEXT) free_is_write$(EXEEXT) \ ++check_PROGRAMS = cond_timedwait_invalid$(EXEEXT) free_is_write$(EXEEXT) \ + hg01_all_ok$(EXEEXT) hg02_deadlock$(EXEEXT) \ + hg03_inherit$(EXEEXT) hg04_race$(EXEEXT) hg05_race2$(EXEEXT) \ + hg06_readshared$(EXEEXT) locked_vs_unlocked1$(EXEEXT) \ +--- valgrind-3.8.0/gdbserver_tests/Makefile.am.jj 2011-10-26 23:24:26.000000000 +0200 ++++ valgrind-3.8.0/gdbserver_tests/Makefile.am 2012-01-27 14:56:43.369465872 +0100 +@@ -106,9 +106,7 @@ check_PROGRAMS = \ + clean_after_fork \ + fork_chain \ + passsigalrm \ +- sleepers \ + main_pic \ +- t \ + watchpoints + + AM_CFLAGS += $(AM_FLAG_M3264_PRI) +--- valgrind-3.8.0/gdbserver_tests/Makefile.in.jj 2011-11-05 12:26:51.000000000 +0100 ++++ valgrind-3.8.0/gdbserver_tests/Makefile.in 2012-01-27 14:57:30.278191493 +0100 +@@ -55,8 +55,7 @@ + @VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 + + check_PROGRAMS = clean_after_fork$(EXEEXT) fork_chain$(EXEEXT) \ +- passsigalrm$(EXEEXT) sleepers$(EXEEXT) main_pic$(EXEEXT) \ +- t$(EXEEXT) watchpoints$(EXEEXT) ++ passsigalrm$(EXEEXT) main_pic$(EXEEXT) watchpoints$(EXEEXT) + subdir = gdbserver_tests + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/configure.in diff --git a/valgrind.spec b/valgrind.spec index f84b631..3d12ce1 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -1,35 +1,24 @@ Summary: Tool for finding memory management bugs in programs Name: valgrind -Version: 3.7.0 -Release: 7%{?dist} +Version: 3.8.0 +Release: 0.1.TEST1.svn12858%{?dist} Epoch: 1 License: GPLv2 URL: http://www.valgrind.org/ Group: Development/Debuggers -Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2 -Patch1: valgrind-3.7.0-cachegrind-improvements.patch -Patch2: valgrind-3.7.0-openat.patch -Patch3: valgrind-3.7.0-helgrind-race-supp.patch -Patch4: valgrind-3.7.0-stat_h.patch -Patch5: valgrind-3.7.0-config_h.patch -Patch6: valgrind-3.7.0-capget.patch -Patch7: valgrind-3.7.0-glibc-2.15.patch -Patch8: valgrind-3.7.0-pie.patch -Patch9: valgrind-3.7.0-tests.patch -Patch10: valgrind-3.7.0-f-sgetown-ex.patch -Patch11: valgrind-3.7.0-scsi-ioctls.patch -Patch12: valgrind-3.7.0-enable-armv5.patch -Patch13: valgrind-3.7.0-ldso-supp.patch -Patch14: valgrind-3.7.0-unspecified-type.patch -Patch15: valgrind-3.7.0-rvalue-ref.patch -Patch16: valgrind-3.7.0-debug-leak1.patch -Patch17: valgrind-3.7.0-debug-leak2.patch -Patch18: valgrind-3.7.0-addToXA.patch -Patch19: valgrind-3.7.0-debug-types.patch -Patch20: valgrind-3.7.0-dwz.patch -Patch21: valgrind-3.7.0-glibc-2.16.patch -Patch22: valgrind-3.7.0-ref_addr.patch +#Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2 +Source0: valgrind-%{version}-TEST1.tar.bz2 +Patch1: valgrind-3.8.0-cachegrind-improvements.patch +Patch2: valgrind-3.8.0-openat.patch +Patch3: valgrind-3.8.0-helgrind-race-supp.patch +Patch4: valgrind-3.8.0-stat_h.patch +Patch5: valgrind-3.8.0-config_h.patch +Patch6: valgrind-3.8.0-capget.patch +Patch7: valgrind-3.8.0-pie.patch +Patch8: valgrind-3.8.0-tests.patch +Patch9: valgrind-3.8.0-enable-armv5.patch +Patch10: valgrind-3.8.0-ldso-supp.patch Obsoletes: valgrind-callgrind %ifarch x86_64 ppc64 @@ -119,19 +108,6 @@ for details. %patch8 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -touch memcheck/tests/dw4.stdout.exp %build CC=gcc @@ -225,6 +201,11 @@ echo ===============END TESTING=============== %endif %changelog +* Tue Aug 07 2012 Mark Wielaard 3.8.0-0.1.TEST1.svn12858 +- Update to 3.8.0-TEST1 +- Clear CFLAGS CXXFLAGS LDFLAGS. +- Fix \ line continuation in configure line. + * Fri Aug 03 2012 Mark Wielaard 3.7.0-7 - Fixup shadowing warnings valgrind-3.7.0-dwz.patch - Add valgrind-3.7.0-ref_addr.patch (#842659, KDE#298864)