1592 Commits

Author SHA1 Message Date
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
Tom Hughes
3561ea08ca Added VG_(cpuid) to replace the various bits of inline assembler used
to query the CPU characteristics as the use of four implicit registers
causes havoc when GCC tries to inline and optimise the assembler.

Fix to bug #79696.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2421
2004-06-16 20:51:45 +00:00
Nicholas Nethercote
84f99902f0 Reinstate -h option, which disappeared at some point.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2420
2004-06-16 11:56:29 +00:00
Nicholas Nethercote
63c632f5f3 Removed documentation references to the 'ioctl-VTIME' and 'truncate-writes'
weird hacks, which no longer exist thanks to the proxy lwp stuff.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2419
2004-06-16 11:51:08 +00:00
Nicholas Nethercote
9ce21c9e69 Fixed up various command line option scenarios:
- If no tool is specified, V now gives a short message and a list of
    available tools.  This was meant to happen previously, but a bug prevented
    it from working properly;  it gave the usage message instead.

  - If a bad option is given, V now gives a short message rather than the full
    --help.  This make V consistent with all other programs I looked at.

  - Now returning 0 when you do 'valgrind --help' and 'valgrind --version'
    as other programs do.

  - Removed VG_(startup_logging)() and VG_(shutdown_logging)() as they were
    empty and have been for a long time (always?).

  - Added various tests for these scenarios.  Had to change the regtest
    script slightly to allow for malformed command lines.

This addresses bug (wishlist) #82999.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2418
2004-06-15 10:54:40 +00:00
Nicholas Nethercote
bde18dba08 Cater for systems lacking AT_SYSINFO.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2417
2004-06-15 08:34:10 +00:00
Tom Hughes
05f8bea376 Don't bother trying to test semtimedop if it isn't available.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2416
2004-06-14 17:27:41 +00:00
Tom Hughes
d5fcc39f7d Include config.h so that the test for semtimedop works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2415
2004-06-14 13:15:40 +00:00
Tom Hughes
d9d4e91c04 Fixed the sem test to work on systems with semtimedop.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2414
2004-06-14 12:33:43 +00:00
Nicholas Nethercote
f89b31fc98 Unbreak compilation due to missing #define.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2413
2004-06-14 11:56:59 +00:00
Jeremy Fitzhardinge
ca2bb4faf6 Fix problem with FC2's vdso (sysinfo) page, which lives at a low,
random address.  This gets unmapped as part of the client setup, and
causes syscalls to fail as a result.  This patch simply disregards the
sysinfo page.  It seems like a blunt fix, but I don't think anything
depends on a sysinfo page.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2412
2004-06-14 02:36:09 +00:00
Tom Hughes
05d3236732 Fixed cast to work on NPTL systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2411
2004-06-13 14:35:43 +00:00
Tom Hughes
05369f9e57 Add support for the semtimedop system call.
Based on patch from Peter Knaggs <sedragdnuon@yahoo.com>.

CCMAIL: 79714-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2410
2004-06-13 14:23:00 +00:00
Tom Hughes
73500af01e When cancelling a thread that is waiting on a condition variable we
need to relock the associated mutex before running the cancellation
handlers.

This patch ensures that the mutex is reaquired in the above case and
also makes pthread_join and pthread_cond_wait act as cancellation points
as required by the POSIX threads standard.

Based on patch from Joseph Link <joelink@joelink.net>.

CCMAIL: 81297-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2409
2004-06-13 12:07:53 +00:00
Tom Hughes
dc049b7c82 Add support for separate debug files, which are just separate ELF files
containing the relevant debug sections and located using the information
in the .gnu_debuglink section of the main file along with some search
rules and checksum logic borrowed from binutils/gdb.

CCMAIL: 82872-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2408
2004-06-13 09:59:02 +00:00
Tom Hughes
bb942b40c8 Add a strrchr implementation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2407
2004-06-13 09:55:22 +00:00
Tom Hughes
f267e2c7d0 Fixed the NPTL cleanup handler support to try and make sure it will
compile on systems with NPTL header files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2406
2004-06-12 17:25:25 +00:00
Tom Hughes
83780627b5 It appears that NPTL uses a new system for dealing with cleanup
handlers when a thread is cancelled which has the side effect that
programs linked with librt fail on Fedora Core 2 due to librt having
been built against the NPTL header instead of the old pthread headers.

This change extends valgrind's libpthread.so to handle both the old
and new style cleanup handlers in a similar way to NPTL and seems to
be sufficient to get programs linked with librt working again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2405
2004-06-12 12:58:22 +00:00
Tom Hughes
0bbe5bb70d There is no __accept in any libc or libpthread that I can find so
it isn't clear why we were intercepting that and only aliasing accept
to it. Switched to intercepting accept directly instead.

CCMAIL: 76869-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2404
2004-06-04 21:42:18 +00:00
Tom Hughes
c8454991c0 Add an extra suppression for Fedora Core 2/glibc 2.3.3 systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2403
2004-06-03 18:42:34 +00:00
Tom Hughes
95776fd744 Changed cancellation wrappers to use dlsym(RTLD_NEXT) to look up the
libc version of the wrapped function when forwarding the call rather
than trying to call the internal __libc_xxx version of the routine
as many of those are marked as GLIBC_PRIVATE in recent releases.

CCMAIL: 82026-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2402
2004-06-03 18:00:58 +00:00
Jeremy Fitzhardinge
ddb00a6ade Oops - fix up broken assert.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2401
2004-06-03 17:12:07 +00:00
Jeremy Fitzhardinge
b8abc7c9d1 Partial fix for bug 76869. This fixes the problem with returning from
a signal handler when VDSOs are turned off in FC2.  Note that we don't
(yet) support VDSOs being on (use "echo 0 > /proc/sys/kernel/vdso").


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2400
2004-06-03 10:00:42 +00:00
Nicholas Nethercote
0954cfc526 Fix wishlist item 82098, thanks to Ralf Wildenhues:
ANSIfication of the hp2ps code. The most important changes are the correct
  use of the stdarg mechanism (former hacks could bite on other systems, so
  please tell upstream), inclusion of stdlib.h instead of declaring free
  yourself, adding a few missed PROTO()s and using size_t for xmalloc and
  xrealloc.:


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2399
2004-06-02 20:43:24 +00:00
Nicholas Nethercote
d4834c9c77 Added "repne movs", not official but seems to occur. Also restructured the
rep/repe/repne cases to use a switch instead of if/else, as it's cleaner.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2398
2004-06-02 14:48:16 +00:00
Nicholas Nethercote
df5febb1a0 Fix patch from this morning -- missing commas, erk
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2397
2004-05-11 16:37:17 +00:00
Nicholas Nethercote
05167f92c1 Teach Massif about the 'nothrow' versions of new and new[].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2396
2004-05-11 09:21:08 +00:00
Nicholas Nethercote
4517a54005 Update copyright
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2395
2004-05-11 09:17:49 +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
7804c9527e Fix comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2393
2004-05-04 11:25:34 +00:00
Robert Walsh
661855fee0 Suppressions for Fedora Core 2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2392
2004-04-29 08:50:44 +00:00
Robert Walsh
d9e00c2c90 Implement syscall 258, for those of use running Fedora Core 2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2391
2004-04-29 08:40:50 +00:00
Nicholas Nethercote
6c5693221e Fix for bug 79355: fix up bogus assertion that was failing when
stack_snapshot() returned 0xffffffff as one of its eip values.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2390
2004-04-27 09:51:51 +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
df975d0a3d Tighten MOV's sanity checking slightly
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2388
2004-04-26 09:21:25 +00:00
Nicholas Nethercote
51a32b0907 Split some combined error messages, so they are more informative. Also return
EPERM where appropriate, instead of EINVAL.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2387
2004-04-26 08:05:24 +00:00
Nicholas Nethercote
71f39d90cc Fix supps for Valgrind's own libpthread leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2386
2004-04-25 12:02:31 +00:00
Nicholas Nethercote
e26fa084b9 Fix bug in helper_{IN,OUT} -- they weren't preserving %eflags as they should.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2385
2004-04-22 18:47:07 +00:00
Tom Hughes
00958cb0de Cope with AT_xCACHEBSIZE not being defined, which they aren't on systems
with 2.2 kernels and, it seems, on some systems with 2.4 kernels.

CCMAIL: 79179-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2384
2004-04-22 18:12:31 +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
Tom Hughes
a159f627cb Make support for the FBIOGET ioctls conditional on linux/fb.h being
present at compile time.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2382
2004-04-22 07:28:43 +00:00
Tom Hughes
e14c5dc6ed Add support for the FBIOGET_VSCREENINFO and FBIOGET_FSCREENINFO ioctls
based on a patch from Paul Olav Tvete <paul@trolltech.com>.

CCMAIL: 77022-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2381
2004-04-21 15:52:33 +00:00
Tom Hughes
2a2ebbc8f0 Change the debugger attachment code to send the STOP signal to the
forked process before using ptrace() to continue it, instead of asking
ptrace to deliver it, as that doesn't seem to work on some versions
of linux.

CCMAIL: 77824-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2380
2004-04-21 15:39:57 +00:00
Tom Hughes
b282a5ca81 Initialise %cs, %ds and %ss in the virtual machine to match the values
supplied by the operating system for the code, data and stack segments.

Explicit references using these segments still won't work but they
will at least produce an assertion to indicate that they aren't
supported instead of raising a segmentation fault in the target
program because of an apparent privilege violation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2379
2004-04-21 15:16:43 +00:00
Nicholas Nethercote
4e0a147494 fix typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2378
2004-04-21 09:17:19 +00:00
Nicholas Nethercote
99e40bdbdd Update for compulsory --tool
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2377
2004-04-21 07:22:50 +00:00
Nicholas Nethercote
6fd129635e Addrcheck wasn't instrumenting MMX2a1_MemRd... whoops. Man, those instructions
are a mess.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2376
2004-04-20 10:07:44 +00:00
Nicholas Nethercote
9c5e009c05 When printing code and an insane instruction is encountered, ugly-print (giving
full details) it as well as pretty-printing it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2375
2004-04-18 15:20:43 +00:00
Nicholas Nethercote
ff7adfacc8 Introduce uWiden, similar to uCCall, uCond, etc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2374
2004-04-18 12:23:02 +00:00
Nicholas Nethercote
0c7fbab32a With -v, print out contents of /proc/version at startup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2373
2004-04-18 12:08:46 +00:00