Commit Graph

300 Commits

Author SHA1 Message Date
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
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
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
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
Nicholas Nethercote
e2e1d2f896 Merge STR and VG__STRING macros into one, VG_STRINGIFY. Also, in
valgrind-listener.c, don't use the VG_ prefix on its equivalent, because
it's a local definition.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3454
2005-03-27 01:25:38 +00:00
Nicholas Nethercote
8aac9bd8a7 Make the 'arg' parameter to VG_BOOL_CLO and similar macros explicit, rather
than implicit.  Also tweak some formatting of command-line arg code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3453
2005-03-27 01:00:11 +00:00
Nicholas Nethercote
f0232e8c01 Remove some old CLOs that were hanging around for backward compatibility.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3452
2005-03-27 00:44:31 +00:00
Nicholas Nethercote
ce81b52a84 Make our VG_(isspace)() match libc's isspace(). And remove ISSPACE and
VG_ISSPACE, replacing them with calls to VG_(isspace)().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3439
2005-03-26 04:14:01 +00:00
Nicholas Nethercote
27066dbfc5 Don't use the VGP_ for profiling any more, just use VG_ -- we want to use
VGP_ for platform-specific things.  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3435
2005-03-26 00:42:02 +00:00
Nicholas Nethercote
cb6c8b4bd2 Use "VGA_" prefix more consistently for arch-specific things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3433
2005-03-26 00:18:45 +00:00
Nicholas Nethercote
0f0863110d Rename some arch-specific macros to use the more consistent "VGA_" prefix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3432
2005-03-26 00:04:03 +00:00
Nicholas Nethercote
f474d2e51a A modularisation + refactoring commit. vg_execontext.c has been split into
two halves: stacktrace.c, which deals with getting, traversing and printing
stack traces;  and execontext.c, which deals with storing stack traces
permanently in a way that avoids duplicates, and comparing them.

One nice outcome:  previously we were often creating ExeContexts, which live
forever, even when they were only needed temporarily.  Ie. this was a memory
leak, which has been removed.

As part of this, new headers have been created, carved off core.h and
tool.h.  Lots of function names have changed, too.

In Massif, I also changed a lot of "eip" names to "ip" to make them less
x86-specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3429
2005-03-25 23:35:48 +00:00
Julian Seward
8366aee7e1 64-bit cleanness fix for command-line printing
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3409
2005-03-23 03:06:30 +00:00
Nicholas Nethercote
e65bcc8d43 make function names more uniform
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3406
2005-03-22 04:02:43 +00:00
Nicholas Nethercote
91f14c659b Move VG_(get_EIP)() out of vg_execontext.c, where it doesn't belong, into
vg_main.c, where it doesn't also really belong but at least it's now next to
VG_(get_stack_pointer)() which is very similar.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3395
2005-03-21 00:01:36 +00:00
Julian Seward
b7761ebdb4 Don't show VEX emulation warnings by default; they are just too tiresome.
If you want to see them, use --show-emwarns=yes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3387
2005-03-19 15:12:21 +00:00
Julian Seward
25b4f203c2 Oops. The code redir subsystem would work better if it actually got
initialised.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3347
2005-03-13 18:57:15 +00:00
Nicholas Nethercote
f7cf78c703 Remove some dead macros.
Move others that are only used in one file, out of core.h into that file.
Remove the "VG_" prefixes while doing it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3337
2005-03-13 06:26:22 +00:00
Nicholas Nethercote
1aae2d2ef4 Use Vg_DebugMsg for all the things printed with -v, rather than Vg_UserMsg.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3330
2005-03-13 05:43:23 +00:00
Nicholas Nethercote
9f0cd67b21 Move the ExeContext stats message earlier, and print it when verbosity == 2,
rather than only when verbosity == 3, as they're only three lines.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3329
2005-03-13 05:38:25 +00:00
Nicholas Nethercote
bfa6142ae6 BUGFIX: process_cmd_line_options mangles options with the syntax
--TOOLNAME:option=foo.  If you use --trace-children=yes, the child
Valgrinds are passed the mangled options and fail as a result.

This patch makes sure that process_cmd_line_options makes a copy of
the option before mangling it.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3318
2005-03-12 21:20:39 +00:00
Nicholas Nethercote
5a3535ea87 --num-callers default is now 12, so say that in the help.
Fix cmdline tests for match new --num-callers stuff.

MERGED FROM CVS HEAD



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3315
2005-03-12 20:59:29 +00:00
Nicholas Nethercote
fc984f6a56 Update version to 3.0.0.CVS. Also change startup message to use this
version number again, rather than "SVN >= xxx".



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3306
2005-03-12 16:54:07 +00:00
Nicholas Nethercote
05fe123a9e Update copyright notice for 2005 on all relevant files. Don't bother trying
to be selective about it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3303
2005-03-12 16:22:54 +00:00
Julian Seward
e60e34d51c Add missing comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3300
2005-03-12 15:16:07 +00:00
Julian Seward
493ecf52a4 Get rid of dead code and/or localise global functions as needed to
avoid warnings from -fwarn-missing-prototypes.  vg_replace_malloc.c
has not been done yet though.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3298
2005-03-12 13:32:06 +00:00
Nicholas Nethercote
0384583ee1 Fix Nulgrind's filter_stderr, and also fix the none/tests/cmdline2 test
(required fixing the usage msg slightly).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3278
2005-03-11 04:57:30 +00:00
Julian Seward
0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
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
2005-03-10 23:59:00 +00:00
Julian Seward
243713971c Minimal, horrible hacks needed to make vsyscalls work on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3259
2005-03-02 14:06:08 +00:00
Julian Seward
f122d86dc0 Further cleanups to low-level memory management. It's still a
conceptual mess and needs a redesign, but this is a start.  Most stuff
now works again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3247
2005-02-18 08:28:32 +00:00
Julian Seward
2e98ffac01 Debug printing at startup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3237
2005-02-13 10:55:47 +00:00
Julian Seward
bb0c8347a1 Make --wait-for-gdb sort-of usable on amd64. I don't know why this
works on x86 -- and I can't make any analogous version work on amd64.
Hence return to a delay loop for the time being.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3231
2005-02-06 14:10:40 +00:00
Julian Seward
f224865e9e Fix enough stuff so it will start up and run for a few bbs on amd64,
before dying.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3230
2005-02-05 18:27:14 +00:00
Julian Seward
efcf1e61ec Complete rewrite (I think this is the 4th incarnation) of translation
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
2005-01-19 11:55:34 +00:00
Julian Seward
d19f789514 Track VEX API changes introduced in Vex rev 718.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3225
2005-01-17 18:35:30 +00:00
Julian Seward
9b03779a20 Implement --log-file-exactly= for when the user wants to specify
*exactly* the log file name.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3220
2005-01-11 14:01:02 +00:00
Julian Seward
6c9a668a42 Add a new variant for --gen-suppressions: --gen-suppressions=all,
which just prints a suppression for all reported errors without asking
questions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3219
2005-01-10 17:24:47 +00:00
Julian Seward
002e27808f Make the Quadrics Elan3 clone-hack be controllable by a command-line
flag.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3216
2005-01-06 16:13:40 +00:00
Julian Seward
696460f884 Error message cosmetics.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3214
2004-12-31 18:10:17 +00:00
Julian Seward
92896c91a1 Add Valgrind-side support for subarchitecture descriptions, which are
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
2004-12-21 01:20:49 +00:00
Julian Seward
00fab1f97d Use new function LibVEX_Version.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3208
2004-12-20 04:38:31 +00:00
Julian Seward
cde876c63e Update version numbers by hand. Duh. ToDo: automatically
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3207
2004-12-17 19:18:02 +00:00
Julian Seward
9a79ebb15b Bump startup notices around a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3196
2004-12-13 18:30:39 +00:00
Julian Seward
dfd443a0c4 Ensure VEX control parameters are sane.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3183
2004-12-06 14:24:52 +00:00
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
b4421b93e7 Implemented the dispatch loop for AMD64. Works at least enough to do
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
2004-11-30 23:32:01 +00:00
Julian Seward
0b85c33cda New debugging flag --trace-notbelow=<number>, to stop --trace-codegen=
spewing out tons of unwanted stuff before some desired point.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3169
2004-11-30 18:55:21 +00:00
Nicholas Nethercote
c4b75e59c9 Move VG_(have_ssestate) out of core and into coregrind/x86/.
Also fixed up out-of-date comments for run_innerloop.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3167
2004-11-30 17:27:21 +00:00
Nicholas Nethercote
287eca27b9 More AMD64 start-up hurdles:
- Fix bogus assertion in vg_transtab.c
- Do null implementation of --pointercheck

We now reach the dispatch loop!



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3166
2004-11-30 16:50:48 +00:00
Nicholas Nethercote
ad1bf0073e Clear a few more AMD64 start-up hurdles:
- 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
2004-11-30 16:04:58 +00:00