526 Commits

Author SHA1 Message Date
Rhys Kidd
6251bc45e3 Silence -Wcast-qual const qualifier warning. n-i-bz.
m_debuginfo/readmacho.c:395:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s1 = (DiSym*)v1;
                             ^
m_debuginfo/readmacho.c:396:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s2 = (DiSym*)v2;
                             ^
m_libcsignal.c:481:49: warning: cast from 'const vki_sigset_t *' to 'vki_sigset_t *' drops const qualifier [-Wcast-qual]
  VG_(sigintersectset)(&pending, (vki_sigset_t*)set);
                                                ^

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15711
2015-10-19 10:18:28 +00:00
Florian Krohm
e45be516ed Pick up 'egrep' and 'strings' from $PATH instead of using
hardwired absolute path names. People can always arrange $PATH
such that these tools are found.
Fixes BZ #294065. Patch by Austin English <austinenglish@gmail.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15652
2015-09-16 08:59:03 +00:00
Florian Krohm
aadfe81d7e Fix various compiler warnings for the arm architecture.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15650
2015-09-13 20:27:17 +00:00
Philippe Waroquiers
c65a4ee146 Fix a leak of the abbrev hash table when --read-var-info=yes is given
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15590
2015-08-25 21:39:44 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Julian Seward
6d6732e9df Fix a second format string error observed whilst building on OSX 10.10.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15564
2015-08-18 07:54:22 +00:00
Julian Seward
7540350321 Fix a format string error observed whilst building on OSX 10.10.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15563
2015-08-17 21:19:19 +00:00
Julian Seward
8c3ef7eb80 Bug 348345 - Assertion fails for negative lineno
(in ML_(addLineInfo))
Patch from Jim Garrison (jim@garrison.cc)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15544
2015-08-14 09:02:46 +00:00
Florian Krohm
aefb16463d Fix a few function declarations.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15514
2015-08-09 16:27:44 +00:00
Florian Krohm
01ea732633 Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15500
2015-08-05 22:27:24 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Mark Wielaard
c814eb6b35 349941 di_notify_mmap might create wrong start/size DebugInfoMapping
Use seg->start instead of a as DebugInfoMapping avma. Normally seg->start
equals a. But when it is not then the size of the map might extend beyond
the segment (and not actually cover the start of the segment). When another
ELF file is them mapped right after this then it triggers an overlap purge
of the DebugInfo. In the case the mapping was for libc or ld.so this then
removes all intercepts causing "bad things".

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15398
2015-07-07 13:01:40 +00:00
Florian Krohm
7a474c9455 Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394
2015-07-05 21:53:33 +00:00
Philippe Waroquiers
8f30180df2 Inline ensure_valid. This improves reading the debug info of big executables
by 1 to 2%



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15327
2015-06-07 10:38:39 +00:00
Philippe Waroquiers
a833d76cd9 Add a gdbxrv monitor command to print the CFI unwind info for an address+len
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15306
2015-06-02 22:09:42 +00:00
Philippe Waroquiers
85a86af96d Slightly improve x86 unwind intensive workload.
e.g. perf/memrw is improved by 2% to 3% with this patch.

The unwinding code on x86 is trying to unwind using
either the %ebp-chain or CFI unwinding.
If these 2 techniques fail, then it tries to unwind
using FPO (PDB) debug info.
However, unless running wine or similar, there will never be
such FPO/PDB info.
The function VG_(use_FPO_info) is thus called for nothing
for each 'end of stack'. This function scans all the loaded di
to find a debug info that has some FP, to not find anything.

With this patch, the unwind code on x86 will only call VG_(use_FPO_info) if
some FPO/PDB info was loaded.

The fact that FPO/PDB info was loaded is cached and updated similarly to
cfi cache : each time new debug info is loaded, the cache value is refreshed
using the debuginfo generation.

The patch also changes the name of VG_(CF_info_generation)
to VG_(debuginfo_generation), as this generation is changed for
any kind of load or unload of debug info, not only for CFI based debug
info



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15293
2015-05-26 21:26:39 +00:00
Philippe Waroquiers
5f5fa8adf2 Some platforms such as x86 and amd64 have efficient unaligned access.
On these platforms, implement read_/write_<type> by doing a direct
access, rather than calling a function that will read or write
'byte per byte'.

For platforms that do not have efficient unaligned access,
or that do not support at all unaligned access, call function
  readUAS_/writeUAS_<type> that works as before.

Currently, direct acecss is activated only for x86 and amd64.
Unclear what other platforms support (efficiently) unaligned access.

On unwind intensive code (such as perf/memrw on amd64), this patch
gives up to 5% improvement.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15290
2015-05-25 20:15:25 +00:00
Florian Krohm
b6251821a1 Remove a few embarassing comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15169
2015-04-30 20:44:17 +00:00
Julian Seward
47f7612998 DW_CFA_def_cfa_expression: don't push the CFA on the stack before
evaluation starts.  For DW_CFA_val_expression and DW_CFA_expression
doing so is correct, but not for DW_CFA_def_cfa_expression.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15160
2015-04-30 11:45:13 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Florian Krohm
100f719c9c Do not reuse Creg_IA_* for s390. Add dedicated entries Creg_S390_...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15025
2015-03-20 09:38:58 +00:00
Florian Krohm
95d7b1d054 Fix two bugs:
(1) In r14664 VG_(get_fnname_if_entry) was changed to always
    return a function name, even if that function was *not* an
    entry. That broke callgrind and was also confusing because
    it contradicts what "get_fnname_if_entry" suggests.
(2) In r14189 a function call was removed because it was considered
    redundant which it was not.

Both bugs were hunted down by Joseph Weidendorfer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15003
2015-03-12 18:56:21 +00:00
Florian Krohm
30e4288907 Remove assertion. Unlikely as it may be, len may be huge
and therefore we cannot assert otherwise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15001
2015-03-11 22:16:22 +00:00
Florian Krohm
f696bd863b Issue a warning if a function has more than 5 million bytes of
code. Previously functions exceeding that size were observed in the
field. Assert for 100x that amount.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14997
2015-03-10 20:46:58 +00:00
Julian Seward
6e9e1112dc Update comment about range checks with observations from Florian.
No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14982
2015-03-06 09:19:38 +00:00
Julian Seward
136a2cda56 Minor changes in an attempt to improve performance and reduce
the amount of file-reading resulting from DiImage-cache misses.

CACHE_N_ENTRIES:
Increase the DiImage cache size from 256KB to 8MB to deal with
drastically worse locality when reading inline info.  The 256KB
setting dates from befre inline-info-reading days.

is_in_CEnt: remove a conditional branch from the hot path (of |get|,
effectively)

set_CEnt: marginally improve debug printing



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14977
2015-03-05 00:52:07 +00:00
Julian Seward
6920a29c98 Stop gcc -Og complaining (incorrectly) about filessize being used
uninitialised.  No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14953
2015-02-23 13:58:55 +00:00
Julian Seward
38adfae0a0 canonicaliseSymtab: fix silly logic that could cause the function to
loop forever.  In particular, it will do that when two symbols have
exactly the same address range but differ in their .isText attribute.
Fixes #342117.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14948
2015-02-20 12:29:59 +00:00
Julian Seward
31f23d7028 Messaging cleanup for the PDB reader. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14945
2015-02-18 15:38:25 +00:00
Julian Seward
c6a9c7a38d For PDB stats printing, don't print the number of inl-info records,
since it's always zero.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14943
2015-02-18 12:58:56 +00:00
Julian Seward
a348c314d7 Improve string table reading for MSVC2010 compiled code. Also seems
to help with MSVC2013 compiled code.  Variant of a patch from
Mark Browning (mabrowningrr@gmail.com).  Fixes #211529.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14942
2015-02-18 12:57:06 +00:00
Julian Seward
3aa09eb3bf ML_(find_name_of_pdb_file): bit a bit more careful when grepping the
output from /usr/bin/strings, so as to not get confused by substrings
".pdb" and ".PDB" when they don't appear at the end of a line.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14938
2015-02-17 13:46:26 +00:00
Florian Krohm
2ba9e36810 Fix a bug introduced in r14913.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14925
2015-02-09 21:59:00 +00:00
Mark Wielaard
c6f6839488 Bug #343978 Recognize DWARF5/GCC5 DW_LANG_Fortran 2003 and 2008 constants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14923
2015-02-09 20:41:48 +00:00
Florian Krohm
c29515885b Fix undefined behaviours when shifting.
Found by libubsan.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913
2015-02-06 20:32:15 +00:00
Florian Krohm
e70cb7b851 VG_(am_get_filename) returns a pointer to memory that belongs to the
address space manager. Callers should neither modify the string nor
free it (as the string resides is statically allocated memory). That
calls for a   const HChar *
The type change exposed two bugs. One in m_addrinfo.c and one in 
m_debuginfo.c. In both cases the returned string could possibly be freed later
on. So we need to strdup it first. Now fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14886
2015-01-24 00:02:19 +00:00
Florian Krohm
08d759c9a4 TyEnt::TyStOrUn::fieldRs is never NULL as VG_(newXA) always returns
something != NULL. Testing fieldRs for NULL-ness was confusing static
analysis. It usually takes such tests as evidence that the pointer
can in fact be NULL and may report false positives as a consequence.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14845
2015-01-04 11:30:11 +00:00
Florian Krohm
87dbf329ed Buffer audit. Resize some.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14825
2014-12-20 16:52:08 +00:00
Florian Krohm
601ef384bb Remove two fixed-size buffers in the dwarf readers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14820
2014-12-17 19:52:25 +00:00
Florian Krohm
7baf26617a Comment change. Function vg_panic does not exist.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14816
2014-12-17 11:01:40 +00:00
Florian Krohm
115f5cd399 Simplify the VG_(get_filename_linenum) interface by removing
the dirname_available parameter. It's redundant. The value
of the returned directory name can be tested instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14814
2014-12-16 20:55:58 +00:00
Florian Krohm
48c0ff5c76 Fix BZ #116002.
Left justification of strings in myvprintf_str was mixed up.
Now fixed and %s formats changed accordingly.
In function myvprintf_int64: the local buffer was not large
enough to hold ULONG_MAX in binary notation. Numbers were
truncated at 39 digits. 
Testcases added.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14808
2014-12-13 18:35:00 +00:00
Florian Krohm
d80a701916 Remove fixed size arrays in the dwarf-3 parser.
Use proper initialisation functions for the type and variable parser.
Add functions to release the dynamically allocated functions.
No longer maintain content of popped-off stack entries as that is
essentially freed memory and complicates matters unnecessarily.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14801
2014-12-07 18:58:59 +00:00
Florian Krohm
572a96384c Eliminate fixed size buffer 'the_CIEs' and allocate it dynamically.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14800
2014-12-06 21:58:50 +00:00
Mark Wielaard
3129007b9a Bug 341238. Recognize GCC5/DWARFv5 DW_LANG constants Go, C11, C++11, C++14.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14791
2014-11-26 15:43:14 +00:00
Philippe Waroquiers
9cad0d5148 Fix typos in a comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14737
2014-11-19 22:21:12 +00:00
Florian Krohm
e7020c5a7e Minor non-functional cleanups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14723
2014-11-14 19:25:08 +00:00
Florian Krohm
ac3b22e6af Merge revisions 14445 and 14446 from the BUF_REMOVAL branch to trunk.
Two things:
- remove the buffer argument from VG_(DebugInfo_sect_kind)
- allocate AddrInfo::SectKind::objname dynamically


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14719
2014-11-13 21:41:28 +00:00
Florian Krohm
479e0e5b54 Fix a bug spotted by IBM's BEAM checker in VG_(describe_IP).
In the non-XML part buf_dirname was read without observing the
know_dirinfo guard. Now fixed. Initialise buf_dirname nevertheless.
Also remove a dead assignment.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14707
2014-11-09 21:57:23 +00:00
Florian Krohm
ab2599f4cf Change VG_(mkstemp) such that
(a) the 2nd argument must not be NULL
    This was true anyhow and requiring it allows us to simplify the function
    by eliminating the local buffer.
(b) the memory pointed to by the 2nd argument is always initialised
    In the past the output file name was not initialised in case VG_(open)
    failed 10 times in a row. The call sites in m_main.c and m_gdbserver/target.c
    were reading the uninitialised filename unconditionally. This was spotted
    by IBM's BEAM checker.
Fix call sites, eliminate some magic constants along the way.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14706
2014-11-09 16:15:23 +00:00