Date: Wed, 8 Aug 2007 19:06:34 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 124914 for review Message-ID: <200708081906.l78J6YPl010220@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124914 Change 124914 by peter@peter_daintree on 2007/08/08 19:06:13 Initial checkin of buildable/runnable valgrind3. Run autogen.sh to build autoconf stuff. depends on various autoconf/automake etc ports. Affected files ... .. //depot/projects/valgrind/Makefile.am#2 edit .. //depot/projects/valgrind/Makefile.core.am#2 edit .. //depot/projects/valgrind/Makefile.flags.am#2 edit .. //depot/projects/valgrind/Makefile.tool-flags.am#2 edit .. //depot/projects/valgrind/Makefile.tool.am#2 edit .. //depot/projects/valgrind/VEX/Makefile#2 edit .. //depot/projects/valgrind/VEX/priv/guest-amd64/ghelpers.c#2 edit .. //depot/projects/valgrind/VEX/priv/main/vex_svnversion.h#1 add .. //depot/projects/valgrind/VEX/pub/libvex_guest_amd64.h#2 edit .. //depot/projects/valgrind/autogen.sh#2 edit .. //depot/projects/valgrind/cachegrind/Makefile.am#2 edit .. //depot/projects/valgrind/cachegrind/tests/Makefile.am#2 edit .. //depot/projects/valgrind/callgrind/Makefile.am#2 edit .. //depot/projects/valgrind/callgrind/tests/Makefile.am#2 edit .. //depot/projects/valgrind/configure.in#2 edit .. //depot/projects/valgrind/coregrind/Makefile.am#2 edit .. //depot/projects/valgrind/coregrind/launcher.c#2 edit .. //depot/projects/valgrind/coregrind/m_aspacemgr/aspacemgr.c#2 edit .. //depot/projects/valgrind/coregrind/m_coredump/coredump-amd64-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_coredump/coredump-elf.c#2 edit .. //depot/projects/valgrind/coregrind/m_coredump/coredump-x86-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_debuginfo/debuginfo.c#2 edit .. //depot/projects/valgrind/coregrind/m_debuginfo/readdwarf.c#2 edit .. //depot/projects/valgrind/coregrind/m_debuglog.c#2 edit .. //depot/projects/valgrind/coregrind/m_dispatch/dispatch-amd64-freebsd.S#1 add .. //depot/projects/valgrind/coregrind/m_dispatch/dispatch-x86-freebsd.S#1 add .. //depot/projects/valgrind/coregrind/m_libcassert.c#2 edit .. //depot/projects/valgrind/coregrind/m_libcfile.c#2 edit .. //depot/projects/valgrind/coregrind/m_libcproc.c#2 edit .. //depot/projects/valgrind/coregrind/m_libcsignal.c#2 edit .. //depot/projects/valgrind/coregrind/m_machine.c#2 edit .. //depot/projects/valgrind/coregrind/m_main.c#2 edit .. //depot/projects/valgrind/coregrind/m_redir.c#2 edit .. //depot/projects/valgrind/coregrind/m_sigframe/sigframe-amd64-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_sigframe/sigframe-x86-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_signals.c#2 edit .. //depot/projects/valgrind/coregrind/m_stacktrace.c#2 edit .. //depot/projects/valgrind/coregrind/m_syscall.c#2 edit .. //depot/projects/valgrind/coregrind/m_syswrap/makeargsize.sh#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/makeargsize6.sh#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-freebsd.h#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-generic.h#2 edit .. //depot/projects/valgrind/coregrind/m_syswrap/priv_types_n_macros.h#2 edit .. //depot/projects/valgrind/coregrind/m_syswrap/sysargcount.c#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syscall-amd64-freebsd.S#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syscall-x86-freebsd.S#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-amd64-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd-variants.c#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-generic.c#2 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-main.c#2 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#1 add .. //depot/projects/valgrind/coregrind/m_trampoline.S#2 edit .. //depot/projects/valgrind/coregrind/m_ume.c#2 edit .. //depot/projects/valgrind/coregrind/pub_core_libcproc.h#2 edit .. //depot/projects/valgrind/coregrind/pub_core_sigframe.h#2 edit .. //depot/projects/valgrind/coregrind/pub_core_syscall.h#2 edit .. //depot/projects/valgrind/coregrind/pub_core_trampoline.h#2 edit .. //depot/projects/valgrind/coregrind/vg_preloaded.c#2 edit .. //depot/projects/valgrind/coregrind/vki_syscall-freebsd.h#1 add .. //depot/projects/valgrind/coregrind/vki_unistd.h#2 edit .. //depot/projects/valgrind/getpath/Makefile#1 add .. //depot/projects/valgrind/getpath/getpath_fromaddr.c#1 add .. //depot/projects/valgrind/getpath/getpath_fromfd.c#1 add .. //depot/projects/valgrind/getpath/gp_README#1 add .. //depot/projects/valgrind/helgrind/Makefile.am#2 edit .. //depot/projects/valgrind/helgrind/tests/Makefile.am#2 edit .. //depot/projects/valgrind/include/Makefile.am#2 edit .. //depot/projects/valgrind/include/pub_tool_basics.h#2 edit .. //depot/projects/valgrind/include/vki-amd64-freebsd.h#1 add .. //depot/projects/valgrind/include/vki-freebsd.h#1 add .. //depot/projects/valgrind/include/vki-x86-freebsd.h#1 add .. //depot/projects/valgrind/include/vki_machine_types-amd64-freebsd.h#1 add .. //depot/projects/valgrind/include/vki_machine_types-x86-freebsd.h#1 add .. //depot/projects/valgrind/lackey/Makefile.am#2 edit .. //depot/projects/valgrind/libc-4x.supp#1 add .. //depot/projects/valgrind/massif/Makefile.am#2 edit .. //depot/projects/valgrind/memcheck/Makefile.am#2 edit .. //depot/projects/valgrind/memcheck/tests/Makefile.am#2 edit .. //depot/projects/valgrind/memcheck/tests/addressable.c#2 edit .. //depot/projects/valgrind/memcheck/tests/badjump2.c#2 edit .. //depot/projects/valgrind/memcheck/tests/brk.c#2 edit .. //depot/projects/valgrind/memcheck/tests/buflen_check.c#2 edit .. //depot/projects/valgrind/memcheck/tests/malloc_usable.c#2 edit .. //depot/projects/valgrind/memcheck/tests/memalign2.c#2 edit .. //depot/projects/valgrind/memcheck/tests/mempool.c#2 edit .. //depot/projects/valgrind/memcheck/tests/pointer-trace.c#2 edit .. //depot/projects/valgrind/memcheck/tests/sh-mem-random.c#2 edit .. //depot/projects/valgrind/memcheck/tests/stack_changes.c#2 edit .. //depot/projects/valgrind/memcheck/tests/stack_switch.c#2 edit .. //depot/projects/valgrind/memcheck/tests/str_tester.c#2 edit .. //depot/projects/valgrind/memcheck/tests/writev.c#2 edit .. //depot/projects/valgrind/memcheck/tests/x86/Makefile.am#2 edit .. //depot/projects/valgrind/memcheck/tests/zeropage.c#2 edit .. //depot/projects/valgrind/none/Makefile.am#2 edit .. //depot/projects/valgrind/none/tests/Makefile.am#2 edit .. //depot/projects/valgrind/none/tests/closeall.c#2 edit .. //depot/projects/valgrind/none/tests/faultstatus.c#2 edit .. //depot/projects/valgrind/none/tests/fdleak_cmsg.c#2 edit .. //depot/projects/valgrind/none/tests/fdleak_socketpair.c#2 edit .. //depot/projects/valgrind/none/tests/map_unaligned.c#2 edit .. //depot/projects/valgrind/none/tests/map_unmap.c#2 edit .. //depot/projects/valgrind/none/tests/mq.c#2 edit .. //depot/projects/valgrind/none/tests/pending.c#2 edit .. //depot/projects/valgrind/none/tests/resolv.c#2 edit .. //depot/projects/valgrind/none/tests/rlimit_nofile.c#2 edit .. //depot/projects/valgrind/none/tests/sem.c#2 edit .. //depot/projects/valgrind/none/tests/sigstackgrowth.c#2 edit .. //depot/projects/valgrind/none/tests/x86/Makefile.am#2 edit .. //depot/projects/valgrind/none/tests/x86/faultstatus.c#2 edit .. //depot/projects/valgrind/perf/bigcode.c#2 edit .. //depot/projects/valgrind/perf/tinycc.c#2 edit .. //depot/projects/valgrind/tests/filter_addresses#2 edit .. //depot/projects/valgrind/tests/filter_discards#2 edit .. //depot/projects/valgrind/tests/filter_numbers#2 edit .. //depot/projects/valgrind/tests/filter_stderr_basic#2 edit .. //depot/projects/valgrind/tests/toobig-allocs.c#2 edit Differences ... ==== //depot/projects/valgrind/Makefile.am#2 (text+ko) ==== @@ -32,6 +32,14 @@ CLEANFILES = DISTCLEANFILES = default.supp +if VG_X86_FREEBSD +BUILT_SOURCES += valt_load_address_x86_freebsd.lds +CLEANFILES += valt_load_address_x86_freebsd.lds +endif +if VG_AMD64_FREEBSD +BUILT_SOURCES += valt_load_address_amd64_freebsd.lds +CLEANFILES += valt_load_address_amd64_freebsd.lds +endif if VG_X86_LINUX BUILT_SOURCES += valt_load_address_x86_linux.lds CLEANFILES += valt_load_address_x86_linux.lds @@ -181,6 +189,20 @@ # # So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace # all the hex values in that line with "valt_load_address". +valt_load_address_x86_freebsd.lds: Makefile + $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed -E \ + -e '1,/^=====+$$/d' \ + -e '/^=====+$$/d' \ + -e '/\. = 0x[0-9A-Fa-f]+ \+ SIZEOF_HEADERS/s/0x[0-9A-Fa-f]+/valt_load_address/g' > $@ \ + || rm -f $@ + +valt_load_address_amd64_freebsd.lds: Makefile + $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed -E \ + -e '1,/^=====+$$/d' \ + -e '/^=====+$$/d' \ + -e '/\. = 0x[0-9A-Fa-f]+ \+ SIZEOF_HEADERS/s/0x[0-9A-Fa-f]+/valt_load_address/g' > $@ \ + || rm -f $@ + valt_load_address_x86_linux.lds: Makefile $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ -e '1,/^=====\+$$/d' \ ==== //depot/projects/valgrind/Makefile.core.am#2 (text+ko) ==== @@ -1,3 +1,27 @@ +add_includes_x86_freebsd = -I$(top_srcdir)/coregrind \ + -I$(top_srcdir) \ + -I$(top_srcdir)/coregrind/x86 \ + -I$(top_srcdir)/coregrind/freebsd \ + -I$(top_srcdir)/coregrind/x86-freebsd \ + -I$(top_srcdir)/include \ + -I@VEX_DIR@/pub \ + -DVG_PLATFORM="\"x86-freebsd\"" \ + -DVGA_x86=1 \ + -DVGO_freebsd=1 \ + -DVGP_x86_freebsd=1 + +add_includes_amd64_freebsd = -I$(top_srcdir)/coregrind \ + -I$(top_srcdir) \ + -I$(top_srcdir)/coregrind/x86 \ + -I$(top_srcdir)/coregrind/freebsd \ + -I$(top_srcdir)/coregrind/x86-freebsd \ + -I$(top_srcdir)/include \ + -I@VEX_DIR@/pub \ + -DVG_PLATFORM="\"amd64-freebsd\"" \ + -DVGA_amd64=1 \ + -DVGO_freebsd=1 \ + -DVGP_amd64_freebsd=1 + add_includes_x86_linux = -I$(top_srcdir)/coregrind \ -I$(top_srcdir) \ -I$(top_srcdir)/coregrind/x86 \ @@ -49,6 +73,8 @@ include $(top_srcdir)/Makefile.flags.am PRELOAD_LDFLAGS_COMMON = -nostdlib -shared -Wl,-z,interpose,-z,initfirst +PRELOAD_LDFLAGS_X86_FREEBSD = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ +PRELOAD_LDFLAGS_AMD64_FREEBSD = $(PRELOAD_LDFLAGS_COMMON) -m64 PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON) -m64 PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ ==== //depot/projects/valgrind/Makefile.flags.am#2 (text+ko) ==== @@ -6,6 +6,18 @@ AM_CFLAGS_PIC = -fpic -fno-omit-frame-pointer # Flags for specific targets +AM_FLAG_M3264_X86_FREEBSD = @FLAG_M32@ +AM_CPPFLAGS_X86_FREEBSD = $(add_includes_x86_freebsd) +AM_CFLAGS_X86_FREEBSD = $(WERROR) @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ + $(AM_CFLAGS_BASE) +AM_CCASFLAGS_X86_FREEBSD = $(add_includes_x86_freebsd) @FLAG_M32@ -g + +AM_FLAG_M3264_AMD64_FREEBSD = @FLAG_M64@ +AM_CPPFLAGS_AMD64_FREEBSD = $(add_includes_amd64_freebsd) +AM_CFLAGS_AMD64_FREEBSD = $(WERROR) @FLAG_M64@ -fomit-frame-pointer \ + @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE) +AM_CCASFLAGS_AMD64_FREEBSD = $(add_includes_amd64_freebsd) -m64 -g + AM_FLAG_M3264_X86_LINUX = @FLAG_M32@ AM_CPPFLAGS_X86_LINUX = $(add_includes_x86_linux) AM_CFLAGS_X86_LINUX = $(WERROR) @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ ==== //depot/projects/valgrind/Makefile.tool-flags.am#2 (text+ko) ==== @@ -1,3 +1,15 @@ +add_includes_x86_freebsd = -I$(top_srcdir)/include \ + -I@VEX_DIR@/pub \ + -DVGA_x86=1 \ + -DVGO_freebsd=1 \ + -DVGP_x86_freebsd=1 + +add_includes_amd64_freebsd = -I$(top_srcdir)/include \ + -I@VEX_DIR@/pub \ + -DVGA_amd64=1 \ + -DVGO_freebsd=1 \ + -DVGP_amd64_freebsd=1 + add_includes_x86_linux = -I$(top_srcdir)/include \ -I@VEX_DIR@/pub \ -DVGA_x86=1 \ ==== //depot/projects/valgrind/Makefile.tool.am#2 (text+ko) ==== @@ -6,6 +6,12 @@ include $(top_srcdir)/Makefile.tool-flags.am include $(top_srcdir)/Makefile.tool-inplace.am +LIBREPLACEMALLOC_X86_FREEBSD = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload_x86_freebsd.a + +LIBREPLACEMALLOC_AMD64_FREEBSD = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload_amd64_freebsd.a + LIBREPLACEMALLOC_X86_LINUX = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload_x86_linux.a @@ -18,6 +24,14 @@ LIBREPLACEMALLOC_PPC64_LINUX = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload_ppc64_linux.a +COREGRIND_LIBS_X86_FREEBSD = \ + $(top_builddir)/coregrind/libcoregrind_x86_freebsd.a \ + @VEX_DIR@/libvex_x86_freebsd.a + +COREGRIND_LIBS_AMD64_FREEBSD = \ + $(top_builddir)/coregrind/libcoregrind_amd64_freebsd.a \ + @VEX_DIR@/libvex_amd64_freebsd.a + COREGRIND_LIBS_X86_LINUX = \ $(top_builddir)/coregrind/libcoregrind_x86_linux.a \ @VEX_DIR@/libvex_x86_linux.a @@ -36,6 +50,16 @@ ##.PHONY: @VEX_DIR@/libvex.a +@VEX_DIR@/libvex_x86_freebsd.a: @VEX_DIR@/priv/main/vex_svnversion.h + $(MAKE) -C @VEX_DIR@ CC="$(CC)" libvex_x86_freebsd.a \ + EXTRA_CFLAGS="$(AM_CFLAGS_X86_FREEBSD) @FLAG_WDECL_AFTER_STMT@ \ + @FLAG_FNO_STACK_PROTECTOR@" + +@VEX_DIR@/libvex_amd64_freebsd.a: @VEX_DIR@/priv/main/vex_svnversion.h + $(MAKE) -C @VEX_DIR@ CC="$(CC)" libvex_amd64_freebsd.a \ + EXTRA_CFLAGS="$(AM_CFLAGS_AMD64_FREEBSD) @FLAG_WDECL_AFTER_STMT@ \ + @FLAG_FNO_STACK_PROTECTOR@" + @VEX_DIR@/libvex_x86_linux.a: @VEX_DIR@/priv/main/vex_svnversion.h $(MAKE) -C @VEX_DIR@ CC="$(CC)" libvex_x86_linux.a \ EXTRA_CFLAGS="$(AM_CFLAGS_X86_LINUX) @FLAG_WDECL_AFTER_STMT@ \ @@ -64,6 +88,16 @@ -Wl,-defsym,valt_load_address=@VALT_LOAD_ADDRESS@ \ -nodefaultlibs -nostartfiles -u _start +TOOL_LDADD_X86_FREEBSD = $(COREGRIND_LIBS_X86_FREEBSD) $(TOOL_LDADD_COMMON) +TOOL_LDFLAGS_X86_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON) @FLAG_M32@ \ + -Wl,-T,$(top_builddir)/valt_load_address_x86_freebsd.lds + +TOOL_LDADD_AMD64_FREEBSD = $(COREGRIND_LIBS_AMD64_FREEBSD) $(TOOL_LDADD_COMMON) +TOOL_LDFLAGS_AMD64_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON) -m64 \ + -Wl,-T,$(top_builddir)/valt_load_address_amd64_freebsd.lds + TOOL_LDADD_X86_LINUX = $(COREGRIND_LIBS_X86_LINUX) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_X86_LINUX = \ $(TOOL_LDFLAGS_COMMON) @FLAG_M32@ \ @@ -85,11 +119,21 @@ -Wl,-T,$(top_builddir)/valt_load_address_ppc64_linux.lds PRELOAD_LDFLAGS_COMMON = -nostdlib -shared -Wl,-z,interpose,-z,initfirst +PRELOAD_LDFLAGS_X86_FREEBSD = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ +PRELOAD_LDFLAGS_AMD64_FREEBSD = $(PRELOAD_LDFLAGS_COMMON) -m64 PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON) -m64 PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@ PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON) -m64 +LIBREPLACEMALLOC_LDFLAGS_X86_FREEBSD = \ + -Wl,--whole-archive \ + $(LIBREPLACEMALLOC_X86_FREEBSD) \ + -Wl,--no-whole-archive +LIBREPLACEMALLOC_LDFLAGS_AMD64_FREEBSD = \ + -Wl,--whole-archive \ + $(LIBREPLACEMALLOC_AMD64_FREEBSD) \ + -Wl,--no-whole-archive LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \ -Wl,--whole-archive \ $(LIBREPLACEMALLOC_X86_LINUX) \ ==== //depot/projects/valgrind/VEX/Makefile#2 (text+ko) ==== @@ -137,6 +137,17 @@ if [ ! -f TAG_ppc64_linux ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; fi touch TAG_ppc64_linux +libvex_x86_freebsd.a: TAG_x86_freebsd libvex.a + mv -f libvex.a libvex_x86_freebsd.a +TAG_x86_freebsd: + if [ ! -f TAG_x86_freebsd ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; fi + touch TAG_x86_freebsd + +libvex_amd64_freebsd.a: TAG_amd64_freebsd libvex.a + mv -f libvex.a libvex_amd64_freebsd.a +TAG_amd64_freebsd: + if [ ! -f TAG_amd64_freebsd ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; fi + touch TAG_amd64_freebsd # This doesn't get rid of priv/main/vex_svnversion.h, because # that can't be regenerated in the final Valgrind tarball, and ==== //depot/projects/valgrind/VEX/priv/guest-amd64/ghelpers.c#2 (text+ko) ==== @@ -839,6 +839,29 @@ } +/* VISIBLE TO LIBVEX CLIENT */ +void +LibVEX_GuestAMD64_put_rflag_c ( UInt new_carry_flag, + /*MOD*/VexGuestAMD64State* vex_state ) +{ + ULong oszacp = amd64g_calculate_rflags_all_WRK( + vex_state->guest_CC_OP, + vex_state->guest_CC_DEP1, + vex_state->guest_CC_DEP2, + vex_state->guest_CC_NDEP + ); + if (new_carry_flag & 1) { + oszacp |= AMD64G_CC_MASK_C; + } else { + oszacp &= ~AMD64G_CC_MASK_C; + } + vex_state->guest_CC_OP = AMD64G_CC_OP_COPY; + vex_state->guest_CC_DEP1 = oszacp; + vex_state->guest_CC_DEP2 = 0; + vex_state->guest_CC_NDEP = 0; +} + + /*---------------------------------------------------------------*/ /*--- %rflags translation-time function specialisers. ---*/ /*--- These help iropt specialise calls the above run-time ---*/ ==== //depot/projects/valgrind/VEX/pub/libvex_guest_amd64.h#2 (text+ko) ==== @@ -178,6 +178,13 @@ ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/VexGuestAMD64State* vex_state ); +/* Set the carry flag in the given state to 'new_carry_flag', which + should be zero or one. */ +extern +void +LibVEX_GuestAMD64_put_rflag_c ( UInt new_carry_flag, + /*MOD*/VexGuestAMD64State* vex_state ); + #if 0 /* Convert a saved x87 FPU image (as created by fsave) and write it into the supplied VexGuestX86State structure. The non-FP parts of @@ -193,15 +200,6 @@ void LibVEX_GuestX86_get_x87 ( /*IN*/VexGuestX86State* vex_state, /*OUT*/UChar* x87_state ); - -/* Given a 32-bit word containing native x86 %eflags values, set the - eflag-related fields in the supplied VexGuestX86State accordingly. - All other fields are left unchanged. */ - -extern -void LibVEX_GuestX86_put_eflags ( UInt eflags_native, - /*OUT*/VexGuestX86State* vex_state ); - #endif /* 0 */ #endif /* ndef __LIBVEX_PUB_GUEST_AMD64_H */ ==== //depot/projects/valgrind/autogen.sh#2 (text+kox) ==== @@ -11,7 +11,8 @@ fi } -run aclocal -run autoheader -run automake -a -run autoconf +run aclocal19 +run autoheader259 +run automake19 -a +run autoconf259 +echo '"export"' > VEX/priv/main/vex_svnversion.h ==== //depot/projects/valgrind/cachegrind/Makefile.am#2 (text+ko) ==== @@ -5,6 +5,12 @@ noinst_HEADERS = cg_arch.h cg_sim.c noinst_PROGRAMS = +if VG_X86_FREEBSD +noinst_PROGRAMS += cachegrind-x86-freebsd +endif +if VG_AMD64_FREEBSD +noinst_PROGRAMS += cachegrind-amd64-freebsd +endif if VG_X86_LINUX noinst_PROGRAMS += cachegrind-x86-linux endif @@ -24,6 +30,20 @@ CACHEGRIND_SOURCES_PPC32 = cg-ppc32.c CACHEGRIND_SOURCES_PPC64 = cg-ppc64.c +cachegrind_x86_freebsd_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_X86) +cachegrind_x86_freebsd_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD) +cachegrind_x86_freebsd_CFLAGS = $(AM_CFLAGS_X86_FREEBSD) +cachegrind_x86_freebsd_DEPENDENCIES = $(COREGRIND_LIBS_X86_FREEBSD) +cachegrind_x86_freebsd_LDADD = $(TOOL_LDADD_X86_FREEBSD) +cachegrind_x86_freebsd_LDFLAGS = $(TOOL_LDFLAGS_X86_FREEBSD) + +cachegrind_amd64_freebsd_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_AMD64) +cachegrind_amd64_freebsd_CPPFLAGS = $(AM_CPPFLAGS_AMD64_FREEBSD) +cachegrind_amd64_freebsd_CFLAGS = $(AM_CFLAGS_AMD64_FREEBSD) +cachegrind_amd64_freebsd_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_FREEBSD) +cachegrind_amd64_freebsd_LDADD = $(TOOL_LDADD_AMD64_FREEBSD) +cachegrind_amd64_freebsd_LDFLAGS = $(TOOL_LDFLAGS_AMD64_FREEBSD) + cachegrind_x86_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_X86) cachegrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) cachegrind_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) ==== //depot/projects/valgrind/cachegrind/tests/Makefile.am#2 (text+ko) ==== @@ -3,6 +3,12 @@ include $(top_srcdir)/Makefile.flags.am SUBDIRS = . +if VG_X86_FREEBSD +SUBDIRS += x86 +endif +if VG_AMD64_FREEBSD +SUBDIRS += amd64 +endif if VG_X86_LINUX SUBDIRS += x86 endif @@ -33,7 +39,9 @@ AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) # C ones +if !VG_X86_FREEBSD dlclose_LDADD = -ldl +endif myprint_so_SOURCES = myprint.c myprint_so_LDFLAGS = $(AM_FLAG_M3264_PRI) -shared -fPIC myprint_so_CFLAGS = $(AM_FLAG_M3264_PRI) -fPIC ==== //depot/projects/valgrind/callgrind/Makefile.am#2 (text+ko) ==== @@ -5,6 +5,12 @@ noinst_HEADERS = global.h costs.h events.h noinst_PROGRAMS = +if VG_X86_FREEBSD +noinst_PROGRAMS += callgrind-x86-freebsd +endif +if VG_AMD64_FREEBSD +noinst_PROGRAMS += callgrind-amd64-freebsd +endif if VG_X86_LINUX noinst_PROGRAMS += callgrind-x86-linux endif @@ -30,6 +36,20 @@ CALLGRIND_CFLAGS_COMMON = -I../cachegrind +callgrind_x86_freebsd_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_X86) +callgrind_x86_freebsd_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD) +callgrind_x86_freebsd_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_X86_FREEBSD) +callgrind_x86_freebsd_DEPENDENCIES = $(COREGRIND_LIBS_X86_FREEBSD) +callgrind_x86_freebsd_LDADD = $(TOOL_LDADD_X86_FREEBSD) +callgrind_x86_freebsd_LDFLAGS = $(TOOL_LDFLAGS_X86_FREEBSD) + +callgrind_amd64_freebsd_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_AMD64) +callgrind_amd64_freebsd_CPPFLAGS = $(AM_CPPFLAGS_AMD64_FREEBSD) +callgrind_amd64_freebsd_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_AMD64_FREEBSD) +callgrind_amd64_freebsd_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_FREEBSD) +callgrind_amd64_freebsd_LDADD = $(TOOL_LDADD_AMD64_FREEBSD) +callgrind_amd64_freebsd_LDFLAGS = $(TOOL_LDFLAGS_AMD64_FREEBSD) + callgrind_x86_linux_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_X86) callgrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) callgrind_x86_linux_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_X86_LINUX) ==== //depot/projects/valgrind/callgrind/tests/Makefile.am#2 (text+ko) ==== @@ -13,7 +13,11 @@ simwork3.vgtest simwork3.stdout.exp simwork3.stderr.exp \ threads.vgtest threads.stderr.exp -check_PROGRAMS = clreq simwork threads +check_PROGRAMS = clreq simwork + +if !VG_X86_FREEBSD +check_PROGRAMS += threads +endif AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) ==== //depot/projects/valgrind/configure.in#2 (text+ko) ==== @@ -127,7 +127,7 @@ valt_load_address_inner="0x28000000" ;; - x86_64) + x86_64|amd64) AC_MSG_RESULT([ok (${host_cpu})]) VG_ARCH="amd64" valt_load_address_normal="0x38000000" @@ -289,6 +289,24 @@ fi AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; + x86-freebsd) + VG_PLATFORM_PRI="X86_FREEBSD" + VG_PLATFORM_SEC="" + AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) + ;; + amd64-freebsd) + if test x$vg_cv_only64bit = xyes; then + VG_PLATFORM_PRI="AMD64_FREEBSD" + VG_PLATFORM_SEC="" + elif test x$vg_cv_only32bit = xyes; then + VG_PLATFORM_PRI="X86_FREEBSD" + VG_PLATFORM_SEC="" + else + VG_PLATFORM_PRI="AMD64_FREEBSD" + VG_PLATFORM_SEC="X86_FREEBSD" + fi + AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) + ;; *) VG_PLATFORM_PRI="unknown" VG_PLATFORM_SEC="unknown" @@ -309,6 +327,11 @@ -o x$VG_PLATFORM_SEC = xPPC32_LINUX) AM_CONDITIONAL(VG_PPC64_LINUX, test x$VG_PLATFORM_PRI = xPPC64_LINUX) +AM_CONDITIONAL(VG_X86_FREEBSD, + test x$VG_PLATFORM_PRI = xX86_FREEBSD \ + -o x$VG_PLATFORM_SEC = xX86_FREEBSD) +AM_CONDITIONAL(VG_AMD64_FREEBSD, + test x$VG_PLATFORM_PRI = xAMD64_FREEBSD) # This variable will collect the individual suppression files @@ -317,6 +340,8 @@ AC_SUBST(DEFAULT_SUPP) +case "$VG_OS" in + linux) glibc="" AC_EGREP_CPP([GLIBC_22], [ @@ -391,6 +416,18 @@ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.5]) ;; esac + ;; + freebsd) +AC_MSG_CHECKING([the libc version]) +libc="4x" +case "${libc}" in + 4x) + AC_MSG_RESULT(freebsd-4.x family) + AC_DEFINE([LIBC_4X], 1, [Define to 1 if you're using FreeBSD-4.x libc]) + DEFAULT_SUPP="libc-4x.supp ${DEFAULT_SUPP}" + ;; +esac +esac # We don't know how to detect the X client library version ==== //depot/projects/valgrind/coregrind/Makefile.am#2 (text+ko) ==== @@ -8,6 +8,8 @@ include $(top_srcdir)/Makefile.core.am include $(top_srcdir)/Makefile.install.am +AM_CPPFLAGS_X86_FREEBSD += -DVG_LIBDIR="\"$(valdir)"\" +AM_CPPFLAGS_AMD64_FREEBSD += -DVG_LIBDIR="\"$(valdir)"\" AM_CPPFLAGS_X86_LINUX += -DVG_LIBDIR="\"$(valdir)"\" AM_CPPFLAGS_AMD64_LINUX += -DVG_LIBDIR="\"$(valdir)"\" AM_CPPFLAGS_PPC32_LINUX += -DVG_LIBDIR="\"$(valdir)"\" @@ -17,6 +19,12 @@ default.supp: $(SUPP_FILES) noinst_LIBRARIES = +if VG_X86_FREEBSD +noinst_LIBRARIES += libcoregrind_x86_freebsd.a libreplacemalloc_toolpreload_x86_freebsd.a +endif +if VG_AMD64_FREEBSD +noinst_LIBRARIES += libcoregrind_amd64_freebsd.a libreplacemalloc_toolpreload_amd64_freebsd.a +endif if VG_X86_LINUX noinst_LIBRARIES += libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a endif @@ -49,6 +57,12 @@ noinst_PROGRAMS = +if VG_X86_FREEBSD +noinst_PROGRAMS += vgpreload_core-x86-freebsd.so +endif +if VG_AMD64_FREEBSD +noinst_PROGRAMS += vgpreload_core-amd64-freebsd.so +endif if VG_X86_LINUX noinst_PROGRAMS += vgpreload_core-x86-linux.so endif @@ -183,6 +197,38 @@ m_syswrap/syswrap-generic.c \ m_syswrap/syswrap-main.c +COREGRIND_FREEBSD_SOURCE = \ + m_coredump/coredump-elf.c \ + m_syswrap/syswrap-freebsd.c \ + m_syswrap/syswrap-freebsd-variants.c + +libcoregrind_x86_freebsd_a_SOURCES = \ + $(COREGRIND_SOURCES_COMMON) \ + $(COREGRIND_FREEBSD_SOURCE) \ + m_coredump/coredump-x86-freebsd.c \ + m_dispatch/dispatch-x86-freebsd.S \ + m_sigframe/sigframe-x86-freebsd.c \ + m_syswrap/syscall-x86-freebsd.S \ + m_syswrap/syswrap-x86-freebsd.c \ + m_syswrap/sysargcount.c + +libcoregrind_x86_freebsd_a_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD) +libcoregrind_x86_freebsd_a_CFLAGS = $(AM_CFLAGS_X86_FREEBSD) +libcoregrind_x86_freebsd_a_CCASFLAGS = $(AM_CCASFLAGS_X86_FREEBSD) + +libcoregrind_amd64_freebsd_a_SOURCES = \ + $(COREGRIND_SOURCES_COMMON) \ + $(COREGRIND_FREEBSD_SOURCE) \ + m_coredump/coredump-amd64-freebsd.c \ + m_dispatch/dispatch-amd64-freebsd.S \ + m_sigframe/sigframe-amd64-freebsd.c \ + m_syswrap/syscall-amd64-freebsd.S \ + m_syswrap/syswrap-amd64-freebsd.c + +libcoregrind_amd64_freebsd_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_FREEBSD) +libcoregrind_amd64_freebsd_a_CFLAGS = $(AM_CFLAGS_AMD64_FREEBSD) +libcoregrind_amd64_freebsd_a_CCASFLAGS = $(AM_CCASFLAGS_AMD64_FREEBSD) + COREGRIND_LINUX_SOURCE = \ m_coredump/coredump-elf.c \ m_syswrap/syswrap-linux.c \ @@ -240,6 +286,14 @@ libcoregrind_ppc64_linux_a_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) libcoregrind_ppc64_linux_a_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) +libreplacemalloc_toolpreload_x86_freebsd_a_SOURCES = m_replacemalloc/vg_replace_malloc.c +libreplacemalloc_toolpreload_x86_freebsd_a_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD) +libreplacemalloc_toolpreload_x86_freebsd_a_CFLAGS = $(AM_CFLAGS_X86_FREEBSD) -fpic -fno-omit-frame-pointer + +libreplacemalloc_toolpreload_amd64_freebsd_a_SOURCES = m_replacemalloc/vg_replace_malloc.c +libreplacemalloc_toolpreload_amd64_freebsd_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_FREEBSD) +libreplacemalloc_toolpreload_amd64_freebsd_a_CFLAGS = $(AM_CFLAGS_AMD64_FREEBSD) -fpic -fno-omit-frame-pointer + libreplacemalloc_toolpreload_x86_linux_a_SOURCES = m_replacemalloc/vg_replace_malloc.c libreplacemalloc_toolpreload_x86_linux_a_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) libreplacemalloc_toolpreload_x86_linux_a_CFLAGS = $(AM_CFLAGS_X86_LINUX) -fpic -fno-omit-frame-pointer @@ -256,6 +310,11 @@ libreplacemalloc_toolpreload_ppc64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) libreplacemalloc_toolpreload_ppc64_linux_a_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -fpic -fno-omit-frame-pointer +m_dispatch/dispatch-x86-freebsd.S: libvex_guest_offsets.h +m_dispatch/dispatch-amd64-freebsd.S: libvex_guest_offsets.h +m_syswrap/syscall-x86-freebsd.S: libvex_guest_offsets.h +m_syswrap/syscall-amd64-freebsd.S: libvex_guest_offsets.h + m_dispatch/dispatch-x86-linux.S: libvex_guest_offsets.h m_dispatch/dispatch-amd64-linux.S: libvex_guest_offsets.h m_dispatch/dispatch-ppc32-linux.S: libvex_guest_offsets.h @@ -271,6 +330,16 @@ VGPRELOAD_CORE_SOURCES_COMMON = vg_preloaded.c +vgpreload_core_x86_freebsd_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) +vgpreload_core_x86_freebsd_so_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD) +vgpreload_core_x86_freebsd_so_CFLAGS = $(AM_CFLAGS_X86_FREEBSD) $(AM_CFLAGS_PIC) +vgpreload_core_x86_freebsd_so_LDFLAGS = $(PRELOAD_LDFLAGS_X86_FREEBSD) + +vgpreload_core_amd64_freebsd_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) +vgpreload_core_amd64_freebsd_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_FREEBSD) +vgpreload_core_amd64_freebsd_so_CFLAGS = $(AM_CFLAGS_AMD64_FREEBSD) $(AM_CFLAGS_PIC) +vgpreload_core_amd64_freebsd_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_FREEBSD) + vgpreload_core_x86_linux_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) vgpreload_core_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) vgpreload_core_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) ==== //depot/projects/valgrind/coregrind/launcher.c#2 (text+ko) ==== @@ -42,7 +42,7 @@ #include <stdlib.h> #include <string.h> #include <sys/mman.h> -#include <sys/user.h> +/* #include <sys/user.h> */ #include <unistd.h> #include "pub_core_debuglog.h" @@ -239,6 +239,10 @@ mode. */ if (0==strcmp(VG_PLATFORM,"x86-linux")) default_platform = "x86-linux"; + else if (0==strcmp(VG_PLATFORM,"x86-freebsd")) + default_platform = "x86-freebsd"; + else if (0==strcmp(VG_PLATFORM,"amd64-freebsd")) + default_platform = "amd64-freebsd"; else if (0==strcmp(VG_PLATFORM,"amd64-linux")) default_platform = "amd64-linux"; else if (0==strcmp(VG_PLATFORM,"ppc32-linux")) @@ -268,14 +272,27 @@ we can tell stage2. stage2 will use the name for recursive invokations of valgrind on child processes. */ memset(launcher_name, 0, PATH_MAX+1); +#if defined(VGO_linux) r = readlink("/proc/self/exe", launcher_name, PATH_MAX); +#elif defined(VGO_freebsd) + r = readlink("/proc/curproc/file", launcher_name, PATH_MAX); +#else +#error "unknown OS" +#endif if (r == -1) { /* If /proc/self/exe can't be followed, don't give up. Instead continue with an empty string for VALGRIND_LAUNCHER. In the sys_execve wrapper, this is tested, and if found to be empty, fail the execve. */ +#if defined(VGO_linux) fprintf(stderr, "valgrind: warning (non-fatal): " "readlink(\"/proc/self/exe\") failed.\n"); +#elif defined(VGO_freebsd) + fprintf(stderr, "valgrind: warning (non-fatal): " + "readlink(\"/proc/curproc/file\") failed.\n"); +#else +#error "unknown OS" +#endif fprintf(stderr, "valgrind: continuing, however --trace-children=yes " "will not work.\n"); } ==== //depot/projects/valgrind/coregrind/m_aspacemgr/aspacemgr.c#2 (text+ko) ==== @@ -449,6 +449,13 @@ # elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length, prot, flags, fd, offset); +# elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) + if (flags & VKI_MAP_ANONYMOUS && fd == 0) + fd = -1; + // AAA: fix 64 bit start + // QQQ: truncates to 32 bit offset!! + res = VG_(do_syscall7)(__NR_mmap, (UWord)start, length, + prot, flags, fd, 0, offset); # else # error Unknown platform # endif @@ -468,6 +475,7 @@ static SysRes do_extend_mapping_NO_NOTIFY( Addr old_addr, SizeT old_len, SizeT new_len ) { +#ifdef VGO_linux /* Extend the mapping old_addr .. old_addr+old_len-1 to have length new_len, WITHOUT moving it. If it can't be extended in place, fail. */ @@ -477,6 +485,12 @@ 0/*flags, meaning: must be at old_addr, else FAIL */, 0/*new_addr, is ignored*/ ); +#else + SysRes res; + res.isError = 1; + res.val = 1; + return res; +#endif } static SysRes do_relocate_nooverlap_mapping_NO_NOTIFY( @@ -484,6 +498,7 @@ Addr new_addr, Addr new_len ) { +#ifdef VGO_linux /* Move the mapping old_addr .. old_addr+old_len-1 to the new location and with the new length. Only needs to handle the case where the two areas do not overlap, neither length is zero, and @@ -494,6 +509,12 @@ VKI_MREMAP_MAYMOVE|VKI_MREMAP_FIXED/*move-or-fail*/, new_addr ); +#else + SysRes res; + res.isError = 1; + res.val = 1; + return res; +#endif } static Int aspacem_readlink(HChar* path, HChar* buf, UInt bufsiz) @@ -519,7 +540,9 @@ static void aspacem_exit( Int status ) { +#ifdef VGO_linux (void)VG_(do_syscall1)(__NR_exit_group, status ); +#endif (void)VG_(do_syscall1)(__NR_exit, status ); /* Why are we still alive here? */ /*NOTREACHED*/ @@ -581,6 +604,7 @@ /* Given a file descriptor, attempt to deduce its filename. To do this, we use /proc/self/fd/<FD>. If this doesn't point to a file, or if it doesn't exist, we return False. */ +#if defined(VGO_linux) static Bool get_name_for_fd ( Int fd, /*OUT*/HChar* buf, Int nbuf ) { @@ -595,6 +619,49 @@ else return False; } +#elif defined(VGO_freebsd) +static +Bool get_name_for_fd ( Int fd, HChar* buf, Int nbuf ) +{ + static int nr_fromfd = -1; + SysRes res; + Int i; + + for (i = 0; i < nbuf; i++) buf[i] = 0; + if (nr_fromfd == -1) { + int oid[2]; + int real_oid[10]; + vki_size_t oidlen; + char *name = "machdep.getpath_fromfd_num"; + vki_size_t len; + int sc; + + oid[0] = 0; /* magic */ + oid[1] = 3; /* undocumented */ + oidlen = sizeof(real_oid); + res = VG_(do_syscall6)(__NR___sysctl, (UWord)oid, 2, (UWord)real_oid, (UWord)&oidlen, (UWord)name, strlen(name)); + oidlen /= sizeof(int); + if (!res.isError && oidlen > 0) { + len = sizeof(sc); + res = VG_(do_syscall6)(__NR___sysctl, (UWord)real_oid, oidlen, (UWord)&sc, (UWord)&len, 0, 0); + if (!res.isError && sc > 0) + nr_fromfd = sc; + } + if (nr_fromfd == -1) + nr_fromfd = -2; + } + if (nr_fromfd < 0) + return False; + + res = VG_(do_syscall3)(nr_fromfd, fd, (UWord)buf, nbuf); + if (!res.isError && buf[0] == '/') + return True; + else + return False; +} +#else +#error undefined os +#endif /*-----------------------------------------------------------------*/ @@ -1191,12 +1258,15 @@ same = same && seg_prot == prot +#ifndef VGO_freebsd && (cmp_devino ? (nsegments[i].dev == dev && nsegments[i].ino == ino) : True) && (cmp_offsets ? nsegments[i].start-nsegments[i].offset == addr-offset - : True); + : True) +#endif + ; if (!same) { sync_check_ok = False; VG_(debugLog)( @@ -1712,8 +1782,12 @@ seg.kind = SkAnonV; if (dev != 0 && ino != 0) seg.kind = SkFileV; - if (filename) + if (filename) { +#if defined(VGO_freebsd) + seg.kind = SkFileV; +#endif seg.fnIdx = allocate_segname( filename ); + } if (0) show_nsegment( 2,0, &seg ); add_segment( &seg ); @@ -1761,7 +1835,11 @@ " sp_at_startup = 0x%010llx (supplied)\n", (ULong)sp_at_startup ); +#ifdef VGP_x86_freebsd + aspacem_minAddr = (Addr) 0x00010000; // 64K +#else aspacem_minAddr = (Addr) 0x04000000; // 64M +#endif # if VG_WORDSIZE == 8 aspacem_maxAddr = (Addr)0x800000000 - 1; // 32G @@ -1822,10 +1900,18 @@ VG_(am_show_nsegments)(2, "Initial layout"); +#ifdef VGO_freebsd + VG_(debugLog)(2, "aspacem", "Reading /proc/curproc/map\n"); +#else VG_(debugLog)(2, "aspacem", "Reading /proc/self/maps\n"); +#endif parse_procselfmaps( read_maps_callback, NULL ); +#ifdef VGO_freebsd + VG_(am_show_nsegments)(2, "With contents of /proc/curproc/map"); +#else VG_(am_show_nsegments)(2, "With contents of /proc/self/maps"); +#endif AM_SANITY_CHECK; return suggested_clstack_top; @@ -2378,7 +2464,7 @@ sres = VG_(am_do_mmap_NO_NOTIFY)( start, length, prot, VKI_MAP_FIXED|VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS, - 0, 0 + 0, 0 ); if (sres.isError) return sres; @@ -2743,6 +2829,7 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708081906.l78J6YPl010220>