libpthread implementation: USERREQ__READ_MILLISECOND_TIMER, USERREQ__MALLOC,
USERREQ__FREE.
As a consequence, all the PTHREQ macros (eg. VGA_PTHREQ_RET,
SET_PTHREQ_RETVAL) could be removed. And VG_(tl_malloc_called_by_scheduler)
has been renamed VG_(tl_malloc_called_deliberately) to reflect how its role
has changed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3438
amd64 version is broken again. Writing code with undocumented
assumptions should be a firable offense. At the very least.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3402
because it was always being set to VG_MIN_ALLOC_SZB, and so was just one
more thing to get wrong, as well as exposing VG_MIN_ALLOC_SZB to more places
than necessary.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3340
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
more accurate, on the amd64-linux ABI that is allowable. Anyway,
parameterise the signal handler so it isn't confused by such accesses.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3252
table/cache management. Two main changes. (1) Translation areas are
recorded using VexGuestExtents, so that Vex is now properly supported
and code deletion works correctly. (2) Low overhead BB profiling,
enabled by the --profile-flags=<XXXXXXXX> option. This finds the top
N bbs at exit and shows them, so as to give a basis from which to do
performane tuning.
To support this, the way tt/tc work is changed. It is still a
sectored arrangement, but now each sector has its own hash table.
This simplifies a lot of things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3226
tedious but necessary to support. Also, get rid of the have_ssestate
variable. The new valgrind will not work on x86s which do not have at
least fxsave/fxrstor available; this rules all CPUs prior to Pentium
II. No big deal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3210
VEX, and clean up the rest of it and push it into
coregrind/x86/state.c. coregrind/x86-linux/ldt.c is now empty, but I
see that some of the stuff in x86/state.c should really be in
x86-linux/ldt.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3193
string in valgrind.pc.in, so that they describe Valgrind as a "dynamic
binary instrumentation framework", and don't mention platforms at all.
I had to tweak the regtest filters a bit for this.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3178
through once, failing to find the translation, and falling back to the
scheduler.
Did a couple of minor associated cleanups too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3171
- implemented VG_(clone)()
- implemented PLATFORM_DO_MMAP()
- implemented VG_(init_thread1state)() [will need to be updated as the
Vex AMD64 guest state is updated]
- implemented OYNK, because it's useful
Also a couple of general cleaning up things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3165
Int VG_(do_syscall) ( UInt, UWord, UWord, UWord, UWord, UWord, UWord );
to replace the previous:
Int VG_(do_syscall) ( UInt, ... )
Reason being that sometimes you could get incorrect args passed, when
passing 32-bit ints on 64-bit platforms. I also added macros
VG_(do_syscall[123456]) to make life easier, and converted all the
relevant calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3143
It compiles, but aborts immediately if you try to run it.
I didn't include ldt.c; I'm not sure how the LDT is used on AMD64. It can be
added later if necessary.
While doing this, did some 64-bit cleanness fixes:
- Added necessary intermediate casts to ULong to avoid warnings when converting
ThreadId to void* and vice versa, in vg_scheduler.c.
- Fixed VALGRIND_NON_SIMD_CALL[0123] to use 'long' as the return type.
- Fixed VALGRIND_PRINTF{,BACKTRACE} to use unsigned longs instead of unsigned
ints, as needed.
- Converted some offsets in vg_symtab2.h from "Int" to "OffT".
- Made strlen, strncat, etc, use SizeT instead of 'unsigned int' for the length
parameter.
- Couple of other minor things.
I had to insert some "#ifdef __amd64__" and "#ifndef __amd64__" guards in
places. In particular, in vg_mylibc.c, some of our syscall wrappers aren't
appropriate for AMD64 because the syscall numbering is a bit different in
places. This difference will have to be abstracted out somehow.
Also rewrote the sys_fcntl and sys_fcntl64 wrappers, as required for AMD64.
Also moved the ipc wrapper into x86, since it's not applicable for
AMD64. However, it is applicable (I think) for ARM, so it would be nice
to work out a way to share syscall wrappers between some, but not all,
archs. Hmm. Also now using the real IPC constants rather than magic
numbers in the wrapper.
Other non-AMD64-related fixes:
- ARM: fixed syscall table by accounting for the fact that syscall
numbers don't start at 0, but rather at 0x900000.
- Converted a few places to use ThreadId instead of 'int' or 'Int' for
thread IDs.
- Added both AMD64 and ARM (which I'd forgotten) entries to valgrind.spec.in.
- Tweaked comments in various places.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3136
computation) into the generic core, because it's needed by the dispatch
loop of all archs. Also renamed it VG_(instr_ptr_offset), which is
clearer. Since it was the last use of the VGOFF_ prefix, I removed that
prefix.
Also cleaned up the ARM stubs slightly, by removing some of the copied,
commented-out x86 code which has since fallen out of date with the real
x86 code and was thus misleading.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3123
arch-neutral ones like R_STACK_PTR). Where they were used, we now always talk
about an offset into the Vex guest state, and an offset. As a result,
the shadow register get/set functions had to change. They now also use
an offset and size, and in an arch-neutral way.
Also, I combined the five the post_reg_write* functions into a single one that
takes a 'CorePart' parameter (plus also a ThreadId). Also, I added more
arguments (the CorePart, and the ThreadId) to the post_mem_write event, for
consistency with the pre_mem_* events.
Also, I reduced the number of register names that must be specified by each
arch, by factoring out duplication; and shortened their names for the core (eg.
ARCH_STACK_PTR is now STACK_PTR).
Plus some related minor cleanups in syscall wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3094
state pointer points directly at the ThreadState.arch.vex field, thus
updating it in place and avoiding a lot of code (and time-wasting)
which copies stuff back and forth to baseBlock.
Fix zillions of other places in the system where the current thread id
is needed. It is now passed to all needed places.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3090