3210 Commits

Author SHA1 Message Date
Nicholas Nethercote
3bfae3eec1 Merged r9185 (fix up getsockopt mess) from the DARWIN branch, minus the
Darwin-specific parts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9186
2009-02-17 00:23:30 +00:00
Nicholas Nethercote
f0f8b48fcf Merge the non-Darwin parts of r9140 (install vgpreload .dSYMs), just to keep
the trunk and DARWIN branch in sync.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9141
2009-02-12 00:30:02 +00:00
Nicholas Nethercote
01a6838e61 Cleaned up the demangling mess:
- Now more clearly distinguishing between C++-demangling, Z-demangling, and
  below-main renaming, particularly in 'get_sym_name'.
  
- --demangle=no no longer prevents Z-demangling, which makes more sense,
  although it's unlikely to affect anyone.

- Broke the circular dependency between m_demangle and m_debuginfo by moving
  below-main renaming into m_debuginfo.

- Renamed some get_fnname_* functions to make their effect clearer, and
  improved their comments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9138
2009-02-11 06:06:10 +00:00
Nicholas Nethercote
3dfc8932ae Changed the way files are installed. Instead of going into
$INSTALL/<platform>/<filename>, they go to $INSTALL/<filename>-<platform>.
These filenames match those built in the build tree, and so simplifies the
build system signficantly and avoids the horrible sed renamings that were
previously required.  This will also help greatly with the treatment of
.dSYM debug directories in the DARWIN branch.

Files affected include:
- preload libraries such as vgpreload_core-<platform>.so and
  libmpiwrap-<platform>.so
- libraries such as libcoregrind_<platform>.a
- executables such as memcheck-<platform>

I updated the manual and added a note to the NEWS file about the change,
because it will affect a small number of users.

I did my best to update the AIX launcher/initimg correctly, but it hasn't
been tested.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9135
2009-02-11 00:35:45 +00:00
Nicholas Nethercote
a8c9970a34 Cleaned up the mess that was the treatment of "below main" functions such as
'__libc_start_main', in Massif, m_debuginfo and m_stacktrace.  As part of
this, --show-below-main is now visible to tools, and Massif pays attention
to it.

Improved the description of --show-below-main=yes in the manual.

Replaced some instances of "__libc_start_main" in the test *.exp files with
"(below main)", which is what will actually be seen.  Also updated
scalar.stderr.exp*, which should make it get closer to actually passing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9131
2009-02-10 06:48:00 +00:00
Nicholas Nethercote
947f9faaba Merge part of r9129 (factor out duplicated Z-encodings of names) from the
DARWIN branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9130
2009-02-10 04:23:41 +00:00
Nicholas Nethercote
1690244664 Merged r9120 (Merge Makefile.{inplace,install}.am, and simplify installation
of libmpiwrap.so) from trunk.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9121
2009-02-06 23:27:16 +00:00
Nicholas Nethercote
2d5f140a5b Make Makefile.install.am much less confusing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9118
2009-02-06 07:12:57 +00:00
Nicholas Nethercote
b7b48cb4a6 Removed Makefile.core.am with some judicious refactoring. Also fix a stupid
typo in launcher-linux.c that was added in the last commit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9116
2009-02-06 05:34:19 +00:00
Nicholas Nethercote
009cd24326 Removed Makefile.core.am with some judicious refactoring.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9114
2009-02-06 04:49:14 +00:00
Julian Seward
c90635f9d3 Move an assertion (pertaining to showing initial segments to the
tools) to the correct place, and add a big comment explaining why this
is necessary.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9094
2009-01-31 15:08:08 +00:00
Bart Van Assche
d704a19db5 Removed mandatory redirections for DRD since these made DRD impossible to use on openSUSE 10.3 ppc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9092
2009-01-30 18:31:54 +00:00
Julian Seward
f0bf7aaf10 VG_(findBoundsFM): add comment re preconditions
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9085
2009-01-29 08:46:15 +00:00
Julian Seward
c538f32818 Handle a couple of artefacts produced by icc11: DW_TAG_reference_type
that doesn't have a size, and DW_FORM_ref_addr (assuming my
interpretation of the standard is correct.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9058
2009-01-25 23:50:32 +00:00
Julian Seward
7f9bff9f46 Handle a couple of artefacts generated by gcc-4.4: DW_OP_reg{0..31}
and DW_OP_const1s.

--> 3_4_BRANCH




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9057
2009-01-25 23:48:31 +00:00
Julian Seward
c72e27c5b0 Accept 'enum' type DIEs that do not have any names; apparently Dwarf2
allows this.  Patch from Nuno Lopes.  #181707.
MERGE TO 3_4_BRANCH


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9055
2009-01-24 01:44:15 +00:00
Julian Seward
2e1b7166fc Fix aix5 build breakage following r9021.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9053
2009-01-24 01:22:51 +00:00
Julian Seward
b666f0fa23 Don't try to build m_ume on aix5.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9052
2009-01-24 01:22:25 +00:00
Julian Seward
cc781fbfbd VG_(apply_StackTrace): following r8818, we should regard an entry of -1
as denoting the logical end of the stack.  This change stops printing
of a lot of junk below the logical "-1" end mark.  See added comments
for details.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9051
2009-01-24 00:07:53 +00:00
Julian Seward
3825cfb6aa ML_(evaluate_trivial_GX): handle the case
(DW_OP_addr: DW_OP_plus_uconst: ULEB < 128)

This is a really nasty kludge and should be fixed properly.

MERGE TO 3_4_BRANCH (?)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9050
2009-01-24 00:06:13 +00:00
Julian Seward
3a786496c1 Handle the case where a Compilation Unit (CU) (or, really, the CU and
its associated DIEs) occupies less space than stated in the CU's
header.  icc9 appears to produce CUs with this anomaly.  Not handling
the case causes the reader to lose sync at the start of the following
CU, since it hasn't skipped the junk bytes at the end of the current
CU, and it is basically hosed after that.
MERGE TO 3_4_BRANCH (?)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9049
2009-01-24 00:04:28 +00:00
Nicholas Nethercote
ed322feb84 Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
  configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
  #defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
  in them.
- The ones that are in all-caps have a _CAPS suffix.

So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer.  The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.

cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities.  In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits.  Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones.  (This is partially merged from the DARWIN branch.)

configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.

valgrind.pc.in: try to make this more accurate.  I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031
2009-01-22 21:56:32 +00:00
Julian Seward
7e1fd774cc Minor tidyings:
search_all_symtabs: look for data symbols also in .sbss and .rodata
sections.

VG_(seginfo_sect_kind): identify addresses in .sbss sections.

VG_(pp_SectKind): handle missing case Vg_SectGOTPLT

search_all_loctabs, VG_(get_objname), VG_(find_seginfo): augment tests
"di->text_present" with "&& di->text_size > 0" (probably not
necessary, but is clearer, and more consistent in that most places
that look at DebugInfo.text_{size,avma} first perform both of those
tests).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9029
2009-01-22 21:18:15 +00:00
Tom Hughes
986c69ccf8 Don't worry about an unmapped, zero sized, bss segment. Bug #181594.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9026
2009-01-22 16:53:25 +00:00
Tom Hughes
d298be2664 Accept zero size text segments. Bug #181594.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9025
2009-01-22 15:08:53 +00:00
Tom Hughes
8f774ff30b Handle the rodata and sbss sections and cope with variables that
are in those sections.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9024
2009-01-22 14:14:13 +00:00
Tom Hughes
20abad2fad Bias values should be PtrdiffT now.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9023
2009-01-22 14:02:26 +00:00
Tom Hughes
33a768dabc Removed unused round_Addr_upwards function.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9022
2009-01-22 13:44:03 +00:00
Tom Hughes
4ca0c5f735 Don't assume that all global variables are in the data section - we
now cope with variables in the text, data, sdata and bss sections.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9021
2009-01-22 13:40:12 +00:00
Tom Hughes
0e02b9ee5b Improve detection of where ELF sections have been mapped by taking
the ELF segment table into account when deciding on the mapping
between SVMA and AVMA for a section.

This also allows the BSS kludge to be dropped, as the BSS address is
now correctly determined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9020
2009-01-22 13:24:06 +00:00
Julian Seward
f3523a4a0e Some minor format string fixes for gcc-3.3.3 (SuSE 9.1). Not sure why
later gccs don't complain about these.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9019
2009-01-22 12:24:26 +00:00
Nicholas Nethercote
c5b04113b5 This should have been part of r9004.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9008
2009-01-21 04:11:13 +00:00
Nicholas Nethercote
c07262448b - Split up m_ume.c into m_ume/{main,elf,script}.c. This will make merging
the DARWIN branch easier later.
- Remove the disabled vgtest_ume test, it's very unlikely it'll ever work
  again.
- Move VG_(find_auxv) to initimg-linux.c, the only place it's used, and make
  it static.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9004
2009-01-21 02:26:56 +00:00
Nicholas Nethercote
5ad1dd61f9 Introduce a new type, PtrdiffT. Replace lots of uses of OffT (all those
that are memory offsets) with PtrdiffT;  OffT should only be used for file
sizes and offsets.

Change Off64T from a ULong to a Long, as it should be.  Replace some uses
of ULong in the address space manager with Off64T to match.

Also add a comment explaining the meanings of the basic types like Addr,
OffT, SizeT, etc.

Also fix the prototype for VG_(pread) -- the last arg is an OffT, not an
Int.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8959
2009-01-15 21:29:24 +00:00
Tom Hughes
7e17bfc956 The SG_GET_TIMEOUT ioctl doesn't write to memory - it returns the
timeout via it's return value.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8958
2009-01-15 08:49:09 +00:00
Tom Hughes
9b5365f10d The SG_GET_VERSION_NUM ioctl writes to memory rather than reading it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8957
2009-01-15 08:48:14 +00:00
Bart Van Assche
db3b033855 Do not only intercept SIGILL during detection of the supported instruction set
on ppc but also SIGFPE. This patch should make instruction set detection work
on the PowerPC 440EPx.
Fixes bug #176926.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8945
2009-01-13 07:49:14 +00:00
Tom Hughes
f1ac1fd992 Add signalfd4 support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8930
2009-01-09 16:42:51 +00:00
Julian Seward
d4fc363b2f ML_(addDiCfSI)(): truncate DiCfSI's that fall partially but not
entirely inside the r-x mapped area, so that they fall entirely
within the mapped area.  This is necessary in order to avoid
assertion failures later in check_CFSI_related_invariants().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8877
2008-12-23 20:00:23 +00:00
Julian Seward
a9c3419f36 Move description of --read-var-info= from the "debugging options"
section to the "uncommon user options" section.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8847
2008-12-21 10:45:55 +00:00
Tom Hughes
2ebda825b1 Add support ioprio_get and wire up ioprio_set on all platforms.
Fixes bug #177819.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8826
2008-12-15 08:58:29 +00:00
Julian Seward
ba2ece03b8 This commit subtly changes the meaning of the values obtained via the
stack unwind mechanism (the function VG_(record_ExeContext) et al),
clears up some associated kludges, and makes suppression matching work
more reliably.

Prior to this commit, a stack snapshot contained, at [0], the IP of
the relevant thread, and at all positions [1] and above, the return
addresses for the open calls.

When showing a snapshot to the user (in VG_(apply_StackTrace)), and
searching the stack for stack blocks (in VG_(get_data_description)), 1
is subtracted from positions [1] and above, so as to move these return
addresses back to the last byte of the calling instruction.  This
subtraction is also done even in VG_(get_StackTrace_wrk) itself, in
order to make the stack unwinding work at all.

It turns out that suppression-vs-function-name matching requires the
same hack, and sometimes failed to match suppressions that should
match, because of this self-same problem.

So the commit changes the stack unwinder itself, so that entries [1]
and above point to the last byte of the call instruction, rather than
the return address.  The associated kludges in VG_(apply_StackTrace)
and VG_(get_StackTrace_wrk) are removed, and suppression matching is
observed to work in a case where it failed before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8818
2008-12-12 13:23:03 +00:00
Julian Seward
05e92e79d9 Fix format string warning in PRE(sys_eventfd2).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8817
2008-12-12 08:08:58 +00:00
Julian Seward
09dac86eca Add a new module, m_seqmatch, which does very simple sequence (regexp)
matching, in the function VG_(generic_match).  Patterns to be matched
against may contain only '*'-style wildcards (matches any number of
elements, we don't care what they are), '?' wildcards (matches exactly
one element, we don't care what it is) and literal elements.

It is totally abstractified, in the sense that the pattern and input
arrays may be arrays of anything.  The caller provides enough
information so that VG_(generic_match) can step along both arrays, and
can ask the questions "is this pattern element a '*' ?", "is this
pattern element a '?' ?", and "does this pattern element match an
input element ?".

The existing function VG_(string_match) is reimplemented using
VG_(generic_match), although the ability to escape metacharacters in
the pattern string is removed -- I don't think it was ever used.

In m_errormgr, matching of suppression stacks (including wildcard
"..." lines) against error stacks is re-implemented using
VG_(generic_match).

Further detailed comments are in m_seqmatch.h and pub_tool_seqmatch.h.

A negative side effect is that VG_(string_match) will be much slower
than before, due to the abstractification.  It may be necessary to
reimplement a specialised version later.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8816
2008-12-12 08:07:49 +00:00
Tom Hughes
4d4d4c10fe Add support for eventfd2 (and wire up pipe2 on PPC platforms).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8815
2008-12-10 09:28:56 +00:00
Julian Seward
febfd1dcd8 Fix bug introduced by frame-level wildcarding changes for suppressions
in r8725.  (Konstantin Serebryany)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8813
2008-12-08 13:45:35 +00:00
Julian Seward
5aa3e073b7 * Add a VG_(sizeSWA) function
* Fix spacing a bit



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8808
2008-12-06 23:34:52 +00:00
Julian Seward
dee63731b9 Add a new container data type, a Sparse Word Array: an array of UWord
which is also indexed by UWord.  This can be used as a replacement for
WordFM with unboxed keys, when the key ranges are dense.  It is
implemented as a 256-way radix tree (4-deep on 32-bit platforms,
8-deep on 64-bit platforms).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8806
2008-12-06 22:07:35 +00:00
Julian Seward
6c80ff8f20 Followup to vx1875: use .guest_amd64_assume_fs_is_zero == True on
amd64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8805
2008-12-04 00:07:30 +00:00
Julian Seward
46540c12ed Assert that the guest state size is a multiple of 16, not 8.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8804
2008-12-03 21:31:48 +00:00