Commit Graph

243 Commits

Author SHA1 Message Date
Nicholas Nethercote
ce2585d447 Changed message at the top of files, and the startup message, and the
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
2004-12-01 14:14:42 +00:00
Nicholas Nethercote
b1b5c00b01 Streamlined and consistified alignment checking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3168
2004-11-30 18:08:05 +00:00
Nicholas Nethercote
8f2c187803 Whoops, must edit tool.h.base, not tool.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3163
2004-11-30 14:41:13 +00:00
Nicholas Nethercote
1b64ae853c Added the skeleton of the AMD64 syscall table, all commented out, but
ready to go.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3145
2004-11-29 17:28:41 +00:00
Nicholas Nethercote
10b4595add Added beginnings of an AMD64 port, so lots of new files and directories.
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
2004-11-29 13:54:10 +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
5cc18c19a2 Moved the variable VGOFF_(m_eip) from x86, and moved it (and its
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
2004-11-27 14:27:21 +00:00
Nicholas Nethercote
4399d9700f Added beginnings of an ARM port, to the point where it compiles. It does not
run, though.  There are lots of stubs to be filled in.  (The asm ones currently
just have "swi" in them, which seems to cause seg faults.) 

Also, some of the macros are decided dubious, especially:

  ARCH_* are bogus
  SYSCALL_RET is bogus
  PLATFORM_SET_SYSCALL_RESULT is bogus
  not sure about SET_SYSCALL_RETVAL
  FIRST_STACK_FRAME et al -- bogus?
  VG_MAX_JUMPS ?

And in stage2.lds, the 0x8048000 is almost certainly wrong


This required some tweakings of the core:
- some of the vki_*.h kernel types were fixed up

- had to disable the AM_PROG_CC_C_O macro in configure.in, because automake
  (autoconf?) didn't like it...

- some "#ifdef __x86__" guards were introduced, for nasty x86 things I don't
  yet know how to factor out (trampoline page muck, sysinfo page muck).

- fixed a minor stupidity in vg_proxylwp.c.

- moved the ptrace wrapper into the x86-linux part

- had to change the intercept mangling scheme, to use 'J' instead of '$' as the
  escape char because GCC didn't like '$'.  This is all very dubious, and only
  works because none of our intercepted symbols contains a 'J'.  To be fixed up
  ASAP.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3120
2004-11-26 19:34:36 +00:00
Nicholas Nethercote
f8a005fa9a Do some final "sk_" --> "tl_" changes that I missed earlier.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3106
2004-11-26 10:53:33 +00:00
Nicholas Nethercote
efed8e4671 Removed shadow_regs 'need', because it was being used only trivially in
a couple of places, and is no longer needed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3096
2004-11-24 16:57:16 +00:00
Nicholas Nethercote
feb4fbaef5 Removed all uses of register numbers (eg. arch-specific ones like R_EAX, and
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
2004-11-24 16:30:22 +00:00
Nicholas Nethercote
971687bad3 Cleanups for baseBlock removal: fix some comments, remove two decls
that are no longer needed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3093
2004-11-24 11:57:51 +00:00
Nicholas Nethercote
6f5dd2c9a5 Remove unneeded comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3091
2004-11-24 10:47:42 +00:00
Julian Seward
3558db91b1 Get rid of baseBlock. Now, when generated code is running, the guest
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
2004-11-24 10:44:19 +00:00
Nicholas Nethercote
ef77be4188 Remove out-of-date comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3086
2004-11-23 18:01:21 +00:00
Nicholas Nethercote
7f0984ea02 The syscall wrappers for sys_fcntl{,64} were too simplistic -- the 3rd
arg is only used if the 2nd arg has particular values, so we were
getting false positives.  This commit makes the wrappers smarter to
account for this.  I updated the reg test too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3080
2004-11-23 14:57:49 +00:00
Nicholas Nethercote
6ca747fcc7 Move redundant function decls from core.h (they end up in tool.h
anyway).

Also remove a declaration for a no-longer-existing function from tool.h.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3071
2004-11-22 21:13:31 +00:00
Julian Seward
fd3934e1e5 Fix some linking problems which were preventing memcheck from starting.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3069
2004-11-22 20:51:49 +00:00
Nicholas Nethercote
8664fd5e88 Remove extended_UCode 'need', which has been obsoleted by Vex. Kept the
field in the struct for backward compatibility (but renamed it to
no_longer_used_0).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3067
2004-11-22 20:37:42 +00:00
Nicholas Nethercote
5197cfe79d Last few skin-->tool changes, in various places.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3063
2004-11-22 19:26:27 +00:00
Nicholas Nethercote
9df62e9f85 Rename macros ("SKIN"-->"TOOL")
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3062
2004-11-22 19:12:49 +00:00
Julian Seward
b3498dd85c Merge in enough changes from the old Vex tree to make stage2 link, at
least.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3061
2004-11-22 19:01:47 +00:00
Nicholas Nethercote
454ab569fe Converted the SK_ prefix to TL_ everywhere.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3060
2004-11-22 18:33:15 +00:00
Nicholas Nethercote
ceb66880ae Removed include/vg_skin.h, which has been a shell just pointing to
tool.h for a while now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3058
2004-11-22 18:04:29 +00:00
Nicholas Nethercote
3093a1768b Renamed VG_(skin_panic) as VG_(tool_panic).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3057
2004-11-22 18:02:32 +00:00
Nicholas Nethercote
213ef621b7 Renamed functions with 'Skin' in them: SK_(pp_SkinError),
SK_(eq_SkinError), MAC_(pp_shared_SkinError)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3056
2004-11-22 17:57:07 +00:00
Nicholas Nethercote
cf9cf2a220 Renamed sk_assert() as tl_assert().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3055
2004-11-22 17:18:48 +00:00
Nicholas Nethercote
48aff7c26f Convert the 'skin_errors' need to 'tool_errors'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3053
2004-11-22 16:46:13 +00:00
Nicholas Nethercote
be2a95cff2 Minor tweaks for external tools, for Josef W.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3050
2004-11-19 15:42:49 +00:00
Nicholas Nethercote
b490e55dc8 Tweaks for keeping Josef's external Callgrind tool running, including a bumping
of the interface major version number.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3043
2004-11-18 12:58:53 +00:00
Nicholas Nethercote
126c196c21 Converted the timer_* and clock_* syscalls.
Also now checking the return value of every syscall in scalar, to make sure
that they (mostly) fail as expected.  Because occasionally one would succeed
unexpectedly and unaddressable memory would be marked as addressable, and
things would go haywire.  (The fact that the wrapper sets the memory as
addressable in these cases is a bug with the relevant wrappers;  I'll fix them
later.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3023
2004-11-16 16:15:41 +00:00
Nicholas Nethercote
c026b31697 Converted the io_* and mq_* syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3022
2004-11-16 12:58:04 +00:00
Nicholas Nethercote
ba41261f08 Converted modify_ldt() and init_module(); the old code for init_module() was
seemingly totally wrong, as the man page doesn't reflect the real kernel code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3009
2004-11-15 16:40:40 +00:00
Nicholas Nethercote
a0ce711edb Converted more syscalls
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3004
2004-11-15 14:32:12 +00:00
Nicholas Nethercote
ad980e636a Converted a few more, including clone() which I'm not at all sure about, and
ipc() which is done too simplistically.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3002
2004-11-15 12:28:58 +00:00
Nicholas Nethercote
8e2be498fc Converted a couple more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2991
2004-11-14 17:03:47 +00:00
Nicholas Nethercote
e0c74bbbfa converted a few more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2987
2004-11-14 13:42:51 +00:00
Tom Hughes
8448d42efa Add support for most of the console driver ioctls. This fixes one of
the ioctls complained about in bug 93096 as well as one that came up
on the mailing list a few weeks ago.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2982
2004-11-13 00:36:15 +00:00
Nicholas Nethercote
66213608e7 converted some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2976
2004-11-12 19:55:08 +00:00
Nicholas Nethercote
be04c2e5d9 Remove unnecessary comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2971
2004-11-12 17:13:17 +00:00
Nicholas Nethercote
691c66f51d Converted lookup_dcookie.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2966
2004-11-12 13:29:24 +00:00
Nicholas Nethercote
9f628720a2 Converted a bunch more syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2960
2004-11-11 18:00:47 +00:00
Nicholas Nethercote
746332ff63 Minor VKI_* fixups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2943
2004-11-06 16:31:43 +00:00
Nicholas Nethercote
1c674f8d7c Get rid of compile errors and warnings (ahem).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2925
2004-11-04 19:10:43 +00:00
Nicholas Nethercote
e59b9df749 64-bit cleanness: introduced OffT type for off_t, used it in a few important
places.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2922
2004-11-04 18:39:22 +00:00
Nicholas Nethercote
528046b537 64-bit cleanness: make the hash-table have UWord keys instead of UInt keys.
Allows addresses as keys.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2916
2004-11-04 16:39:43 +00:00
Nicholas Nethercote
d8fc746ba4 64-bit cleanness: Yet more UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2910
2004-11-03 18:10:37 +00:00
Nicholas Nethercote
c73601d666 64-bit cleanness:
- Use SizeT instead of UInt for new_mem_stack and all the related functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2908
2004-11-02 13:29:50 +00:00
Nicholas Nethercote
e245f2aeb0 64-bit cleanness: Converted malloc() et al to use SizeT rather than Int.
This required some tricks with casting to maintain Memcheck's silly (ie.
negative) arg checking.  The allocator was also changed accordingly. It
should now be able to allocate more than 4GB blocks on 64-bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2906
2004-11-02 12:36:02 +00:00
Nicholas Nethercote
db131cacab unbreak compilation...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2900
2004-11-01 19:36:46 +00:00