]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
12 years agoAdd missing comment marker.
Julian Seward [Fri, 8 Aug 2014 08:58:03 +0000 (08:58 +0000)] 
Add missing comment marker.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14241

12 years agoThis commit is for Bugzilla 334836. The Bugzilla contains patch 3 of 3
Carl Love [Thu, 7 Aug 2014 23:49:27 +0000 (23:49 +0000)] 
This commit is for Bugzilla 334836.  The Bugzilla contains patch 3 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334834.  Note, there are no VEX changes in this patch.

PP64 Little Endian test case fixes.

This patch adds new LE and BE expect files where needed.  In other
cases, the test was fixed to run correctly on LE and BE using based on
testing to see which platform is being used.

Where practical, the test cases have been changed so that the output
produced for BE  and LE will be identical.  The test cases that require
a major rewrite to make the output identical for BE and LE simply
had an additional expect file added.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14240

12 years agoThis commit is for Bugzilla 334834. The Bugzilla contains patch 2 of 3
Carl Love [Thu, 7 Aug 2014 23:35:54 +0000 (23:35 +0000)] 
This commit is for Bugzilla 334834.  The Bugzilla contains patch 2 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334836.

POWER PC, add the functional Little Endian support, patch 2

The IBM POWER processor now supports both Big Endian and Little Endian.
The ABI for Little Endian also changes.  Specifically, the function
descriptor is not used, the stack size changed, accessing the TOC
changed.  Functions now have a local and a global entry point.  Register
r2 contains the TOC for local calls and register r12 contains the TOC
for global calls.  This patch makes the functional changes to the
Valgrind tool.  The patch makes the changes needed for the
none/tests/ppc32 and none/tests/ppc64 Makefile.am.  A number of the
ppc specific tests have Endian dependencies that are not fixed in
this patch.  They are fixed in the next patch.

Per Julian's comments renamed coregrind/m_dispatch/dispatch-ppc64-linux.S
to coregrind/m_dispatch/dispatch-ppc64be-linux.S  Created new file for LE
coregrind/m_dispatch/dispatch-ppc64le-linux.S.  The same was done for
coregrind/m_syswrap/syscall-ppc-linux.S.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14239

12 years agoThis commit is for Bugzilla 334834. The Bugzilla contains patch 2 of 3
Carl Love [Thu, 7 Aug 2014 23:25:23 +0000 (23:25 +0000)] 
This commit is for Bugzilla 334834.  The Bugzilla contains patch 2 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334836.

POWER PC, add the functional Little Endian support, patch 2 VEX part

The IBM POWER processor now supports both Big Endian and Little Endian.
The ABI for Little Endian also changes.  Specifically, the function
descriptor is not used, the stack size changed, accessing the TOC
changed.  Functions now have a local and a global entry point.  Register
r2 contains the TOC for local calls and register r12 contains the TOC
for global calls.  This patch makes the functional changes to the
Valgrind tool.  The patch makes the changes needed for the
none/tests/ppc32 and none/tests/ppc64 Makefile.am.  A number of the
ppc specific tests have Endian dependencies that are not fixed in
this patch.  They are fixed in the next patch.

Per Julian's comments renamed coregrind/m_dispatch/dispatch-ppc64-linux.S
to coregrind/m_dispatch/dispatch-ppc64be-linux.S  Created new file for LE
coregrind/m_dispatch/dispatch-ppc64le-linux.S.  The same was done for
coregrind/m_syswrap/syscall-ppc-linux.S.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/vex/trunk@2914

12 years agoThis commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
Carl Love [Thu, 7 Aug 2014 23:17:29 +0000 (23:17 +0000)] 
This commit is for Bugzilla 334384.  The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238

12 years agopre_mem_read_sockaddr: properly handle the NETLINK address family
Julian Seward [Wed, 6 Aug 2014 19:52:12 +0000 (19:52 +0000)] 
pre_mem_read_sockaddr: properly handle the NETLINK address family
rather than throwing to the default case.  This stops Memcheck
reporting false positives for the NETLINK case.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14237

12 years agofix 338024 inlined functions are not shown if DW_AT_ranges is used
Philippe Waroquiers [Tue, 5 Aug 2014 19:34:35 +0000 (19:34 +0000)] 
fix 338024  inlined functions are not shown if DW_AT_ranges is used
Based on investigation and patch by Matthias Schwarzott.
(no small test found that reproduced the problem,
but the equivalent patch given in bug 338024 fixed the inlined stack
trace  in a big shared lib).
Would be nice however to have a small test case ...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14236

12 years agoadd support for VKI_BLKDISCARDZEROES
Christian Borntraeger [Tue, 5 Aug 2014 15:14:52 +0000 (15:14 +0000)] 
add support for VKI_BLKDISCARDZEROES

this is used in some newer QEMU versions and other tools

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14235

12 years agoNEWS: Add #331829 (Unexpected ioctl opcode sign extension)
Bart Van Assche [Tue, 5 Aug 2014 12:03:51 +0000 (12:03 +0000)] 
NEWS: Add #331829 (Unexpected ioctl opcode sign extension)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14234

12 years agoLinux: Add support for Lustre FID2PATH ioctl (#331829)
Bart Van Assche [Tue, 5 Aug 2014 12:01:26 +0000 (12:01 +0000)] 
Linux: Add support for Lustre FID2PATH ioctl (#331829)

This is a modified version of a patch provided by Frank Zago (fzago@cray.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14233

12 years agoLinux system call wrappers: truncate ioctl request number to 32 bits
Bart Van Assche [Tue, 5 Aug 2014 11:35:48 +0000 (11:35 +0000)] 
Linux system call wrappers: truncate ioctl request number to 32 bits

As explained in https://bugs.kde.org/show_bug.cgi?id=331829, when passing
an ioctl request number as an int to a function the request number will
be sign-extended to 64 bits on 64-bit systems. Avoid that this causes
Valgrind to fail to recognize an ioctl by truncating the request number
to 32 bits.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14232

12 years agoEnable tests for: sq{r}dmulh (scalar vs elem, vector vs elem),
Julian Seward [Mon, 4 Aug 2014 08:11:33 +0000 (08:11 +0000)] 
Enable tests for: sq{r}dmulh (scalar vs elem, vector vs elem),
sqshl, uqshl, sqrshl, uqrshl (reg) (vector and scalar).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14231

12 years agoarm64: add support for: sqshl, uqshl, sqrshl, uqrshl (reg) (vector and scalar)
Julian Seward [Mon, 4 Aug 2014 08:09:47 +0000 (08:09 +0000)] 
arm64: add support for: sqshl, uqshl, sqrshl, uqrshl (reg) (vector and scalar)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2913

12 years agoAdd a folding rule: XorV128(t,0) ==> t.
Julian Seward [Mon, 4 Aug 2014 08:09:23 +0000 (08:09 +0000)] 
Add a folding rule: XorV128(t,0) ==> t.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2912

12 years agoarm64: implement remaining SQDMULH and SQRDMULH cases.
Julian Seward [Sun, 3 Aug 2014 12:45:19 +0000 (12:45 +0000)] 
arm64: implement remaining SQDMULH and SQRDMULH cases.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2911

12 years agoAllow no debuginfo to be found when (trying to) produce the help msg
Philippe Waroquiers [Thu, 31 Jul 2014 21:15:42 +0000 (21:15 +0000)] 
Allow no debuginfo to be found when (trying to) produce the help msg
for activating the host visibility in gdbsrv

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14227

12 years agoensure the regcache is in sync with the fpsr part VEX represents
Philippe Waroquiers [Thu, 31 Jul 2014 20:13:23 +0000 (20:13 +0000)] 
ensure the regcache is in sync with the fpsr part VEX represents
when fpsr is modified from gdb

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14225

12 years agotake endianness into account in arm64 fpsr xfer,
Philippe Waroquiers [Thu, 31 Jul 2014 19:44:24 +0000 (19:44 +0000)] 
take endianness into account in arm64 fpsr xfer,
use VKI_LITTLE_ENDIAN to decide to reverse or not bytes in image function

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14223

12 years agoarm64: fix the conversion from/to VEX fpsr to/from GDB representation
Philippe Waroquiers [Thu, 31 Jul 2014 17:55:27 +0000 (17:55 +0000)] 
arm64: fix the conversion from/to VEX fpsr to/from GDB representation

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14219

12 years agocfsi_m_ix array should only be indexed according to sizeof_m_ix,
Philippe Waroquiers [Thu, 31 Jul 2014 16:44:51 +0000 (16:44 +0000)] 
cfsi_m_ix array should only be indexed according to sizeof_m_ix,
so decalre as a void*.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14218

12 years agoAdd support for stack unwinding using the ARM32 specific EXIDX format.
Julian Seward [Thu, 31 Jul 2014 14:25:29 +0000 (14:25 +0000)] 
Add support for stack unwinding using the ARM32 specific EXIDX format.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14217

12 years agoFix dangling ref in m_errormgr.c + report all uninit fields in a syscall param
Philippe Waroquiers [Wed, 30 Jul 2014 22:20:29 +0000 (22:20 +0000)] 
Fix dangling ref in m_errormgr.c + report all uninit fields in a syscall param

Some syscall verification code is allocating memory to generate
the string used to build an error, e.g. syswrap-generic.c verifying fields of
e.g socket addresses (pre_mem_read_sockaddr) or sendmsg/recvmsg args
(msghdr_foreachfield)

The allocated pointer was copied in the error created by VG_(maybe_record_error).

This was wrong for 2 reasons:
1. If the error is a new error, it is stored in a list of errors,
   but the string memory was freed by pre_mem_read_sockaddr, msghdr_foreachfield, ...
   This causes a dangling reference. Was at least visible when giving -v, which
   re-prints all errors at the end of execution.
   Probably this could have some consequences during run while generating new errors,
   and comparing for equality with a recorded error having a dangling reference.
2. the same allocated string is re-used for each piece/field of the verified struct.
   The code in mc_errors.c that checks that 2 errors are identical was then wrongly
   considereing that 2 successive errors for 2 different fields for the same syscall
   arg are identical, just because the error string happened to be produced at
   the same address.
(it is believed that initially, the error string was assumed to be a static
string, which is not the case anymore, causing the above 2 problems).

Changes:
* The fix consists in duplicating in m_errormgr.c the given error string when
  the error is recorded. In other words, the error string is now duplicated similarly
  to the (optional) extra component of the error.

* memcheck/tests/linux/rfcomm.c test modified as now an error is reported
  for each uninit field.

* socketaddr unknown family is also better reported (using sa_data field name,
  rather than an empty field name.

* minor reformatting in m_errormgr.c, to be below 80 characters.

Some notes:
1. the string is only duplicated if the error is recorded
   (ie. printed or the first time an error matches a suppression).
   The string is not duplicated for duplicated errors or following errors
   matching the first (suppressed) error.
   The string is also not duplicated for 'unique errors' (that are printed
   and then not recorded).
2. duplicating the string for each recorded error is not deemed to
   use a lot of memory:
     * error strings are usually NULL or short (often 10 bytes or so).
     * we expect no program has a huge number of errors
   If ever this string duplicate would be significant, having a DedupPoolAlloc
   in m_errormgr.c for these strings would reduce this memory (as we expect to
   have very few different strings, even with millions of errors).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14214

12 years agoFix copyright years.
Florian Krohm [Wed, 30 Jul 2014 18:40:52 +0000 (18:40 +0000)] 
Fix copyright years.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14211

12 years agoAnnounce now in NEWS that now all locks are announced.
Philippe Waroquiers [Tue, 29 Jul 2014 20:19:04 +0000 (20:19 +0000)] 
Announce now in NEWS that now all locks are announced.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14205

12 years agoHelgrind lock related error msg improvements.
Philippe Waroquiers [Tue, 29 Jul 2014 20:08:15 +0000 (20:08 +0000)] 
Helgrind lock related error msg improvements.

* Add lock announcements in various helgrind errors that were not
  announcing the locks
* ensure locks are also announced in xml (note that this is compatible
  with xml protocol version 4, so no impact on GUI which properly
  implement the protocol)

Changes done:
* Like other HG record_error functions, HG_(record_error_LockOrder) is
  now passing Lock* rather than lock guest addresses.
* update exp files for tests that were showing locks without announcing them
* change tc14_laog_dinphils.c and tc15_laog_lockdel.c so as to
  have same sizes on 32 and 64 bits systems for allocated or symbol sizes.
* factorise all code that was announcing first lock observation
* enable xml lock announcement

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14204

12 years agoBack out r14186 as it was identified to have caused a performance regression.
Florian Krohm [Tue, 29 Jul 2014 08:46:15 +0000 (08:46 +0000)] 
Back out r14186 as it was identified to have caused a performance regression.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14201

12 years agofix comment when calling get_sym_name()
Petar Jovanovic [Mon, 28 Jul 2014 15:52:04 +0000 (15:52 +0000)] 
fix comment when calling get_sym_name()

Fix incorrect comment, spotted by Florian K.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14199

12 years agoNo need to write the offset into a buffer when that
Florian Krohm [Sun, 27 Jul 2014 14:46:52 +0000 (14:46 +0000)] 
No need to write the offset into a buffer when that
buffer is not used.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14198

12 years agoglibc 2.3.4 does not appear to define PTRACE_GETSIGINFO. This was
Florian Krohm [Sun, 27 Jul 2014 12:24:46 +0000 (12:24 +0000)] 
glibc 2.3.4 does not appear to define PTRACE_GETSIGINFO. This was
observed on a RHEL5 system on s390. Provide a suitable definition.
Tweak gdbserver_tests/filter_stderr to ignore messages related to
interrupted poll system calls.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14197

12 years agoRemove two unneded include files.
Florian Krohm [Sat, 26 Jul 2014 17:26:22 +0000 (17:26 +0000)] 
Remove two unneded include files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14196

12 years agoFix a comment.
Florian Krohm [Sat, 26 Jul 2014 14:51:28 +0000 (14:51 +0000)] 
Fix a comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14195

12 years agoAdapt testcase so it can be compiled with GCC 3.4.6.
Florian Krohm [Sat, 26 Jul 2014 11:36:50 +0000 (11:36 +0000)] 
Adapt testcase so it can be compiled with GCC 3.4.6.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14194

12 years agoAdapt testcase so it can be compiled with GCC 3.4.6 against glibc 2.3.4
Florian Krohm [Sat, 26 Jul 2014 11:10:30 +0000 (11:10 +0000)] 
Adapt testcase so it can be compiled with GCC 3.4.6 against glibc 2.3.4

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14193

12 years agoHave m_addrinfo.c giving more details about an address in a text segment
Philippe Waroquiers [Fri, 25 Jul 2014 20:46:01 +0000 (20:46 +0000)] 
Have m_addrinfo.c giving more details about an address in a text segment
(using a fake 'one address' stack trace).

This a.o. can be used with the gdbsrv 'monitor v.info location 0x.....'
to compare gdb and valgrind address to source mapping.

Any tool that use pub_tool_addrinfo.h will also better descrive
text addresses.

No impact on tests, as there is no test testing 'segment' address
description :(

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14192

12 years agoAdd LIKELY as suggested by Philippe.
Florian Krohm [Fri, 25 Jul 2014 08:38:02 +0000 (08:38 +0000)] 
Add LIKELY as suggested by Philippe.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14191

12 years agoSmall follow up to lock address description: now that we describe
Philippe Waroquiers [Thu, 24 Jul 2014 22:30:08 +0000 (22:30 +0000)] 
Small follow up to lock address description: now that we describe
lock address, we can print something even if the lock observation
has no stacktrace.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14190

12 years agoRemove an unneeded function call.
Florian Krohm [Thu, 24 Jul 2014 21:14:52 +0000 (21:14 +0000)] 
Remove an unneeded function call.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14189

12 years agoDescribe the lock address in a lock announcement message.
Philippe Waroquiers [Thu, 24 Jul 2014 21:00:24 +0000 (21:00 +0000)] 
Describe the lock address in a lock announcement message.

(note that some error messages are not announcing the lock,
which is not that nice).
At least the lock order violation message do not announce locks.
That should be improved/fixed

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14188

12 years agoUpdate a comment so it won't need updating in the future.
Florian Krohm [Thu, 24 Jul 2014 19:26:32 +0000 (19:26 +0000)] 
Update a comment so it won't need updating in the future.
No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14187

12 years agoChange VG_(strncpy_safely) to use VG_(strncpy) to get the same padding
Florian Krohm [Thu, 24 Jul 2014 12:50:03 +0000 (12:50 +0000)] 
Change VG_(strncpy_safely) to use VG_(strncpy) to get the same padding
behaviour.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14186

12 years agoFactor out VG_(exit_now) to contain the syscall incantation to terminate
Florian Krohm [Thu, 24 Jul 2014 12:46:28 +0000 (12:46 +0000)] 
Factor out VG_(exit_now) to contain the syscall incantation to terminate
the process. Make ML_(am_exit) and VG_(exit) use it, thereby avoiding
double maintenance.
Introduce libcbase_assert macro and use it in VG_(strncpy_safely) to
document the case that function cannot handle.
Add stub functions to memcheck/tests/unit_libcbase.c to satisfy new
dependencies.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14185

12 years agoTrack vex r2910 (infrastructural improvements in representation of
Julian Seward [Thu, 24 Jul 2014 12:45:24 +0000 (12:45 +0000)] 
Track vex r2910 (infrastructural improvements in representation of
endianness in VEX).

In short: in m_machine.c, VG_(machine_get_hwcaps), get the endianness
of the host, and pass it through to all places (in VEX) where it is
required.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14184

12 years agoImprove infrastructure for dealing with endianness in VEX. This patch
Julian Seward [Thu, 24 Jul 2014 12:42:03 +0000 (12:42 +0000)] 
Improve infrastructure for dealing with endianness in VEX.  This patch
removes all decisions about endianness from VEX.  Instead, it requires
that the LibVEX_* calls pass in information about the guest or host
endianness (depending on context) and in turn it passes that info
through to all the places that need it:

* the front ends (xx_toIR.c)
* the back ends (xx_isel.c)
* the patcher functions (Chain, UnChain, PatchProfInc)

Mostly it is boring and ugly plumbing.  As far as types go, there is a
new type "VexEndness" that carries the endianness.  This also makes it
possible to stop using Bools to indicate endianness.  VexArchInfo has
a new field of type VexEndness.  Apart from that, no other changes in
types.

Followups: MIPS front and back ends have not yet been fixed up to use
the passed-in endianness information.  Currently they assume that the
endianness of both host and guest is the same as the endianness of the
target for which VEX is being compiled.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2910

12 years agooptimise readpdb.c filename and dirname handling, following r14158
Philippe Waroquiers [Wed, 23 Jul 2014 20:28:11 +0000 (20:28 +0000)] 
optimise readpdb.c filename and dirname handling, following r14158

r14158 introduced a dedup pool to store pairs (filename,dirname).
The windows debug info reader (readpdb.c) performance was still to be
improved, as calls to ML_(addFnDn) were done for each line loc to add.

With this patch, the nr of calls to ML_(addFnDn) should be reduced
significantly.

Code has been compiled and regtested on linux, but no windows/wine test
was done.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14183

12 years agoDocument fix of BZ#315199.
Tom Hughes [Wed, 23 Jul 2014 07:54:41 +0000 (07:54 +0000)] 
Document fix of  BZ#315199.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14182

12 years agoOutput details for the faulting thread first in a core dump.
Tom Hughes [Wed, 23 Jul 2014 07:54:19 +0000 (07:54 +0000)] 
Output details for the faulting thread first in a core dump.

Patch from Matthias Schwarzott via BZ#315199.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14181

12 years agoEnable test cases for:
Julian Seward [Tue, 22 Jul 2014 09:28:52 +0000 (09:28 +0000)] 
Enable test cases for:
{sqdmlal,sqdmlsl,sqdmull}{d_s_s[],s_h_h[]}
{sqdmlal,sqdmlsl,sqdmull}{d_s_s,s_h_h}
{sqdmlal,sqdmlsl,sqdmull}{2d_(2s_2s)/(4s_4s), 4s_(4h_4h)/(8h_8h)}
sqrdmulh 4s,2s,8h,4h (vector)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14180

12 years agoarm64: implement:
Julian Seward [Tue, 22 Jul 2014 09:27:49 +0000 (09:27 +0000)] 
arm64: implement:
{sqdmlal,sqdmlsl,sqdmull}{d_s_s[],s_h_h[]}
{sqdmlal,sqdmlsl,sqdmull}{d_s_s,s_h_h}
{sqdmlal,sqdmlsl,sqdmull}{2d_(2s_2s)/(4s_4s), 4s_(4h_4h)/(8h_8h)}
sqrdmulh 4s,2s,8h,4h (vector)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2909

12 years agoComment-only change.
Julian Seward [Tue, 22 Jul 2014 09:26:36 +0000 (09:26 +0000)] 
Comment-only change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2908

12 years agoAdd a new heuristic 'length64' to detect interior pointers
Philippe Waroquiers [Mon, 21 Jul 2014 19:55:11 +0000 (19:55 +0000)] 
Add a new heuristic 'length64' to detect interior pointers
pointing at offset 64bit of a block, when the first 8 bytes contains
the block size - 8. This is e.g. used by sqlite3MemMalloc.

Patch by Matthias Schwarzott (with small modif)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14179

12 years agoTrack vex r2907, which amongst other things, renamed Iop_QDMulLong* to
Julian Seward [Mon, 21 Jul 2014 09:21:57 +0000 (09:21 +0000)] 
Track vex r2907, which amongst other things, renamed Iop_QDMulLong* to
Iop_QDMull*.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14178

12 years agoEnable tests for: sqneg, {u,s}q{add,sub} (scalar),
Julian Seward [Mon, 21 Jul 2014 09:20:53 +0000 (09:20 +0000)] 
Enable tests for: sqneg, {u,s}q{add,sub} (scalar),
{sqdmlal,sqdmlsl,sqdmull} (vector x element).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14177

12 years agoarm64: implement: sqneg, {u,s}q{add,sub} (scalar),
Julian Seward [Mon, 21 Jul 2014 09:19:50 +0000 (09:19 +0000)] 
arm64: implement: sqneg, {u,s}q{add,sub} (scalar),
{sqdmlal,sqdmlsl,sqdmull} (vector x element)

As part of this, rename Iop_QDMulLong* to Iop_QDMull* so as to be
consistent with their non-saturating equivalents.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2907

12 years agoInitialise a couple of scalars that gcc -Og thinks might be
Julian Seward [Mon, 21 Jul 2014 07:55:45 +0000 (07:55 +0000)] 
Initialise a couple of scalars that gcc -Og thinks might be
uninitialised, presumably because at -Og it doesn't do enough
block straightening-outening or whatever to see that they are
always assigned before use.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2906

12 years agoAdd a few more algebraic optimisations for Iop_And8/16.
Florian Krohm [Fri, 18 Jul 2014 21:23:46 +0000 (21:23 +0000)] 
Add a few more algebraic optimisations for Iop_And8/16.
Observed on s390.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2905

12 years agoAdd configure check for arm64 user_regs_struct.
Mark Wielaard [Fri, 18 Jul 2014 20:45:37 +0000 (20:45 +0000)] 
Add configure check for arm64 user_regs_struct.

old glibc defined kernel user_pt_regs, but newer glibc instead
define user_regs_struct. Add a configure test to see what we need.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14176

12 years agoPatch adding (or showing the proper/not confusing) helgrind thread nr for block
Philippe Waroquiers [Fri, 18 Jul 2014 00:03:58 +0000 (00:03 +0000)] 
Patch adding (or showing the proper/not confusing) helgrind thread nr for block
and stack address description.

* A race condition on an allocated block shows the stacktrace, but
  does not show the thread # that allocated the block.
  This patch adds the output of the thread # that allocated the block.

*  The patch also fixes the confusion that might appear between
  the core threadid and the helgrind thread nr in Stack address description:
  A printed stack addrinfo was containing a thread id, while all other helgrind
  messages are using (supposed to use) an 'helgrind thread #' which
  is used in the thread announcement.

    Basically, the idea is to let a tool set a "tool specific thread nr'
    in an addrinfo.
    The pretty printing of the addrinfo is then by preference showing this
    thread nr (if it was set, i.e. different of 0).
    Currently, only helgrind uses this addrinfo tnr.

    Note: in xml mode, the output is matching the protocol description.
    I.e., GUI should not be impacted by this change, if they properly implement
    the xml protocol.

* Also, make the output produced by m_addrinfo consistent:
  The  message 'block was alloc'd at'  is changed to be like all other
  output : one character indent, and starting with an uppercase

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14175

12 years agoSimplify the code to get the function entry + avoids too many casts
Philippe Waroquiers [Thu, 17 Jul 2014 21:23:09 +0000 (21:23 +0000)] 
Simplify the code to get the function entry + avoids too many casts

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14174

12 years agoOmit frame pointer also for main in ppc ldst_multiple test.
Mark Wielaard [Thu, 17 Jul 2014 13:29:43 +0000 (13:29 +0000)] 
Omit frame pointer also for main in ppc ldst_multiple test.

Other functions already explicitly omitted the frame pointer. Also
do that for main to prevent gcc 4.8.2 complaining:

 ldst_multiple.c: In function ‘main’:
 ldst_multiple.c:180:5: error: frame pointer required, but reserved
  int main(void)
      ^
 ldst_multiple.c:31:18: note: for ‘r31’
  register HWord_t r31 asm("r31");

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14173

12 years agoppc64 ifunc_wrapper add casts suggested by gcc warning.
Mark Wielaard [Thu, 17 Jul 2014 10:56:26 +0000 (10:56 +0000)] 
ppc64 ifunc_wrapper add casts suggested by gcc warning.

vg_preloaded.c: In function ‘_vgnU_ifunc_wrapper’:
vg_preloaded.c:91:13: warning: assignment makes integer from pointer without a cast [enabled by default]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14172

12 years agoUnbreak ppc32 compilation (remove last usage of host_ppc32_regalign_int64_args)
Philippe Waroquiers [Thu, 17 Jul 2014 05:22:06 +0000 (05:22 +0000)] 
Unbreak ppc32 compilation (remove last usage of host_ppc32_regalign_int64_args)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14171

12 years agoRemove fields from VexAbiInfo that only had relevance to the old AIX5
Julian Seward [Wed, 16 Jul 2014 23:14:33 +0000 (23:14 +0000)] 
Remove fields from VexAbiInfo that only had relevance to the old AIX5
port: guest_ppc_sc_continues_at_LR and host_ppc32_regalign_int64_args.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2904

12 years agoFix name of the file in the header comment
Philippe Waroquiers [Wed, 16 Jul 2014 21:16:10 +0000 (21:16 +0000)] 
Fix name of the file in the header comment

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14170

12 years agoComment out an unsed function to avoid a compiler warning.
Florian Krohm [Wed, 16 Jul 2014 20:29:38 +0000 (20:29 +0000)] 
Comment out an unsed function to avoid a compiler warning.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2903

12 years agoFix algebraic simplification for Iop_AndV256.
Florian Krohm [Wed, 16 Jul 2014 20:17:49 +0000 (20:17 +0000)] 
Fix algebraic simplification for Iop_AndV256.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2902

12 years agoUpdate list of ignored files.
Florian Krohm [Wed, 16 Jul 2014 08:20:54 +0000 (08:20 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14169

12 years agoAdd testcase from BZ #324149 which was forgotten in r13641.
Florian Krohm [Wed, 16 Jul 2014 08:18:17 +0000 (08:18 +0000)] 
Add testcase from BZ #324149 which was forgotten in r13641.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14168

12 years agoFix pointer qualifier discard warnings in memcheck/tests/varinforestrict.c.
Mark Wielaard [Tue, 15 Jul 2014 21:55:53 +0000 (21:55 +0000)] 
Fix pointer qualifier discard warnings in memcheck/tests/varinforestrict.c.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14167

12 years agoproduce cfsi and str dedup pa at the same verbosity level
Philippe Waroquiers [Tue, 15 Jul 2014 19:46:15 +0000 (19:46 +0000)] 
produce cfsi and str dedup pa at the same verbosity level

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14166

12 years agoBug 336619 valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.
Mark Wielaard [Tue, 15 Jul 2014 15:47:25 +0000 (15:47 +0000)] 
Bug 336619 valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14165

12 years agoarm64: get_Dwarf_Reg: at least handle the case of requesting XSP
Julian Seward [Tue, 15 Jul 2014 15:22:41 +0000 (15:22 +0000)] 
arm64: get_Dwarf_Reg: at least handle the case of requesting XSP
instead of failing.  This makes some of the memcheck/tests/varinfo*
tests work somewhat correctly on arm64-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14164

12 years agoBug 337094 ifunc wrapper is broken on ppc64.
Mark Wielaard [Tue, 15 Jul 2014 15:07:01 +0000 (15:07 +0000)] 
Bug 337094 ifunc wrapper is broken on ppc64.

ppc64 uses function descriptors, so we need to get the actual function
entry address for the VG_USERREQ__ADD_IFUNC_TARGET client request, but
we need to return the function descriptor itself from the ifunc_wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14163

12 years agoadd test cases for "LD1/ST1 (multiple 1-elem structs to/from 2 regs,
Julian Seward [Tue, 15 Jul 2014 11:09:51 +0000 (11:09 +0000)] 
add test cases for "LD1/ST1 (multiple 1-elem structs to/from 2 regs,
post index)" (16b only)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14162

12 years agoarm64: implement: LD1/ST1 (multi 1-elem structs, 2 regs, post index)
Julian Seward [Tue, 15 Jul 2014 11:08:42 +0000 (11:08 +0000)] 
arm64: implement: LD1/ST1 (multi 1-elem structs, 2 regs, post index)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2901

12 years agoSmall fixes in 'getting started' section of user manual
Philippe Waroquiers [Mon, 14 Jul 2014 22:04:17 +0000 (22:04 +0000)] 
Small fixes in 'getting started' section of user manual

* Mention --read-inline-info=yes as an alternative to compile without inlining.

* Mention that stabs debuginfo reader is not working anymore since 3.9.0

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14160

12 years agoSlightly refined the NEWS entry for silly/fishy args
Philippe Waroquiers [Mon, 14 Jul 2014 21:39:11 +0000 (21:39 +0000)] 
Slightly refined the NEWS entry for silly/fishy args

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14159

12 years agoThis patch decreases significantly the memory needed to store the lineloc info.
Philippe Waroquiers [Mon, 14 Jul 2014 21:20:57 +0000 (21:20 +0000)] 
This patch decreases significantly the memory needed to store the lineloc info.

On a big executable, the trunk needs:
dinfo: 134873088/71438336  max/curr mmap'd, 134607808/66717872 max/curr

With the patch, we have:
dinfo: 99065856/56836096  max/curr mmap'd,   97883776/51663656 max/curr

So, peak dinfo memory decreases by about 36Mb, and final by 15Mb.

(for info, valgrind 3.9.0 uses
dinfo: 158941184/109666304  max/curr mmap'd, 156775944/107590656 max/curr
So, compared to 3.9.0, dinfo peak decreases by about 40%, and the final
memory is divided by more than 2).

The memory decrease is obtained by:

* using a dedup pool to store filename/dirname pair for the loctab source/line
  information.
  As typically, there is not a lot of such pairs, typically a UShort is
  good enough to identify a fn/dn pair in a dedup pool.
  To avoid losing memory due to alignment, the fndn indexes are stored
  in a "parallel" array to the DiLoc loctab array, with entries having
  1, or 2 or 4 bytes according to the nr of fn/dn pairs in the dedup pool.
  See priv_storage.h comments for details.

  (there was a extensible WordArray local implementation in readdwarf.c.
   As with this change, we use an xarray, the local implementation was
   removed).

* the memory needed for --read-inline-info is slightly decreased (-2Mb)
  by removing the (unused) dirname from the DiInlLoc struct.
  Handling dirname for inlined function caller implies to rework
  the dwarf3 parser read_filename_table common to the var and inlinfo parser.
  Waiting for this to be done, the dirname component is removed from DiInlLoc.

* the stabs reader (readstabs.c) is broken since 3.9.0.
  For this change, the code has been updated to make it compile with the new
  DiLoc/FnDn dedup pool. As the code is completely broken, a vg_assert(0)
  has been put at the begin of the stabs reader.

* the pdb reader (readpdb.c) has been trivially updated and should still work.
  It has not been tested (how do we test this ?).
  A follow-up patch will be done to avoid doing too many calls to
  ML_(addFnDn) : instead of having one call per ML_(addLineInfo), one
  should have a single call done when reading the filename table.

This has also be tested in an outer/inner setup, to verify no
memory leak/bugs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14158

12 years agoarm64: implement "mrs Xt, cntvct_el0" by pass-through to the host.
Julian Seward [Mon, 14 Jul 2014 20:39:23 +0000 (20:39 +0000)] 
arm64: implement "mrs Xt, cntvct_el0" by pass-through to the host.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2900

12 years agoProvide a back trace when a function argument of a known allocation
Florian Krohm [Sun, 13 Jul 2014 14:41:55 +0000 (14:41 +0000)] 
Provide a back trace when a function argument of a known allocation
function is presumably negative. Fixes BZ 79311.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14157

12 years agodrd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug
Bart Van Assche [Sat, 12 Jul 2014 09:30:14 +0000 (09:30 +0000)] 
drd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14156

12 years agoTrack vex r2891 (add Iop_Reverse1sIn8_x16). Unbreak build.
Florian Krohm [Fri, 11 Jul 2014 21:54:33 +0000 (21:54 +0000)] 
Track vex r2891 (add Iop_Reverse1sIn8_x16). Unbreak build.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14155

12 years agoAnnounce fix for BZ #336957
Florian Krohm [Fri, 11 Jul 2014 21:32:23 +0000 (21:32 +0000)] 
Announce fix for BZ #336957

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14154

12 years agoUpdate list of ignored files.
Florian Krohm [Fri, 11 Jul 2014 20:48:30 +0000 (20:48 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14153

12 years agoarm64: enable test cases for:
Julian Seward [Fri, 11 Jul 2014 12:06:24 +0000 (12:06 +0000)] 
arm64: enable test cases for:
{sli,sri} (vector & scalar), sqabs (vector & scalar)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14152

12 years agoarm64: implement: {sli,sri} (vector & scalar), sqabs (vector & scalar)
Julian Seward [Fri, 11 Jul 2014 12:05:47 +0000 (12:05 +0000)] 
arm64: implement: {sli,sri} (vector & scalar), sqabs (vector & scalar)

Fix instruction decoding bug in dis_AdvSIMD_vector_x_indexed_elem
introduced in r2874 but not exposed until recently.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2899

12 years agoMove DRM ioctl handlers to the right places. Fixes r13486 breakage.
Tom Hughes [Thu, 10 Jul 2014 14:56:48 +0000 (14:56 +0000)] 
Move DRM ioctl handlers to the right places. Fixes r13486 breakage.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14151

12 years agoAdd support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
Tom Hughes [Thu, 10 Jul 2014 14:50:06 +0000 (14:50 +0000)] 
Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14150

12 years agoAdd support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
Tom Hughes [Thu, 10 Jul 2014 14:48:00 +0000 (14:48 +0000)] 
Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14149

12 years agoEnable test cases for: shll #imm, shrn #imm, rshrn #imm,
Julian Seward [Thu, 10 Jul 2014 14:23:16 +0000 (14:23 +0000)] 
Enable test cases for: shll #imm, shrn #imm, rshrn #imm,
{smlal,umlal,smlsl,umlsl,smull,umull} (elem)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14148

12 years agoarm64: implement: shll #imm, shrn #imm, rshrn #imm,
Julian Seward [Thu, 10 Jul 2014 14:22:45 +0000 (14:22 +0000)] 
arm64: implement: shll #imm, shrn #imm, rshrn #imm,
{smlal,umlal,smlsl,umlsl,smull,umull} (elem)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2898

12 years agoRollback the (functional) effect of 13944 and 14134
Philippe Waroquiers [Tue, 8 Jul 2014 22:28:26 +0000 (22:28 +0000)] 
Rollback the (functional) effect of 13944 and 14134
Re-opening the FIFO before closing it gives (difficult to understand)
problems => rollback the change that keeps the FIFO opened.
Rather handle the race condition by retrying at vgdb side.
See extensive comments in remote-utils.c

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14147

12 years agoApply text_debug_bias to inline IP extracted from dwarf3
Philippe Waroquiers [Tue, 8 Jul 2014 18:56:47 +0000 (18:56 +0000)] 
Apply text_debug_bias to inline IP extracted from dwarf3
Without this biasing, inline info is not correct for shared objects.
Updated test varinfo5 to use --read-inline-info=yes and added
an inline test case.
Note: the varinfo reader does not understand the inlining info, and
so variables in inlined functions are not properly described.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14146

12 years agoAdd a 32-bit-process only suppression, for OSX 10.8. Equivalent to
Julian Seward [Tue, 8 Jul 2014 16:59:02 +0000 (16:59 +0000)] 
Add a 32-bit-process only suppression, for OSX 10.8.  Equivalent to
that of r14142 for 10.9.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14145

12 years agoChange the default setting --partial-loads-ok from "no" to "yes"
Julian Seward [Tue, 8 Jul 2014 09:36:06 +0000 (09:36 +0000)] 
Change the default setting --partial-loads-ok from "no" to "yes"
for Mac OS only.  All other targets remain at "no".

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14144

12 years agoOSX 10.8/10.9: remove warning message.
Julian Seward [Tue, 8 Jul 2014 08:18:55 +0000 (08:18 +0000)] 
OSX 10.8/10.9: remove warning message.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14143

12 years agoAdd a 32-bit-process-only suppression.
Julian Seward [Tue, 8 Jul 2014 08:10:14 +0000 (08:10 +0000)] 
Add a 32-bit-process-only suppression.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14142

12 years agoMake sanity check errors before/after syscalls be fatal.
Julian Seward [Tue, 8 Jul 2014 08:05:02 +0000 (08:05 +0000)] 
Make sanity check errors before/after syscalls be fatal.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14141

12 years agoAccuracy improvements to syscall wrappers for OSX 10.8 and 10.9.
Julian Seward [Tue, 8 Jul 2014 08:04:25 +0000 (08:04 +0000)] 
Accuracy improvements to syscall wrappers for OSX 10.8 and 10.9.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14140

12 years agoOSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
Julian Seward [Tue, 8 Jul 2014 07:55:44 +0000 (07:55 +0000)] 
OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14139

12 years agoImprove debug printing for the should-we-load-debuginfo-now? finite
Julian Seward [Tue, 8 Jul 2014 07:50:19 +0000 (07:50 +0000)] 
Improve debug printing for the should-we-load-debuginfo-now? finite
state machine.  No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14138