89 Commits

Author SHA1 Message Date
Nicholas Nethercote
4e8bcf9076 Move the last remaining tests out of corecheck.
Also introduced VG_(showing_core_errors)() to make core error display
more consistent.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4073
2005-07-01 04:15:36 +00:00
Nicholas Nethercote
514f201d55 Added VG_() prefixes to functions exported from m_ume to avoid
namespace pollution.

Also broadened a couple of _dl_* suppressions so that vgtest_ume
passes on my machine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3993
2005-06-21 23:03:36 +00:00
Nicholas Nethercote
b2f4f4cba0 Get "make dist" closer to working again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3946
2005-06-19 05:43:21 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Robert Walsh
d9cbc3ffec Fix x86_64 build.
Also fix vgtest_ume (although it fails on x86_64.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3943
2005-06-18 18:58:14 +00:00
Nicholas Nethercote
a0a6af2854 Make the stage2.lds building platform-independent by not trying to match
an exact address (idea from Paul Mackerras' PPC port).  Thus it could be
moved into coregrind/Makefile.am.

Let me know if this breaks anything on other platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3939
2005-06-18 16:41:30 +00:00
Nicholas Nethercote
3ae4d1a0ab A cleanup of the redirection stuff.
- Renamed VG_INTERCEPT as VG_REPLACE_FUNCTION to make its purpose
  clearer.

- Renamed VG_WRAPPER as VG_NOTIFY_ON_LOAD to make its purpose cleare.
  Started calling that stuff "load notification".

- Moved various things into m_redir.c, a much more sensible place for
  them.  This reduced the number of exported functions overall.  Renamed
  intercept_demangle() as Z_decode() as part of this.

- Improved the documentation of this stuff, especially in
  pub_core_redir.c.

- Got --run-libc-freeres=yes working again.  It was doing nothing.

- Renamed vg_inject.so as vg_preload_core.so to match
  vg_preload_<tool>.so

- Renamed vg_intercept.c as vg_preloaded.c.  (I kept the "vg_" prefix
  because this filename can appear in stack traces, so the "vg_" is a
  useful hint for users that it belongs to Valgrind.)

- Removed all the Memcheck-specific calls to add_redirect_sym_to_sym()
  from VG_(setup_redirect_table)(), instead using VG_REPLACE_FUNCTION in
  mac_replace_strmem.c, just like vg_replace_malloc.c.  This is the
  right way to do it.  This required moving some of
  coregrind/pub_core_redir.h into the newly added
  include/pub_tool_redir.h.  add_redirect_sym_to_sym() is no longer
  used...

- Now only handing off symbols to m_redir for inspection/decoding after
  they have been deemed to be interesting by the symbol table reader.

- Factored out commonality between the add_redirect_*_to_* functions
  into add_redirect_X_to_X().

- Added "Zh", meaning '-' ('h' for "hyphen"), to the Z-decoding scheme,
  to handle sonames like "ld-linux-x86-64.so.2".

- Added a FAQ explaining the newly found issue of glibc aliasing 
  sometimes causing the wrong function name to appear in stack traces.

- Added a new regtest strchr.c.  It's possible this will fail on some
  platforms.  If so, an alternative output file can be provided, but
  I'd like to see it in practice first.

It's possible that there will be minor breakage on other
platforms/setups, but it should be minimal and easily fixable.

Plus some ordinary cleanups in symtab.c:

- Removed the old optimisation from VG_(addStr)() whereby it kept track
  of the previous 5 added strings and avoiding duplicating any of them.
  Turns out it was barely having any effect any more, and just
  complicated things.

- Made read_symtab() more readable, by introducing a new variable
  "sym_name" and introducing the auxiliary function
  is_symbol_interesting().

- renamed the module variable 'segInfo' as 'segInfo_list' to make it
  more obvious it's a module variable and not just some ordinary local
  variable (which was an easy mistake to make).

-----------------------------------------------------------------------------

XXX: [later] remove add_redirect_sym_to_sym, and everything related to
     X_to_sym?  (ie. only need X_to_addr)

XXX: better function names?  all those 'resolved' names...
     [later...]




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3916
2005-06-16 03:56:58 +00:00
Nicholas Nethercote
1d0e2e6e41 Created m_machine, for various machine-related things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3903
2005-06-13 04:21:38 +00:00
Julian Seward
d905bd778e Expected outputs on Fedora Core 4.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3826
2005-05-31 19:49:28 +00:00
Julian Seward
2ad0acd102 amd64-linux output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3798
2005-05-24 15:09:14 +00:00
Julian Seward
01383ef160 Test XML output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3796
2005-05-24 14:46:02 +00:00
Julian Seward
7e143bf34f Add another possible output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3783
2005-05-23 14:02:51 +00:00
Julian Seward
232a4a67f8 Another expected output file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3684
2005-05-12 18:02:01 +00:00
Julian Seward
93d542f1d9 Add expected output file for 64-bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3621
2005-05-05 01:37:46 +00:00
Julian Seward
9f22797506 Add expected output files for 64-bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3620
2005-05-05 01:32:24 +00:00
Julian Seward
5c34e62c3b Add expected output files for 64-bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3619
2005-05-05 01:29:11 +00:00
Julian Seward
af4afafd2a Add expected output files for 64-bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3618
2005-05-05 01:23:50 +00:00
Julian Seward
bf6bf8fbbe Move all the 'scalar' (syscall-arg) tests into x86/. In fact they are
really x86-linux specific, but fixing it all properly will have to
wait for another day.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3615
2005-05-04 13:53:00 +00:00
Julian Seward
faa09bd038 Add a new acceptable-output file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3613
2005-05-04 12:27:48 +00:00
Julian Seward
f9b54012bf Move this test to a more sensible place. Originally it was intended
to check that the threading library hadn't messed up errno.  Now that
doesn't make much sense any more.  Anyway, now it annoyingly fails due
to memcheck reporting bugs in libpthread et al.  Move it to corecheck
so at least it can continue to run and hopefully not continually fail.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3611
2005-05-04 00:26:57 +00:00
Julian Seward
2eb10d8e1c Add another possible .stderr output for memcheck/tests/writev.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3379
2005-03-16 13:10:44 +00:00
Julian Seward
bdca1d1f3d Remove pth_once from memcheck/tests. It already exists in
corecheck/tests and there is no point in duplicating it.  Given that
it was intended to check the behaviour of our now-defunct pthread
implementation there's not much point in keeping it at all.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3378
2005-03-16 12:37:30 +00:00
Nicholas Nethercote
3c1778a582 Don't let GCC4.0 inline memcpy() and memcmp(), else the tests fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3370
2005-03-16 02:49:11 +00:00
Nicholas Nethercote
1b3b96a692 Fix false assertion in pattern matching.
MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3279
2005-03-11 05:05:50 +00:00
Julian Seward
0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00
Nicholas Nethercote
7a04aed730 Introduced build variables VG_ARCH_ALL, VG_OS_ALL, and VG_PLATFORM_ALL,
which list all the arches/OSes/platforms supported.  These are used by
several newly added DIST_SUBDIRS automake commands, which specify that
although when you are building you only want to build for the current
arch/OS/platform, when you do 'make dist' you want every
arch/OS/platform to get included.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3127
2004-11-27 16:47:42 +00:00
Nicholas Nethercote
6cc0d4c473 Add a mandatory --with-vex option to configure script.
Also, fix a Makefile so that Memcheck's regtests all build again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3081
2004-11-23 16:31:56 +00:00
Nicholas Nethercote
39914e513d Converted sigprocmask and rt_sigprocmask.
While doing so, fixed bug #93328, by using the right sized types in
sigprocmask(), and converting them as necessary.  Added a regression test for
it too.

(partly) MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3013
2004-11-15 19:03:27 +00:00
Nicholas Nethercote
98da137d80 Add scalar_exit_group to reg tests. Tweak scalar.c again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3008
2004-11-15 16:11:20 +00:00
Tom Hughes
4ab6205dcc Remove trailing space after \ continuation marker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3000
2004-11-15 09:38:26 +00:00
Nicholas Nethercote
838a81ce30 Undo splitting of scalar from the last commit, which was stupid; just use
--error-limit=no instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2993
2004-11-14 18:11:55 +00:00
Nicholas Nethercote
1dbf6e342f Converted a few more syscalls.
Also split scalar into 6 pieces, to avoid hitting the 300 error limit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2992
2004-11-14 17:58:27 +00:00
Nicholas Nethercote
267ff3faac Converted vfork() and acct(). Properly annotated all the ones we don't handle,
plus a few we do.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2967
2004-11-12 14:57:34 +00:00
Nicholas Nethercote
f49d300804 Converted fork(), and added a separate regtest for it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2961
2004-11-11 19:03:34 +00:00
Nicholas Nethercote
fff1483600 - Convert open() to the new syscall regime.
- Improve scalar regtest;  I will add new syscalls to it as I convert them.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2953
2004-11-09 16:20:46 +00:00
Nicholas Nethercote
b55751404f Improved Memcheck's error checking messages in two significant ways:
- All memory-related errors are now clear whether they are caused by
  unaddressable or uninitialised memory.  (Previously, writes were
  clearly addressability errors, but reads could be either.)  Mostly
  done by replacing the 'isWrite' field in MAC_Error with 'isUnaddr'.
  Also, mc_check_readable() now indicates not just if an error occurred,
  but what kind of error (ie. addressability or definedness).

- Put machinery into place in the core to inform tools when registers
  are being read by the core -- ie. a 'pre_reg_read' event.  Most
  notably, this facilitates syscall scalar arg definedness checking for
  Memcheck.  Currently this is only working for read(), write(), exit()
  and exit_group(), but it will be extended as the syscalls are
  overhauled as part of the arch-abstraction work.

  A consequence of this is that the ParamErr messages have changed.  This:

    Syscall param write(buf) contains uninitialised byte(s)

  now means that the pointer 'buf' is partially undefined.  If the memory
  pointed to by 'buf' is partially undefined or unaddressable, it says one of:

    Syscall param write(buf) points to uninitialised byte(s)
    Syscall param write(buf) points to unaddressable byte(s)

  The docs have been updated accordingly.

  I also added a couple of regression tests.

These two change sare notable for being the first improvements to
Memcheck's checking/errors in a long time.

I also folded mc_clientreqs.c into mc_main.c, which saves exporting a
whole bunch of things that are not used anywhere else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2949
2004-11-08 19:20:09 +00:00
Nicholas Nethercote
e6b394151e Add very thorough string functions test from glibc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2944
2004-11-07 10:58:19 +00:00
Nicholas Nethercote
6030b047a8 Remove writev.stderr.exp3 -- not necessary if we pass -q to Valgrind.
Add writev.stderr.exp2 to the Makefile.am so it gets included in the distro.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2939
2004-11-05 13:45:53 +00:00
Nicholas Nethercote
df6d264d08 Make the checking of poll() more accurate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2938
2004-11-05 12:02:27 +00:00
Nicholas Nethercote
a5c3267d90 Jump through a hoop to make vgtest_ume work again on PIE-supporting systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2859
2004-10-27 12:05:59 +00:00
Nicholas Nethercote
ac36b57353 Fix "make check" for when src_dir != build_dir
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2826
2004-10-21 14:07:58 +00:00
Nicholas Nethercote
41897a01a9 Arch-abstraction:
- move remaining x86-specific Memcheck tests into an x86/ subdir.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2817
2004-10-20 11:43:01 +00:00
Nicholas Nethercote
78b8e2c67f Arch-abstraction:
- things I forgot to do when moving the insn_* tests...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2810
2004-10-19 19:07:32 +00:00
Nicholas Nethercote
66adb12133 Arch-abstraction:
- Moved all the insn_* tests into x86/ subdirectories.  What are the chances of
  me getting this right on the first attempt?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2809
2004-10-19 18:54:11 +00:00
Nicholas Nethercote
493933b1c6 Arch-abstraction: a nice change that removes the need for ume_entry.S. Instead
of using an assembly hack to find the stack pointer at startup, we find it from
argv.  It's much simpler, avoids linking games, is platform independent, and
works on PPC.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2782
2004-10-18 11:52:17 +00:00
Nicholas Nethercote
e7ca2d4602 Further strengthened the unit self-test, by also testing find_auxv(). Now all
functions exported by ume.c are tested.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2762
2004-10-14 09:28:11 +00:00
Nicholas Nethercote
5435f2c2ec Added a unit self-test -- a test program that incorporates a small part of
Valgrind itself (the files ume.c, ume_entry.c and jmp_with_stack.c).  Thus,
we are using Memcheck to check these files in a unit test setting.

I hope to do unit self-testing for many more parts of Valgrind, eventually all
the bits that can be pulled out into any kind of sensible stand-alone form.
Doing so achieves two things:

 a) it introduces unit testing into our framework (a serious shortcoming at the
    moment)
 b) it lets us use Valgrind (esp. Memcheck) on itself, to some extent

This should help reliability.  This first unit self-test isn't very exhaustive,
but it's a start.

Note that this involves something like bootstrapping, in that we are checking
parts of a Valgrind build with itself.  I don't think this will be a problem,
since we (at least, I do) tend to only run the regtests when we think the
Valgrind build is ok.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2760
2004-10-14 08:38:06 +00:00
Tom Hughes
98b5592107 Add alternate results for some tests that use mmap.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2755
2004-10-13 16:48:21 +00:00
Nicholas Nethercote
ce3c7200a7 Fix for bug 91162: cope with jumps to bogus addresses when there is a SEGV
signal handler present -- previously, Valgrind would abort unnecessarily on
this case.

Added a regression test for it.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2743
2004-10-13 09:47:24 +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