8531 Commits

Author SHA1 Message Date
Tom Hughes
d74a1f2d39 Fix perf_event open on s390.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11808
2011-06-08 20:55:29 +00:00
Tom Hughes
1017470b36 Fix some warnings I introduced in r11804.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11807
2011-06-08 09:57:54 +00:00
Tom Hughes
42bc84e869 Add support for prlimit64 on x86 and amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11806
2011-06-08 09:55:54 +00:00
Tom Hughes
8bc495c8d7 Update system call lists to match current kernel source.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11805
2011-06-08 09:12:07 +00:00
Tom Hughes
912fe51553 It seems that the perf_counter_open system call was renamed to
perf_event_open some time after we added it, so correct the name
wherever it appears to match the current kernel source.

Also fixup the PRE handler to do the check correctly, using the
size field of the structure to work out how much data there is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11804
2011-06-08 09:10:40 +00:00
Julian Seward
532b65e337 Add a simple but (to me, at least) useful thing, if (0)'d by default,
to print a line of text approximately every 20 million SBs.  This is
useful for monitoring the progress of long running programs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11803
2011-06-07 22:54:32 +00:00
Tom Hughes
af8ec0a591 Define _GNU_SOURCE for access to CLONE_XXX flags with gibc 2.14 headers.
Based on patch from Dmitry Djachenko <dimhen@gmail.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11802
2011-06-07 22:53:21 +00:00
Julian Seward
d9ce3d3cc8 Fix the computation of debuginfo bias values, in the case where the
debuginfo object has been not been prelinked but the main object has.
Fixes a segfault observed running any C++ application (eg,
drd/tests/annotate_smart_pointer) on Fedora 14 (32-bit), when the
debuginfo RPM for libstdc++ is installed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11801
2011-06-07 22:44:09 +00:00
Tom Hughes
db1a5172ce Add glibc 2.14 support. Patch from Dmitry Djachenko <dimhen@gmail.com>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11800
2011-06-07 21:52:26 +00:00
Julian Seward
0d56e0ef2b find_nsegment_idx: double size of the lookup cache in an attempt
to mitigate the probable increase in miss rates resulting from
r11798 (which causes increased numbers of such queries).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11799
2011-06-07 21:42:07 +00:00
Julian Seward
da49be7c14 Add a fourth --smc-check= variant, --smc-check=all-non-file. This
adds self-modifying-code checks to all guest code taken from mappings
which are not file backed, but omits checks in code from file backed
mappings.  This has the effect of giving complete smc-coverage of JIT
generated code -- since that is invariably generated into anonymous
mapped areas -- without burdening non-JIT generated code with such
checks.  Running Firefox 6, --smc-check=all-non-file reduces by a
factor of between 3 and 10 the number of translations requiring a self
check, compared to --smc-check=all.  These changes depend on the vex
interface changes in r2158.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11798
2011-06-07 21:39:28 +00:00
Bart Van Assche
953f93f969 Mention the "3.x" Linux kernel version explicitly in the kernel version configure message
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11797
2011-06-05 10:01:48 +00:00
Bart Van Assche
e0518c5f9c Make Valgrind build on Linux kernel 3.0 and beyond. Closes #274926. An official
statement that the Linux kernel 3.0 API and ABI is compatible with Linux kernel
2.6 can be found here: http://lkml.org/lkml/2011/5/29/204.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11796
2011-06-05 08:51:47 +00:00
Julian Seward
c1841e384b Followup fix to r11794 (generalise processing of PT_LOAD entries):
change some incorrect "rx->bias" (which due to lameness of C's type
system was valid) to "inrx->bias".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11795
2011-06-03 23:27:39 +00:00
Julian Seward
35756a6d62 ML_(read_elf_debug_info): when processing PT_LOAD entries from the
program header, don't make the following assumptions

- that there is only one r-x and one rw- entry

- that the r-x entry appears before the rw- entry

This makes it possible to handle ELF objects processed by Mike
Hommey's elfhack program.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11794
2011-06-02 10:06:25 +00:00
Julian Seward
68f57d0181 On arm-linux, give gcc "-mcpu=cortex-a8" so as to persuade it to
accept the armv6t2 (I think) insns (movt, movw) in
dispatch-arm-linux.S.  Some older gccs apparently think they are
compiling for armv6 by default and reject them (gcc 4.4.1 on Ubuntu
9.10, for one.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11793
2011-05-31 07:17:54 +00:00
Julian Seward
d2a4c327d0 Add file missing from r11791 due to insufficient coffee.
#214909 c 101.  (Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11792
2011-05-31 07:14:42 +00:00
Julian Seward
62e0d0b316 More gdbserver test fixes, from #214909 c 101:
fix mcsig(no)pass on arm Ubuntu10, arm thumb internal doc, improve
simulate_control_c

* new file docs/internals/arm_thumb_notes_gdbserver.txt
  documentation about the subtilities of the thumb bit handling in gdbsrv.
* made the SIGFPE backtrace filtering less dependent on gdb/os/libc/...
* improved simulate_control_c : runs faster/less dependent on timeout value


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11791
2011-05-31 07:09:06 +00:00
Julian Seward
f06ee2d1e1 Handle ELF objects with two .eh_frame sections. This fixes a problem
handling libxul.so when linked by gold on x86_64.  (n-i-bz)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11790
2011-05-30 10:18:59 +00:00
Julian Seward
cba2893074 Un-break all non x86/amd64 targets following r11786, duh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11789
2011-05-30 06:29:39 +00:00
Julian Seward
a6ffae5ac9 Un-break Darwin build following r2155/r11786 -- use dual-entry
dispatchers for x86 and amd64, and add corresponding improvements.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11788
2011-05-29 12:40:27 +00:00
Julian Seward
9b93938907 Remove a load from the s390x dispatcher loop, as per r11781.
(Florian Krohm <britzel@acm.org>).  #274378.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11787
2011-05-29 09:38:58 +00:00
Julian Seward
ffc3968ff2 Give the amd64-linux and x86-linux dispatchers two entry points, not one,
so as to avoid a GSP-changed check in the common case.  See vex r2155.
(amd64-darwin and x86-darwin are now temporarily unbuildable.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11786
2011-05-29 09:34:30 +00:00
Julian Seward
3a131dc867 dispatch-x86-linux.S:
use test-based detection of GSP pointer changes.
   Saves one load per SB.

dispatch-amd64-linux.S:
   ditto

dispatch-amd64-linux.S:
   use movabsq to get &VG_(tt_fast) into a register,
   instead of an rsp-relative load from a constant pool.
   Saves a second load per SB.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11785
2011-05-28 17:07:53 +00:00
Julian Seward
84fa16228a Undo bogus comment changes committed in r11783.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11784
2011-05-28 16:58:45 +00:00
Julian Seward
55daaf1836 Test for guest-state-pointer changes by checking its lowest bit.
Removes one memory reference from the dispatcher loop.  As per r11781
for arm-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11783
2011-05-28 15:58:13 +00:00
Julian Seward
176e7d6218 Fix ppc64-linux build following introduction of IRStmt_Mark::delta
in vex r2153.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11782
2011-05-28 15:34:17 +00:00
Julian Seward
f8e9ab3607 Remove another memory reference from the arm dispatcher loop, by using
the fact that all {VG,VEX}_TRC_VALUES have their lowest bit set.  All
other targets can benefit from this trick too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11781
2011-05-28 11:05:44 +00:00
Julian Seward
3bcd288100 Get rid of a bunch of loads in the arm dispatcher inner loops, and
make some attempt to schedule for Cortex-A8.  Improves overall IPC
for none running perf/bz2.c "-O" from 0.879 to 0.925.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11780
2011-05-28 10:16:58 +00:00
Julian Seward
dd51367883 Further fixes for GDB server on Thumb code:
* Disabled several tests on ARM when gdb version < 7.1
  gdb 7.0 has problems with next/step/... in ARM thumb code.

* Documented in manual-core.xml that ARM thumb code implies
  a gdb version >= 7.1

* m_gdbserver.h/.c : take into account the thumb bit at several places

* use new IRStmt_IMark::delta field to distinguish ARM vs Thumb
  instructions as committed in vex r2153

Patch from bug 214909 comment 99 (valgrind part).
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11779
2011-05-27 13:23:44 +00:00
Bart Van Assche
4c5fcff44c DRD: eliminate two redundant global variable definitions. See also #273536.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11778
2011-05-18 16:09:54 +00:00
Bart Van Assche
4bdf51c14b Define pass_signals[] only once such that Valgrind can be built with -fno-common. This is a modified version of the second patch attached to #273536.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11777
2011-05-18 16:08:28 +00:00
Bart Van Assche
da5eddc400 Follow-up for r11770: added missing 'void' keyword.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11776
2011-05-18 16:04:46 +00:00
Bart Van Assche
97a0c3e5d1 Reverted r11774 because it didn't make sense.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11775
2011-05-18 15:51:51 +00:00
Bart Van Assche
1de28c3b2a Added missing extern keywords. Patch provided by Daniel Richard G. - closes #275536.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11774
2011-05-18 10:12:36 +00:00
Bart Van Assche
4ba7af4366 Updated Subversion ignore list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11773
2011-05-18 06:04:00 +00:00
Julian Seward
27d230b660 gdbserver: (#214909 c 91)
add cleanup: line to none/tests/require-text-symbol-2.vgtest
In case Valgrind terminates abnormally, then no cleanup is done.
In this case, the abnormal termination is in the test which checks
--require-text-symbol=:*libc.so*:doesntexist
This patch adds a cleanup: line to the test.

(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11772
2011-05-17 21:35:41 +00:00
Julian Seward
77ea74b82e gdbserver: (#214909 c 82)
ensure proper cleanup of gdbsrv FIFOs/shmem files with untraced fork/exec

* syswrap-{generic|darwin|aix5}.c : in PRE(sys_execve) : terminate gdbserver
* pub_core_gdbserver.h and m_gdbserver.c : add VG_(gdbserver_prerun_action),
  factorising the actions to do by gdbserver at "startup" (i.e. a traced
  fork or a traced exec).
* scheduler.c : implement startup action using VG_(gdbserver_prerun_action)

(Philippe Waroquiers, philippe.waroquiers@skynet.be)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11771
2011-05-17 18:14:53 +00:00
Julian Seward
739bc05601 gdbserver: misc fixes (#214909 c 77)
Fix some tests on ppc-debian6,s390x + handled Nick Nethercote, Josef
Weidendorfer comments

* improved testing & related doc
  - added option --vex-iropt-precise-memory-exns=yes to mcsig(no)pass.vgtest
    + updated manual-core.xml
  - cleanup some comments in *.vgtest 
  - modified filter_gdb and filter_memcheck_monitor to
    handle specific ppc/debian6.0 mcsig(no)pass output
    handle specific s390x 'missing debug info'
  - added more information in README_DEVELOPPERS on how to
    investigate failing gdbserver tests.

* handled Nick Nethercote comment:
  Replaced kludgy ms.snapshot detailed
              by  ms.detailed_snaphot
  Updated documentation and test.

* handled Josef Weindendorfer comments:
   - do not report an error if ptrace_scope file can't be read.
     Instead, a debug trace is done if -d (debug) option given
   - added an option -l to give the list of active Valgrind
     gdbserver. Useful a.o. to support callgrind_control.
     Updated documentation
   - added ref. to  vgdb help in the vgdb --help message

(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11770
2011-05-17 17:15:07 +00:00
Bart Van Assche
773cf4f2eb drd/tests/pth_detached.c: eliminated thread_arg[] array and introduced PTHREAD_STACK_MIN.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11769
2011-05-17 16:45:08 +00:00
Julian Seward
4c205c2b43 gdbserver: Fixes for ARM-Thumb (#214909 c 76)
fix arm thumb by transforming an address to its thumb form when needed

* added a function thumb_pc transforming a pc to its thumb form if needed
  (using an heuristic to guess if this is a thumb address)
* when program counter is modified by gdb, use thumb_pc
* use thumb_pc in monitor command vg.translate

(I was able to check that this improves inferior call on a small
thumb compiled executable + mcinfcallRU test) but I could not compile
all tests with thumb).

(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11768
2011-05-17 16:35:11 +00:00
Julian Seward
b1a67076a2 Better checking for command line options that should be either 'yes'
or 'no'.  Fixes #269144.  (a125246@prtnx.com, Florian Krohm
<britzel@acm.org>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11767
2011-05-17 16:29:29 +00:00
Julian Seward
2184f38863 s390x: add test cases for STCK{,E,F} instructions. See #271779.
(Christian Borntraeger <borntraeger@de.ibm.com> and Divya Vyas)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11766
2011-05-17 16:19:53 +00:00
Julian Seward
c2aaad41cc Enable sys_pwrite64 on ppc64-linux. Fixes #272955.
(Maynard Johnson, maynardj@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11765
2011-05-17 16:07:33 +00:00
Julian Seward
c36bec1cc5 Add entry w.r.t. the s390x port. (Florian Krohm <britzel@acm.org> and
Christian Borntraeger <borntraeger@de.ibm.com>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11764
2011-05-17 15:54:31 +00:00
Julian Seward
0ffb0b1095 Update expected outputs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11763
2011-05-17 15:52:28 +00:00
Julian Seward
ea6aa5fd25 Make this test much more independent of glibc, and update outputs
accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11762
2011-05-17 15:36:01 +00:00
Julian Seward
fa642b19c5 Reorder tests poking around in the x86 instruction stream (sigh)
in order to try and avoid segfaults when we back up over a page
boundary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11761
2011-05-16 11:49:40 +00:00
Bart Van Assche
cf933f5dc4 Suppressed compiler warnings triggered by none/tests/amd64/fxtract.c too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11760
2011-05-15 17:53:26 +00:00
Bart Van Assche
1a2eb84398 gdbserver_tests/make_local_links: made invocation of "head" POSIX-compliant since on some distros only the POSIX-compliant invocation is accepted.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11759
2011-05-15 17:07:47 +00:00