2653 Commits

Author SHA1 Message Date
Nicholas Nethercote
fe21329e16 Renamed and retyped the fields relating to valgrind's stack in os_state_t to
make their role clearer and their behaviour more consistent with the fields
describing the client's stack.  Also made the code in x86-linux/syscalls.c
and amd64-linux/syscalls.c more word-size-independent, which is not strictly
necessary but makes the code similarities between the two files more
obvious.

One consequence of this is that Valgrind's stack on AMD64 is now 16384 * 8
bytes, rather than 16384 * 4 bytes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3520
2005-04-05 02:49:09 +00:00
Tom Hughes
eaea598d41 Removed references to client_stack_base which no longer exists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3519
2005-04-04 07:15:04 +00:00
Nicholas Nethercote
fa9e1310ce Remove the x86-specific is_valid_data_size() test. Also, make any dataSize
greater than MIN_LINE_SIZE equal to MIN_LINE_SIZE.  This makes the
x86/fpu-28-108 regression test pass.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3518
2005-04-04 02:52:16 +00:00
Nicholas Nethercote
2f21dcf1fa 64-bit cleanness -- use UWord instead of UInt.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3517
2005-04-04 02:48:32 +00:00
Nicholas Nethercote
c8f3476758 minor cleanup with the stack-related fields in ThreadState:
- removed "stack_base" which wasn't used in any meaningful way
- added "client_" prefix to make it clear they concern the client's stack
- renamed "stack_size" as "client_stack_szB" to make the units clear



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3516
2005-04-04 02:41:42 +00:00
Julian Seward
6645b8bee9 Deal with apparently non-cfront compliant new[]/delete[] manglings
generated by the Portland Group's C++ compiler.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3515
2005-04-03 20:04:52 +00:00
Nicholas Nethercote
0e1afb5abc gen_intercepts.pl doesn't exist any more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3514
2005-04-03 03:11:27 +00:00
Julian Seward
26abbc7615 Update expected outputs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3513
2005-04-03 00:16:11 +00:00
Julian Seward
0e735dde57 In vg_memory.c, allow the stack-change threshold to be specified by a
command-line flag (--max-stackframe=number), rather than hardwiring it
to 2000000.  This is helpful for dealing with unruly Fortran programs
which want to allocate large arrays on the stack.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3512
2005-04-02 23:40:59 +00:00
Tom Hughes
577fc708f5 More amd64 system calls - emacs will now run under valgrind.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3511
2005-04-02 17:43:50 +00:00
Julian Seward
1a2c48a114 A major overhaul of how malloc/free intercepts are done. The general
idea is the same -- write functions with special names encoding
sonames and fn names, and have the redir mechanism notice them.
However the way the functions are generated is significantly changed:

* The name mangling scheme has been replaced with one which is just about
  simple enough not to need a preprocessing phase.  Hence
  vg_replace_malloc.c.base is replaced by vg_replace_malloc.c, and
  the preprocessor disappears.  The demangler in vg_symtab2.c changes
  accordingly.

* Kill off the horrendous LIBALIAS macro.  In return we have to
  enumerate all the redirections longhand, but this is not a big deal.

* Remove use of the GNUisms "attribute alias" and "attribute
  protected".

* Remove the hardwired assumption that any C++ new/new[]/etc symbols
  we might want to intercept are mangled in GNU style.

* Add more comments.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3510
2005-04-02 17:38:59 +00:00
Tom Hughes
738816fc3c Get cache detection going again on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3509
2005-04-02 17:30:19 +00:00
Tom Hughes
6f730dd6da Make cache detection work on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3508
2005-04-02 17:26:07 +00:00
Tom Hughes
7f5a0ed772 Remove vg_instrument.c from the makefile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3507
2005-04-02 17:25:34 +00:00
Julian Seward
54279266b4 Get rid of apparently-redundant file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3506
2005-04-02 17:16:25 +00:00
Tom Hughes
9ba2c09188 Assert that cpuid is available - this is just done to force the
code from cpuid.S to be pulled in so that tools can use it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3505
2005-04-02 17:01:52 +00:00
Tom Hughes
488b74dad3 Get VG_(has_cpuid) and VG_(cpuid) working on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3504
2005-04-02 17:01:07 +00:00
Tom Hughes
8ab17244a8 Add VGP_(setup_redirects) to the platform specific layers and use
it to setup vsyscall redirects on amd64 and the _dl_sysinfo_int80
redirect on x86.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3503
2005-04-02 15:53:01 +00:00
Tom Hughes
1f84a3f9ad It seems deref_UInt is fine - socklen_t is a 32 bit value on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3502
2005-04-02 15:04:15 +00:00
Tom Hughes
43c5476c8c Don't truncate symbol values in ELF symbol tables.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3501
2005-04-02 14:57:43 +00:00
Tom Hughes
1402d02a6e Remove a coupld of entries that have been dealt with.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3500
2005-04-02 14:46:54 +00:00
Tom Hughes
938b22c9c2 Even more amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3499
2005-04-02 11:39:56 +00:00
Tom Hughes
6f26888fd7 Yet more amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3498
2005-04-01 23:38:37 +00:00
Tom Hughes
e29c8a9ebd More amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3497
2005-04-01 23:22:36 +00:00
Julian Seward
94ee81b0b9 Add a missing case. I guess it can't have been wildly popular :-)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3496
2005-04-01 20:20:12 +00:00
Tom Hughes
446ea57895 Rework the vsyscall redirections to work in pie code - the old form
seemed to completely confuse the compiler and it was generating
nonsense code to get the address of the replacement routines.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3495
2005-04-01 18:58:09 +00:00
Tom Hughes
aef0e2326c Run "make all" before "make install" as older versions of automake
don't put a dependency between the install target and $(BUILT_SOURCES)
so doing a straight install doesn't work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3494
2005-04-01 08:07:54 +00:00
Tom Hughes
61ca56765a Move the gettid system call to the linux specific section.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3493
2005-03-31 16:02:07 +00:00
Julian Seward
6109ce1fb4 Increase maximum translation size. This can happen when translating
long sequences of x86 insns with IR optimisation disabled, so the
tag-checking crap doesn't get knocked out like it usually does.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3492
2005-03-31 15:48:57 +00:00
Tom Hughes
88222c8e7c Rework the nightly build script to stop as soon as one of the build
steps fails instead of carrying on with the other steps - this should
help ensure that the log fragment sent out contains useful information.

A second change is to ensure that if the regression tests complete
then the full results are included in the email - if they don't
complete then just the last 20 lines of output are sent as before.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3491
2005-03-31 10:19:59 +00:00
Tom Hughes
21d1184fb7 Implement the gettid system call which seems to have got lost in the merge.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3490
2005-03-31 09:09:07 +00:00
Tom Hughes
578b319a41 Update helgrind to use the new mechanism to declare it's interface
routines to the core so that it will at least build.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3489
2005-03-31 07:59:35 +00:00
Nicholas Nethercote
3075ee0682 Rename VG_(tool_interface), which is overly general and a bit verbose, as
VG_(tdict).  Also make the typing more meaningful in vg_mallocfuncs_info.
And (barely) start removing the use of "TL_" names in the core.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3488
2005-03-31 04:52:26 +00:00
Nicholas Nethercote
f1f707c7b2 This change reduces the number of calls to dlsym() when loading tools from a
lot to one.  This required two basic changes.

1. Tools are responsible for telling the tool about any functions they
provide that the tool may call.  This includes basic functions like
TL_(instrument)(), functions that assist core services such as
TL_(pp_Error)(), and malloc-replacement-related functions like
TL_(malloc)().  

2. Tools that replace malloc now specify the size of the heap block redzones
through an arg to the VG_(malloc_funcs)() function, rather than with a
variable VG_(vg_malloc_redzone_szB).

One consequence of these changes is that VG_(tool_init_dlsym)() no longer
needs to be generated by gen_toolint.pl.

There are a number of further improvements that could follow on from this one.
- Avoid the confusingly different definitions of the TL_() macro in the
  core vs. for tools.  Indeed, the functions provided by the tools now don't
  need to use the TL_() macro at all, as they can have arbitrary names.
- Remove a lot of the auto-generated stuff in vg_toolint.c and vg_toolint.h
  (indeed, it might be possible to not auto-generate these at all, which
  would be nice).
- The handling of VgToolInterface is currently split across vg_needs.c and
  vg_toolint.c, which isn't nice.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3487
2005-03-31 04:37:24 +00:00
Tom Hughes
b03faae5f5 Make the dispatcher code position independent so that PIE mode works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3486
2005-03-30 23:36:28 +00:00
Julian Seward
ff71ced87a Comment-only change
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3485
2005-03-30 19:31:18 +00:00
Julian Seward
1a4748ff32 Completely get rid of VG_(instr_ptr_offset).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3484
2005-03-30 19:04:29 +00:00
Julian Seward
25bad06ca3 Get rid of the use of VG_(instr_ptr_offset) since we know what that is
at system-build time: OFFSET_amd64_RIP.  This saves an instruction on
the fast path, and reduces the number of PIE-difficulties by one.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3483
2005-03-30 18:42:59 +00:00
Julian Seward
5bf0015052 rm unused function
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3482
2005-03-30 18:26:52 +00:00
Tom Hughes
cd18564979 Get thew DWARF reading going on 64 bit machines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3481
2005-03-30 15:05:46 +00:00
Tom Hughes
6eccce80ba Discard the sys_socketcall wrapper (there is no socketcall system
call on amd64) and add a proper sys_socket wrapper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3480
2005-03-30 08:22:38 +00:00
Nicholas Nethercote
4295fad962 Reinstate Helgrind, to an extent: compile it, so that it doesn't bit-rot.
But don't regtest it, because they all just fail.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3479
2005-03-30 04:13:56 +00:00
Tom Hughes
9c1e938286 Fixed ROUNDDN to avoid truncating the result when the first argument
doesn't fit in 32 bits and the second one does.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3478
2005-03-29 12:16:10 +00:00
Tom Hughes
1de0d47116 Build the arch and platform libraries as PIE code when appropriate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3477
2005-03-29 10:03:04 +00:00
Tom Hughes
ea0a6d77f5 Revive VG_(cpuid) which had been commented out during the merge and
add VG_(has_cpuid) as well. These are then used in place of the inline
assembly in state.c as the compiler was having trouble allocating the
required registers when building in PIE mode.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3476
2005-03-29 09:53:47 +00:00
Tom Hughes
f67c9b8ef0 Rework inline assembly to avoid requiring specific registers as they
may not always be available, especially in PIE builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3475
2005-03-29 09:52:21 +00:00
Tom Hughes
244a4aa560 Avoid truncating addresses returned from mmap on 64 bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3474
2005-03-29 09:00:37 +00:00
Tom Hughes
7beebdd5b9 Avoid truncating addresses in debugging message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3473
2005-03-29 09:00:12 +00:00
Tom Hughes
ba4f330105 Build the arch, os and platform libraries as PIE code if PIE is
enabled as they get linked into stage2 which is the PIE part.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3472
2005-03-29 08:09:31 +00:00
Tom Hughes
c34ba5aa3b Fix overnight build script to use subversion to get the source and
to handle needing to checkout and build vex before valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3471
2005-03-29 07:54:30 +00:00