Commit Graph

1514 Commits

Author SHA1 Message Date
Nicholas Nethercote
7a75a9f583 Overhauled the docs. Removed all the HTML files, put in XML files as
converted by Donna.  Hooked it into the build system so they are only
built when specifically asked for, and when doing "make dist".

They're not perfect;  in particular, there are the following problems:
- The plain-text FAQ should be built from FAQ.xml, but this is not
  currently done.  (The text FAQ has been left in for now.)

- The PS/PDF building doesn't work -- it fails with an incomprehensible
  error message which I haven't yet deciphered.

Nonetheless, I'm putting it in so others can see it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3153
2004-11-30 10:43:45 +00:00
Julian Seward
e62fd9ba79 Handle emulation-warnings emitted by Vex-generated code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3152
2004-11-29 19:47:54 +00:00
Julian Seward
62024ae795 Fix comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3151
2004-11-29 19:46:47 +00:00
Julian Seward
80377f3867 Remove Marie-Celeste declarations.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3150
2004-11-29 19:46:28 +00:00
Nicholas Nethercote
decc1ddb43 Implemented jmp_with_stack for AMD64. Cleaned up the
comments/formatting of jmp_with_stack for ARM and x86, too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3149
2004-11-29 17:59:00 +00:00
Nicholas Nethercote
d20b2e7b5a Remove some ancient comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3148
2004-11-29 17:36:48 +00:00
Nicholas Nethercote
f4671df654 64-bit cleanness: make VG_(do_syscall)() return a Word, not an Int.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3147
2004-11-29 17:33:31 +00:00
Nicholas Nethercote
d0d191cc16 comment only
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3146
2004-11-29 17:29:46 +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
f8910f2b3f Avoid compile warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3144
2004-11-29 16:57:02 +00:00
Nicholas Nethercote
61fcb2828d Gave VG_(do_syscall)() a more specific prototype:
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
2004-11-29 16:49:18 +00:00
Nicholas Nethercote
6afeca28a1 Fix reg test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3142
2004-11-29 16:08:22 +00:00
Nicholas Nethercote
121ce56af3 very minor tweaks
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3141
2004-11-29 16:05:54 +00:00
Nicholas Nethercote
8a1cef27ad Minor 64-bit cleanups, mostly comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3140
2004-11-29 15:45:31 +00:00
Nicholas Nethercote
8629085dde Fix minor ARM breakage caused by the AMD64 commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3139
2004-11-29 15:08:51 +00:00
Nicholas Nethercote
146a07a91f Remove string "panic_msg_ebp" from x86/dispatch.S and amd64/dispatch.S,
as it is never used.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3138
2004-11-29 14:44:09 +00:00
Nicholas Nethercote
57ab6c1b41 Fix post-amd64-commit x86 breakage:
- remove warnings from vg_scheduler.c by using (UWord) casts rather than
  64-bit-assuming (ULong) casts.
- move deref_Addr() to x86-linux/syscalls.c, where it's now used.

Also got rid of the ancient SIGNAL_SIMULATION flag, which is a remnant of very
early days -- things now only work with signal simulation, so no point in
keeping it around.

Also make addrcheck/tests/fprw work again now that --single-step is
dead.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3137
2004-11-29 14:24:57 +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
Julian Seward
8cf673e344 Get rid of various old flags and constants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3135
2004-11-28 18:07:41 +00:00
Julian Seward
86ef8a5a44 Get rid of all vestiges of translation-chaining, and generally clean
up and paranoidise the translation cache management.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3134
2004-11-28 16:58:05 +00:00
Julian Seward
798a984cea Build fixes for gcc-2.95.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3132
2004-11-28 14:25:01 +00:00
Julian Seward
8c41cd6b5b Rewrite ensure_valgrind() in a slightly less stupid way. This
significantly reduces the number of client requests made by programs
which make intensive use of the pthread_ functions, such as
OpenOffice.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3131
2004-11-28 02:58:11 +00:00
Julian Seward
91f8be65cc Comment-only update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3130
2004-11-28 02:30:43 +00:00
Nicholas Nethercote
ba4e9a5a61 Make ARM build again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3129
2004-11-27 16:58:45 +00:00
Nicholas Nethercote
f00e834c58 Use better syscall argument names for two wrappers, now that "res" and
"arg[2345]" don't clash with macros.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3128
2004-11-27 16:57:18 +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
4e12afbac2 Moved some duplicated macros out of arch/OS/platform-specific parts,
into the core.  Renamed them with capital letters at the same time (eg.
arg1-->ARG1, res-->RES) to reduce likelihood of name conflicts, and also
it doesn't hurt to make it clearer that they're macros.  The result is a
very big diff, but conceptually it's very simple.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3126
2004-11-27 16:10:23 +00:00
Nicholas Nethercote
9ed618d3c2 Nuke some defunct constants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3125
2004-11-27 15:28:44 +00:00
Nicholas Nethercote
f23dea17b2 Factored out some stuff duplicated across all archs, to do with syscall
wrappers.  The management apologises for the excessive use of macros, but it's
hard to avoid and really does make the repetitive parts of the code (ie. the
parts that are repeated for each arch) much more concise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3124
2004-11-27 15:22:24 +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
c40ff3902e Fix a couple of minor ARM things -- frame pointer is R11, it seems, and
programs get loaded at 0x00008000.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3122
2004-11-27 13:42:42 +00:00
Nicholas Nethercote
6677759f45 Rename $VG_ARCH/signal.c and $VG_ARCH/signals.c, to make
coregrind/vg_signals.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3121
2004-11-27 13:37:33 +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
Julian Seward
4c21141359 More debug printing for redirections (disabled).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3117
2004-11-26 15:06:13 +00:00
Julian Seward
45c0182176 When creating a child, copy the parent's .vex/.vex_shadow into it so
as to give it a sane starting state.  This may not be the Right
Answer, but it fixes regtest failure 'susphello' and doesn't break
anything else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3116
2004-11-26 15:04:24 +00:00
Nicholas Nethercote
e8c0f0e619 Disable core dumps, and remove the previous attempts at factoring out
the arch-specific bits, which were just plain wrong.  This is a problem for a
later day.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3115
2004-11-26 14:07:24 +00:00
Julian Seward
ccf7094e69 When VEX bombs, exit in a more understandable way.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3114
2004-11-26 13:49:59 +00:00
Julian Seward
544e6d1d14 Move declarations of some thread-return-code values from Valgrind to
VEX.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3113
2004-11-26 13:25:17 +00:00
Nicholas Nethercote
dc4ad41b16 Rename arch_thread_aux_t --> ThreadArchAux, to match ThreadArchState.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3111
2004-11-26 12:44:19 +00:00
Julian Seward
78e6eed82a Fix overly-restrictive assertion causing many threaded programs to
fail.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3108
2004-11-26 11:57:41 +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
Julian Seward
9015db7090 run_thread_for_a_while: ensure the guest state layout of the thread
which we're just about to run matches Vex's assumptions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3103
2004-11-25 22:50:17 +00:00
Julian Seward
f22c255940 Fix another potentially-failing use of get_current_tid(), in
proxy_sendsig().  Fixes the pth_blockesig regression test.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3100
2004-11-24 21:24:24 +00:00
Nicholas Nethercote
3004b39874 Remove now-unnecessary macro.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3099
2004-11-24 18:58:41 +00:00
Nicholas Nethercote
f35aa3afc8 Whoops, unbreak syscall number checking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3098
2004-11-24 18:31:40 +00:00
Nicholas Nethercote
9680327dd9 Cleanups:
- move things around so that each arch doesn't duplicate stuff to do with
  VG_(do_thread_syscall)().
- enum PXState doesn't need to be visible outside vg_proxylwp.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3097
2004-11-24 18:14:41 +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
398ce0c269 Cleanups, mostly for the baseBlock removal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3095
2004-11-24 16:43:43 +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