Commit Graph

939 Commits

Author SHA1 Message Date
Philippe Waroquiers
ceaa5b2efe This patch implements the support needed for stacktraces
showing inlined function calls.
See 278972 valgrind stacktraces and suppression do not handle inlined function call debuginfo

Reading the inlined dwarf call info is activated using the new clo
  --read-inline-info=yes
Default is currently no but an objective is to optimise the performance
and memory in order to possibly set it on by default.
(see below discussion about performances).

Basically, the patch provides the following pieces:
1. Implement a new dwarf3 reader that reads the inlined call info
2. Some performance improvements done for this new parser, and
   on some common code between the new parser and the var info parser.
3. Use the parsed inlined info to produce stacktrace showing inlined calls
4. Use the parsed inlined info in the suppression matching and suppression generation
5. and of course, some reg tests

1. new dwarf3 reader:
---------------------
Two options were possible: add the reading of the inlined info
in the current var info dwarf reader, or add a 2nd reader.
The 2nd approach was preferred, for the following reasons:
The var info reader is slow, memory hungry and quite complex.
Having a separate parsing phase for the inlined information
is simpler/faster when just reading the inlined info.
Possibly, a single parser would be faster when using both
--read-var-info=yes and --read-inline-info=yes.
However, var-info being extremely memory/cpu hungry, it is unlikely
to be used often, and having a separate parsing for inlined info
does in any case make not much difference.
(--read-var-info=yes is also now less interesting thanks to commit
r13991, which provides a fast and low memory "reasonable" location
for an address).

The inlined info parser reads the dwarf info to make calls
to priv_storage.h ML_(addInlInfo).

2. performance optimisations
----------------------------
* the abbrev cache has been improved in revision r14035.
* The new parser skips the non interesting DIEs
  (the var-info parser has no logic to skip uninteresting DIEs).
* Some other minor perf optimisation here and there.
In total now, on a big executable, 15 seconds CPU are needed to
create the inlined info (on my slow x86 pentium).

With regards to memory, the dinfo arena:
with inlined info: 172281856/121085952  max/curr mmap'd
without          : 157892608/106721280  max/curr mmap'd,
So, basically, inlined information costs about 15Mb of memory for
my big executable (compared to first version of the patch, this is
already using less memory, thanks to the strpool deduppoolalloc.
The needed memory can probably be decreased somewhat more.

3. produce better stack traces
------------------------------
VG_(describe_IP) has a new argument InlIPCursor *iipc which allows
to describe inlined function calls by doing repetitive calls 
to describe_IP. See pub_tool_debuginfo.h for a description.

4. suppression generation and matching
--------------------------------------
* suppression generation now also uses an InlIPCursor *iipc
  to generate a line for each inlined fn call.

* suppression matching: to allow suppression matching to
match one IP to several function calls in a suppression entry,
the 'inputCompleter' object (that allows to lazily generate
function or object names for a stacktrace when matching 
an error with a suppression) has been generalised a little bit
more to also lazily generate the input sequence.
VG_(generic_match) has been updated so as to be more generic
with respect to the input completer : when providing an
input completer, VG_(generic_match) does not need anymore
to produce/compute any input itself : this is all delegated
to the input completer.

5. various regtests
-------------------
to test stack traces with inlined calls, and suppressions
of (some of) these errors using inlined fn calls matching.


Work still to do:
-----------------
* improve parsing performance
* improve the memory overhead.
* handling the directory name for files of the inlined function calls is not yet done.
  (probably implies to refactor some code)
* see if m_errormgr.c *offsets arrays cannot be managed via xarray



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14036
2014-06-15 15:42:20 +00:00
Julian Seward
cc3cafc37a Add test cases for LD1R (single structure, replicate).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14032
2014-06-14 18:06:14 +00:00
Florian Krohm
5caf0bf724 Fix the cleanup: line to avoid an error message in case the
file does not exist.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14027
2014-06-12 15:37:15 +00:00
Julian Seward
36bf1f4d67 Add test cases for FMUL 2d_2d_d[], 4s_4s_s[], 2s_2s_s[].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14026
2014-06-12 13:16:43 +00:00
Julian Seward
d4751b4053 Add tests for movi_4s_#imm8,lsl8 and ushr_d_d_#imm.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14025
2014-06-12 10:13:44 +00:00
Julian Seward
37f5b9dd14 Enable test for movi_{16b,8b}_#imm8.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14021
2014-06-10 22:53:01 +00:00
Julian Seward
db7b04599f Fix out-of-range constants for some 32 bit insns, presumably tolerated
by older assembler versions but not newer ones.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13996
2014-06-04 21:55:16 +00:00
Julian Seward
548a0d2d60 Add test cases for ADC/ADCS/SBC/SBCS. Pertains to #335496.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13995
2014-06-04 13:13:05 +00:00
Dejan Jevtic
f1b4547420 mips64: Tests for Cavium MIPS Octeon Atomic and Count Instructions.
Tests for instructions:
baddu, pop, dpop, saa, saad, laa, laad, lai, laid, lad, ladd, law, lawd,
las, lasd, lac, lacd


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13994
2014-06-04 11:36:21 +00:00
Julian Seward
72190b60c1 Make each test disable-able, and enable tests of instructions that are
currently supported.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13993
2014-06-04 11:20:18 +00:00
Julian Seward
66a38e23e3 Add test cases for PCMPxSTRx cases 0x0E, 0x34, 0x14, and reformat some
of the associated switch statements.  Pertains to #326469, #327639,
#328878 respectively.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13986
2014-05-21 14:43:11 +00:00
Julian Seward
5bd3d910c3 Add more test cases: trn1, trn2, uzp1, uzp2, zip1, zip2, urecpe, ursqrte.
This completes the test cases for the SIMD integer instructions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13970
2014-05-15 12:18:17 +00:00
Julian Seward
099e255374 Add more test cases: sqrshrn, uqrshrn, sqshrn, uqshrn, sqrshrun,
sqshrun, sqshl, uqshl, sqshlu, sqxtn, uqxtn, sqxtun, srhadd, urhadd,
sshl, ushl, shl, sshr, ushr, ssra, usra, srshl, urshl, srshr, urshr,
srsra, ursra, suqadd, usqadd.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13969
2014-05-15 11:55:56 +00:00
Julian Seward
1866af3dac Add more test cases: sqdmulh, sqrdmulh, sqshl, uqshl, sqrshl, uqrshl,
sqrshrn, uqrshrn, sqshrn, uqshrn, sqrshrun, sqshrun.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13968
2014-05-15 08:22:34 +00:00
Julian Seward
02f1067f35 Add tests for VFPv4 VFMA/VMFS. Pertains to #331057.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13967
2014-05-15 00:12:36 +00:00
Julian Seward
c388df8977 Followup to r13958: add reg-trash lists to inline assembly in
TESTINSTPCMISALIGNED TESTINSTPCMISALIGNED_DWORDOUT
TESTINSTPCMISALIGNED_2OUT and nice up the the indentation a bit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13960
2014-05-13 16:15:56 +00:00
Julian Seward
61a0ca0857 Thumb encoding: add test case for assertion failure caused by
"ldr.w pc, [reg, #imm]".  See #333428.  (dimitry@google.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13959
2014-05-13 15:55:00 +00:00
Julian Seward
f6d56584b4 Thumb encoding: add test cases for misaligned loads of the form
LD Rt, [Rn +/- #imm12]  when Rn == PC
See #333145.  (dimitry@google.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13958
2014-05-13 14:45:54 +00:00
Julian Seward
b6ac3b9da4 Add more test cases: shll, shrn, rshrn, sli, sri, smaxp, umaxp, sminp,
uminp, smlal, umlal, smlsl, umlsl, smull, umull, sqabs, sqneg, sqadd,
uqadd, sqsub, uqsub, sqdmlal, sqdmlsl, sqdmull, sqrdmulh.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13956
2014-05-13 09:34:54 +00:00
Mark Wielaard
a07285e393 Add test for MPX instructions and bnd prefix. Bug #333666.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13948
2014-05-09 11:41:46 +00:00
Julian Seward
75219a52db Add more test cases: mul, mvni, not, pmul, pmull, rbit, rev16/32/64,
saba, uaba, sabal, uabal, sabd, uabd, sabdl, uabdl, sadalp, uadalp,
saddl, uaddl, ssubl, usubl, saddlp, uaddlp, saddlv, uaddlv, saddw,
uaddw, ssubw, usubw, shadd, uhadd, shsub, uhsub.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13946
2014-05-09 09:36:56 +00:00
Julian Seward
4862771a72 Add more test cases: ext, ins, mla, mls, movi.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13945
2014-05-08 22:19:16 +00:00
Julian Seward
1506d16ee3 Enable test cases for SMULH.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13940
2014-05-07 09:44:55 +00:00
Julian Seward
a7635e5b92 Fill in some SIMD integer test cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13937
2014-05-06 14:46:44 +00:00
Julian Seward
ec17e57156 Big reorganisation:
* add lane type descriptors, to be used by the random data
  generators -- as-yet unused

* move existing tests into new groupings, and rename some of
  them to be more consistent with the new notation.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13936
2014-05-06 09:30:29 +00:00
Julian Seward
f3841c8aae Rename these two test files to make their names a bit less cumbersome.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13935
2014-05-05 13:38:37 +00:00
Julian Seward
6199b0550b Add test cases for out-of-range argument handling for x87 instructions
FSIN, FCOS, FSINCOS and FPTAN.  Mozilla bug 995564.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13921
2014-04-30 22:51:47 +00:00
Julian Seward
d5cb000e92 Add a list of all the FP+SIMD insns, as a base from which to
generate test cases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13918
2014-04-28 22:12:39 +00:00
Julian Seward
f80904ff97 Finish off and/or re-enable test cases for: vector integer comparison
instructions, and vector shift-by-immediates (Shr/Shl/Sar)
instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13917
2014-04-27 12:03:37 +00:00
Philippe Waroquiers
9ba256ffb0 * New option --aspace-minaddr=<address> allows to (possibly) make
use of some more memory by decreasing the default value
  or solve some conflicts with system libraries by increasing the value.
  See user manual for details.

Note that the lowest accepted possible value is 0x1000, which is
the current value used by Macos in 32bits.
On linux, 0x10000 (64KB) seems to cause not much conflicts.

Default values are unchanged (i.e. are the same as when there
was no clo option).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13901
2014-04-20 14:20:37 +00:00
Philippe Waroquiers
8b7a52c4cb - The option "--vgdb-stop-at=event1,event2,..." allows the user
to ask GDB server to stop before program execution, at the end
  of the program execution and on Valgrind internal errors.

- A new monitor command "v.set hostvisibility" that allows GDB server
  to provide access to Valgrind internal host status/memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13900
2014-04-20 13:41:10 +00:00
Dejan Jevtic
a383b110f9 mips32: According to the glibc bug 5044 (https://sourceware.org/bugzilla/show_bug.cgi?id=5044)
until the glibc version 2.17 printf hadn't respected the rounding mode for decimal
output. Because of change in glibc printf function we need to change our
expected output file for none/tests/mips32/FPUarithmetic test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13894
2014-04-11 11:59:11 +00:00
Julian Seward
00cbf4454f Add tests for some variants of LD{1,2}/ST{1,2} that load or
store two registers.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13889
2014-04-03 23:01:24 +00:00
Julian Seward
4330b24498 Add tests for FCMEQ, FCMGE, FCMGT, FACGE, FACGT
(reg-vs-reg variants only)

Add tests for all TBL and TBX variants.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13888
2014-04-03 23:00:45 +00:00
Julian Seward
a88850e0c9 More test cases:
xtn,xtn2
ushr 8h, 8h, #imm



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13856
2014-03-07 22:54:19 +00:00
Julian Seward
1071f56d61 Add comprehensive testing for almost all supported load/store instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13850
2014-03-03 08:43:43 +00:00
Julian Seward
e0120ae24a Add many test cases from arm64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13848
2014-03-02 12:48:34 +00:00
Julian Seward
39acf83eb0 Update; document missing test cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13847
2014-03-01 11:27:59 +00:00
Julian Seward
f2c349eeee Add test cases for SIMD and FP instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13846
2014-03-01 11:27:18 +00:00
Julian Seward
6c400e5e0c Fixes form arm64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13844
2014-03-01 11:21:45 +00:00
Dejan Jevtic
d8caebf893 mips32: Add tests for mips32 floating point compare instructions.
Tests that are testing mips instructions c.cond.s and c.cond.d have been added in none/tests/mips32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13839
2014-02-25 15:26:52 +00:00
Dejan Jevtic
3d1369a6e0 mips32: Support for 64bit FPU on MIPS32 platforms.
Tests for 64bit FPU instructions on MIPS32 platforms.
Some mips instructions can cause SIGILL (Illegal instruction),
so we need to add SIGILL signal and a proper handler for that signal.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13817
2014-02-19 11:57:22 +00:00
Tom Hughes
1175b7c1a3 Use pclose instead of fclose to close pipes opened with popen, which
also allows us to drop the loop that was supposed to give the child a
chance to exit as the pclose will wait properly for the child.

Fix from Ivo Raisr on BZ#331255


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13813
2014-02-17 22:44:52 +00:00
Tom Hughes
c8f66f8d4d Use sigjmp_buf with sig{set,long}jmp, not jmp_buf
Patch from Ivo Raisr on BZ#331257


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13812
2014-02-17 22:32:15 +00:00
Petar Jovanovic
b8c6f1c0a3 mips64: add missing file to EXTRA_DIST
Add missing cvm_lx_ins.stdout.exp-BE to EXTRA_DIST.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13811
2014-02-15 03:38:57 +00:00
Petar Jovanovic
b117eca6ed mips64: correct mistyped test name
Minor name changed in .vgtest file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13809
2014-02-14 18:09:03 +00:00
Petar Jovanovic
544994d634 mips64: add tests for load indexed instructions
Tests that should be executed on MIPS64 platforms that support lwx, ldx
and lbux.

Relevant VEX change - r2819.

Patch by Zahid Anwar, with some changes.

Related to Bugzilla issue 326444. It closes this issue now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13808
2014-02-14 17:50:42 +00:00
Petar Jovanovic
e65d1dafdf mips64: Add BE version of cvm_lx_ins.stdout.exp
Read-memory tests are endian sensitive.
Add BE version of cvm_lx_ins.stdout.exp that has been tested on
Cavium Octeon II in BE mode.

Related to Bugzilla issue 326444.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13805
2014-02-13 18:07:03 +00:00
Carl Love
49987d5c4a This commit is a fix for "Bug 330622 - Add test to regression suite for POWER
instruction: dcbzl" submitted by Anmol P. Paralkar <paralkar@freescale.com>

The patch adds the following files:

 none/tests/ppc64/data-cache-instructions.vgtest
 none/tests/ppc64/data-cache-instructions.c
 none/tests/ppc64/data-cache-instructions.stdout.exp
 none/tests/ppc64/data-cache-instructions.stderr.exp
 none/tests/ppc32/data-cache-instructions.stdout.exp
 none/tests/ppc32/data-cache-instructions.c
 none/tests/ppc32/data-cache-instructions.vgtest
 none/tests/ppc32/data-cache-instructions.stderr.exp
 tests/power_insn_available.c


The following files are modified:

 none/tests/ppc32/Makefile.am
 none/tests/ppc64/Makefile.am
 tests/Makefile.am





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13791
2014-02-08 02:19:12 +00:00
Petar Jovanovic
1461dae691 mips64: Add tests that cover Cavium-specific load indexed instructions
Tests for lhux, lwux, and lbx for Cavium Octeon II.

Patch by Zahid Anwar, with changes.

Related to Bugzilla issue 326444.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13786
2014-01-31 12:49:22 +00:00