313 Commits

Author SHA1 Message Date
Nicholas Nethercote
eea34ddbd6 Avoid spurious warning about using posix_memalign()
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2657
2004-09-03 14:04:40 +00:00
Nicholas Nethercote
18355ff96b Arch-abstraction:
- Added include/x86/:  contains tool_arch.h, Makefile.am, .cvsignore.

- Added coregrind/x86/state.c.  Contains some arch-specific code for dealing
  with x86 registers -- eg. setting up the baseBlock, loading/saving the whole
  register state.  It is compiled into coregrind/x86/libarch.a and linked via
  ${VG_ARCH} with the core.

  Relatedly, also added coregrind/x86/{core_arch.h,core_arch_asm.h}.

- Correspondingly abstracted the register state out of ThreadState.  This
  affected every place that touches registers, and there are a lot of them.
  (Eventually all the register touching should be abstracted out in an
  arch-neutral way, but not yet;  one step at a time.)

- Added some declarations about register loading/saving functions to core.h;
  all architectures will have to provide these functions.

- Rejigged the build system so that the arch-specific stuff is all done via
  ${VG_ARCH}, rather than naming e.g. x86/ directly.  Appropriate -I arguments
  are used so that all the headers are found, etc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2656
2004-09-03 13:45:29 +00:00
Nicholas Nethercote
3a59d9013f Update docs for filename change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2652
2004-09-02 15:50:29 +00:00
Nicholas Nethercote
90369deb78 Arch-abstraction:
- renamed "vg_constants.h" as "core_asm.h".
- renamed "vg_constants_skin.h" as "tool_asm.h".
- renamed "mc_constants.h" as "mc_asm.h".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2650
2004-09-02 15:37:39 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
a32b040099 Update .cvsignore for recently added regression tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2642
2004-09-01 23:34:37 +00:00
Nicholas Nethercote
acd57ac595 Use Makefile.am includes. This gets rid of 110 lines of repetitive Makefile.am
cruft, yay!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2641
2004-09-01 23:20:49 +00:00
Nicholas Nethercote
2f53ead94d Fix problem with brk(). Thanks to Paull Mackerras for the patch.
Added a regression test for it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2619
2004-08-25 13:43:44 +00:00
Nicholas Nethercote
29d59df719 Remove three unnecessary compile-time warnings.
Two were trivial.  The one for strncmp is slightly trickier;  you have to be
careful with the signedness of chars when comparing them... but the code
already casts s1 and s2 to (unsigned char*) before comparing them, so it's not
a problem.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2618
2004-08-25 13:33:17 +00:00
Nicholas Nethercote
0db27515b1 Putting "dist_" in front of a "_DATA" variable means it is included in "make
dist".  This avoids the need to put it in "EXTRA_DIST", and saves a few lines
in all the docs Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2614
2004-08-25 11:40:07 +00:00
Tom Hughes
090cf06f43 Prevent a memcpy of zero bytes from complaining if one or both of the
pointers given as arguments is uninitialised.

CCMAIL: 86989-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2608
2004-08-23 18:39:09 +00:00
Nicholas Nethercote
a2b3609df7 Small step in factoring out arch-specific code: replace
__attribute((regparm(n))) with REGPARM(n) everywhere.  REGPARM() is defined in
vg_skin.h, but will eventually be defined separately for each arch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2601
2004-08-23 15:06:23 +00:00
Nicholas Nethercote
1bd17a3d0f Remove a bunch of unnecessary -DVG_LIBDIR="\"$(libdir)"\" arguments in
Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2597
2004-08-23 14:02:03 +00:00
Nicholas Nethercote
841b4ec9ae Remove 3 identical and self-admittedly spurious assertions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2592
2004-08-18 22:26:01 +00:00
Nicholas Nethercote
9033020ae4 Big overhaul of the allocator. Much of the structure is the same, but
lots of the details changed.  Made the following generalisations:

- Recast everything to be entirely terms of bytes, instead of a mixture
  of (32-bit) words and bytes.  This is a bit easier to understand, and
  made the following generalisations possible...

- Almost 64-bit clean;  no longer assuming 32-bit words/pointers.  Only
  (I think) non-64-bit clean part is that VG_(malloc)() et al take an
  Int as the size arg, and size_t is 64-bits on 64-bit machines.

- Made the alignment of blocks returned by malloc() et al completely
  controlled by a single value, VG_MIN_MALLOC_SZB.  (Previously there
  were various magic numbers and assumptions about block alignment
  scattered throughout.) I tested this, all the regression tests pass
  with VG_MIN_MALLOC_SZB of 4, 8, 16, 32, 64.  One thing required for
  this was to make redzones elastic;  the asked-for redzone size is now
  the minimum size;  it will use bigger ones if necessary to get the
  required alignment.

Some other specific changes:

- Made use of types a bit more;  ie. actually using the type 'Block',
  rather than just having everything as arrays of words, so that should
  be a bit safer.

- Removed the a->rz_check field, which was redundant wrt. a->clientmem.

- Fixed up the decision about which list to use so the 4 lists which
  weren't ever being used now are -- the problem was that this hasn't
  been properly updated when alignment changed from 4 to 8 bytes.

- Added a regression test for memalign() and posix_memalign().
  memalign() was aborting if passed a bad alignment argument.

- Added some high-level comments in various places, explaining how the
  damn thing works.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2579
2004-08-11 09:40:52 +00:00
Nicholas Nethercote
82c053aafc Remove some more global variables from vg_include.h, replacing them with
(fewer) functions.

Also fixed execve() so that it works better with .in_place.

Also added a regression test for --trace-children=yes (there were none!)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2577
2004-08-09 12:21:57 +00:00
Nicholas Nethercote
4ecbc561da Comment changes only -- compacting
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2566
2004-08-04 10:37:49 +00:00
Nicholas Nethercote
a545bc15cc Tweaked sanity-checking: made function naming more consistent, removed
unnecessarily global functions from vg_include.h, etc.

Also tweaked printing of malloc stats.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2562
2004-08-03 23:14:00 +00:00
Nicholas Nethercote
38ff4e69d1 Comment changes only: s/skin/tool/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2555
2004-08-03 13:29:09 +00:00
Tom Hughes
8582802cb3 Add instruction tests for the LFENCE/MFENCE/SFENCE instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2523
2004-07-25 15:18:21 +00:00
Nicholas Nethercote
c6ea38d087 Include new_override.stdout.exp in 'make dist'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2509
2004-07-18 12:05:37 +00:00
Nicholas Nethercote
755111b88d Slightly change, with J's approval, startup copyright messages to better
reflect reality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2489
2004-07-16 17:44:00 +00:00
Nicholas Nethercote
854d2ec10e Fix for bug #78048.
Problem was that the malloc-replacing tools (memcheck, addrcheck, massif,
helgrind) would assert if a too-big malloc was attempted.  Now they return 0 to
the client.  I also cleaned up the code handling heap-block-metadata in Massif
and Addrcheck/Memcheck a little.

This exposed a nasty bug in VG_(client_alloc)() which wasn't checking if
find_map_space() was succeeding before attempting an mmap().  Before I added
the check, very big mallocs (eg 2GB) for Addrcheck were overwriting the client
space at address 0 and causing crashes.

Added a regtest to all the affected skins for this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2462
2004-07-10 14:56:28 +00:00
Tom Hughes
a2a0946b8a Make VPATH builds work so that valgrind can be built in a different
directory from the source tree. This resolves bug 83040.

Based on patch from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2450
2004-06-29 09:45:37 +00:00
Tom Hughes
414846a941 Removed all uses of nested functions as they only work with gcc and
cause the stack to be marked as executable in order for them to work.

All assembler files have also had a declaration added so that the
object they generate will be marked as not needing an executable stack.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2446
2004-06-27 17:37:21 +00:00
Nicholas Nethercote
58ae9c9722 Update .cvsignore files
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2434
2004-06-22 14:01:40 +00:00
Nicholas Nethercote
2fab200ad0 Renamed the following options:
--logfile-fd  -->  --log-fd
  --logfile     -->  --log-file
  --logsocket   -->  --log-socket

to be consistent with each other and other options (esp. --input-fd).  Also
renamed some related variables.  The old names still work, for backwards
compatibility, but they're not documented.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2429
2004-06-21 12:42:35 +00:00
Robert Walsh
79b252dfdf Memory pool support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2428
2004-06-19 18:12:36 +00:00
Nicholas Nethercote
55cb3cd764 Introduced 4 macros to minimise boilerplate command line processing code.
Nicely cuts around 130 lines of code, spread over the core and several tools.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2422
2004-06-16 21:26:32 +00:00
Nicholas Nethercote
874fc865a4 Fix for bug #80942.
Addrcheck wasn't doing overlap checking as it should.  This is because
mac_replace_strmem.o was being linked with vgskin_addrcheck.so instead of
vgpreload_addrcheck.so.  I fixed the Makefile, and also moved
_VG_USERREQ__MEMCHECK_GET_RECORD_OVERLAP so Addrcheck could see it.  And I
added the 'overlap' test (from memcheck/tests/) to Addrcheck's regression
suite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2394
2004-05-05 10:46:22 +00:00
Nicholas Nethercote
a4069eaab5 Add missing SSE case for Memcheck's instrumentation (sigh).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2389
2004-04-26 13:06:16 +00:00
Nicholas Nethercote
7f5d0885be SETV and TESTV never have an ArchReg as their first argument.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2383
2004-04-22 12:58:05 +00:00
Robert Walsh
7c558d6199 Fix new override test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2361
2004-04-13 19:11:27 +00:00
Robert Walsh
4fa065bb03 Update test for recent "recently" fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2360
2004-04-13 19:08:34 +00:00
Nicholas Nethercote
979860ca67 Suppressions of jump errors were broken, because the size was zero and
so caused an assertion failure.  So set size == 1 -- it's only used for
suppressions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2359
2004-04-13 08:47:35 +00:00
Nicholas Nethercote
6a0aeb3716 Changed error message from:
Address 0x%x is not stack'd, malloc'd or free'd

to

  Address 0x%x is not stack'd, malloc'd or (recently) free'd

This makes things clearer in some circumstances, particularly when bogusly
accessing heap memory that has been freed, but Memcheck is no longer tracking.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2358
2004-04-13 08:36:35 +00:00
Nicholas Nethercote
d5fa01883e Added 2nd expected stderr output for trivialleak; often one of the 1000 blocks
by chance retains a pointer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2355
2004-04-10 00:53:45 +00:00
Tom Hughes
91e78b3482 Added more floating point instruction tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2347
2004-03-31 22:47:52 +00:00
Tom Hughes
6d76f9338e Fix typo in FPU eflags fix.
CCMAIL: 78514-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2345
2004-03-28 11:36:23 +00:00
Tom Hughes
99e443c3f5 For FPU/MMX/SSE instructions which don't reference any memory, make memcheck
look at whether the eflags are read or written and generate UCode to validate
and/or mark as valid the eflags when necessary.

CCMAIL: 78514-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2344
2004-03-28 11:26:29 +00:00
Tom Hughes
3330a9f65b Added more floating point instruction tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2343
2004-03-28 10:33:51 +00:00
Tom Hughes
2f1fb3e5f9 Added tests for floating point multiple and divide instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2340
2004-03-28 00:30:57 +00:00
Tom Hughes
cd101bf7b2 Extended instruction test system to handle x87 floating point instructions
and started working on adding tests for the x87 instruction set.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2338
2004-03-27 18:02:37 +00:00
Tom Hughes
34c0bbafdd Ignore valgrind core files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2329
2004-03-16 11:05:16 +00:00
Tom Hughes
4ab4db0743 Filter out the ": core dumped" message from test results as the user
running the tests might have a ulimit set that prevents the core dumps.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2327
2004-03-16 11:03:09 +00:00
Tom Hughes
57b01439e0 Move the handling of PSHUFW from the SSE code to the MMX code so that
it will work on older Athlons which only have MMXEXT support.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2319
2004-03-15 16:43:58 +00:00
Jeremy Fitzhardinge
82aaa16ef9 Fix "make distcheck", and also make sure that the generated archive
contains everything needed to "make regtest".  Bump the version.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2308
2004-03-12 10:51:39 +00:00
Tom Hughes
af675e0fea Anonymise path names for libc's built with debg symbols.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2305
2004-03-09 09:59:26 +00:00
Tom Hughes
4468065436 Add an alternate (appropriately filtered) result for some systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2304
2004-03-09 09:16:35 +00:00
Tom Hughes
5c5cc2d261 Fix expected standard error output for mmxext tests to resolve
differences in the amount of whitespace left with different skins.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2303
2004-03-09 08:50:02 +00:00