305 Commits

Author SHA1 Message Date
Nicholas Nethercote
0eec4e6ae2 Undo the awful Leak Error type-abuse.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3754
2005-05-17 04:00:11 +00:00
Nicholas Nethercote
26afa60bf2 Update website address.
MERGE TO 2.4 REPOSITORY



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3753
2005-05-17 03:22:38 +00:00
Nicholas Nethercote
937a49ea05 Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751
2005-05-16 23:31:24 +00:00
Nicholas Nethercote
df94111968 Removed the core_arch_asm.h files. The OYNK macros now live in tool_asm.h,
at least for the moment.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3748
2005-05-16 21:30:24 +00:00
Nicholas Nethercote
586e79e4bd core.h: remove some #include lines, move some others to more localised
places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3745
2005-05-16 20:40:51 +00:00
Nicholas Nethercote
816419fa9a No need to generate valgrind.h from valgrind.h.in. We can just use the
compiler symbols rather than our own symbols for the architectures (we
already were, more or less).  This simplifies the build, hurrah!

I also inverted the sense of the NVALGRIND ifdefs, to make them easier to
read, and fixed up some comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3739
2005-05-16 13:31:23 +00:00
Nicholas Nethercote
5f3248aeb3 Complete restructuring of include/ directory -- I forgot about the ARM
stuff.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3734
2005-05-16 03:36:19 +00:00
Nicholas Nethercote
8c63e060a7 Restructured the include/ directory.
- All the subdirectories have gone: arm/, x86/, amd64/, linux/,         
  x86-linux/, amd64-linux/, arm-linux/.

- The following files were moved out of those directories into include/:

    amd64-linux/vki_arch.h            --> vki-amd64-linux.h
    x86-linux/vki_arch.h              --> vki-x86-linux.h
    x86-linux/vki_arch_posixtypes.h   --> vki_posixtypes-x86-linux.h
    linux/vki.h                       --> vki-linux.h
    amd64-linux/vki_arch_posixtypes.h --> vki_posixtypes-amd64-linux.h

- The following very small files were inlined into tool.h using the "#if
  defined(VGP_x86)..." technique:

    x86/tool_arch.h
    arm/tool_arch.h
    amd64/tool_arch.h

  The same technique was used twice to include the appropriate
  vki-$PLATFORM and vki-$OS files into tool.h.  

- The other files in those directories were removed.

- The build is much simpler, since we have 7(!) fewer Makefile.am files.
  Far fewer -I options are needed when compiling, too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3733
2005-05-16 03:25:12 +00:00
Nicholas Nethercote
92c61a5fd1 Don't mix backticks and apostrophes when quoting words -- eg. use 'foo'
rather than `foo', as www.cl.cam.ac.uk/~mgk25/ucs/quotes.html explains
we should (in more detail than you'd imagine was possible).  I did this
both in output messages and in some comments, for consistency.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3723
2005-05-15 17:28:26 +00:00
Nicholas Nethercote
357303aebf Modularised vg_hashtable.c as m_hashtable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3710
2005-05-14 21:28:43 +00:00
Nicholas Nethercote
0367213e2d Renamed the field Segment.symtab to Segment.seginfo to avoid confusion
with SegInfo.symtab.  

Also renamed VG_(symtab_{inc,dec}ref)() as VG_(seginfo_{inc,dec}ref)()
for the same reason.

Also renamed various SegInfo variables from "seg" to "si" to avoid
confusion with the many Segment variables called "seg".



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3709
2005-05-14 18:42:26 +00:00
Nicholas Nethercote
a5d1db8fc7 Use HChar for format strings to printf-like functions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3696
2005-05-13 21:49:30 +00:00
Julian Seward
dbdcd9034c Sudden attack of 64-bit paranoia: therefore stick even more (probably
pointless) casts in.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3688
2005-05-12 23:23:38 +00:00
Nicholas Nethercote
4cb3e8a7e4 Modularised vg_skiplist.c as m_skiplist.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3671
2005-05-12 04:37:27 +00:00
Nicholas Nethercote
a653c5da3c Cleaned up vg_messages.c and related printf stuff. vg_messages.c is now a
layer above the printf stuff in vg_mylibc.c, which is layered over
m_debuglog.  This makes the module interfaces neater, more consistent, and
cuts 40 lines of code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3670
2005-05-12 03:51:15 +00:00
Nicholas Nethercote
d7aa13765c Remove dead macro.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3664
2005-05-11 19:03:57 +00:00
Nicholas Nethercote
247e241160 Modularised the core/tool interface ('details', 'needs' and VG_(tdict))
into a new module m_tooliface.  Pretty straightforward.  Touches a lot
of files because many files use this interface and so need to include
the headers for the new module.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3652
2005-05-10 04:37:01 +00:00
Nicholas Nethercote
58d0178013 Add a comment explaining the recently changed behaviour of
RUNNING_ON_VALGRIND.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3651
2005-05-10 03:01:23 +00:00
Nicholas Nethercote
eb32bc7045 Modularised the malloc/free stuff into two modules: m_mallocfree for the
malloc/free implementation, and m_replacemalloc with the stuff for the tools
that replace malloc with their own version.  Previously these two areas of
functionality were mixed up somewhat.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3648
2005-05-10 02:47:21 +00:00
Nicholas Nethercote
a08662c48c Big clean-up: changed the core/tool interface to be mediated entirely
through the VG_(tdict) function dictionary, rather than using TL_(foo)
functions.

This facilitated the following changes:

- Removed the "TL_" prefix, which is no longer needed.

- Removed the auto-generated files vg_toolint.[ch], which were no longer
  needed, which simplifies the build a great deal.  Their (greatly
  streamlined) contents went into core.h and vg_needs.h (and will soon
  go into a new module defining the core/tool interface).  
  
  This also meant that tool.h.base reverted to tool.h (so no more
  accidentally editing tool.h and not having the changes go into the
  repo, hooray!)  And gen_toolint.pl was removed.  And toolfuncs.def was
  removed.

- Removed VG_(missing_tool_func)(), no longer used.

- Bumped the core/tool interface major version number to 8.  And I
  killed the minor version number, which was never used.  The layout
  of the ToolInfo struct is such that this should not cause problems.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3644
2005-05-09 01:02:08 +00:00
Nicholas Nethercote
89a26b8f71 Rename some _SIZE macros as _SZB to make their units clear. This change is
in response to a mixed-units (bytes and words) error we had involving
VGA_STACK_REDZONE_SIZE (which is now VGA_STACK_REDZONE_SZB).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3639
2005-05-08 17:49:37 +00:00
Nicholas Nethercote
63901a5d88 Put all the system call stuff in a new module, m_syscalls. This
required moving a lot of stuff around.  I deleted
VG_(set_return_from_syscall_shadow)() and VG_(get_exit_status_shadow)(),
which screwed up the modularity and weren't being used and can be
simulated in other ways with a bit of care.

What are the chances that I've added and moved all the files correctly
in this commit, and not broken the amd64 port?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3636
2005-05-08 14:45:13 +00:00
Nicholas Nethercote
a9c13f8c5c Remove dead function VG_(exit_single)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3633
2005-05-08 02:13:47 +00:00
Nicholas Nethercote
fe432113e6 A crucial, crucial change: update my email address.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3632
2005-05-08 02:10:27 +00:00
Julian Seward
628f8fbd1b gcc-3.3.3 is fooled by strings like "linux/include/asm-i386/*.h"; it
thinks it is seeing a comment within a comment, and complains.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3598
2005-05-02 17:11:58 +00:00
Nicholas Nethercote
bb0ff0ee26 Correct header comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3597
2005-05-02 13:24:14 +00:00
Julian Seward
5496e4553b Add macro definitions that make it possible to do cpu/os/both
ifdeffery in a sane way where it's absolutely unavoidable.  When
building the core, eg on amd64-linux, the following preprocessor
symbols are defined:

   VGA_amd64
   VGO_linux
   VGP_amd64_linux

etc on other platforms.

Also, include/basic_types.h now defines VG_WORDSIZE and this is what
should be used for ifdefs that need to know the host word size.

ifdefs based on the C compilers built-ins such as __amd64__ etc
are deprecated and will be done away with.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3590
2005-05-02 10:25:34 +00:00
Julian Seward
487756039c Add a new module: the debug-logger. For a while now, we've used the
same logging mechanism to emit both end-user messages and debugging-
valgrind-itself messages.  This commit creates a new mechanism for the
latter purpose.

The main feature of m_debuglog is that it has zero dependencies on any
other module and therefore can safely operate all the way through
stage1 and stage2 startup.  It is restricted to emitting debug info on
file descriptor 2 (stderr), but that's not a big deal.

As a result of this change the basic formatted-print routines
(vprintf) have been moved from vg_mylibc.c into m_debuglog, so that
m_debuglog remains standalone.

The %y format string is currently disabled, since supporting it ("show
symbol corresponding to this address") would create a dependency from
m_debuglog to the entire debug-info reading machinery and all the
stuff that depends on, thereby making a nonsense of m_debuglog being
standalone.  Its omission does not seem to cause any regression tests
to fail, though.

The debug logger is activated with "-d".  More "-d"s make it more
verbose.

m_debuglog.o is linked into both stage1 and stage2, but as it is
completely standalone this causes no particular problems.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3559
2005-04-25 01:36:56 +00:00
Julian Seward
d82491f9da Update comment about stack management, and remove some unused
functions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3552
2005-04-24 11:05:55 +00:00
Julian Seward
2c4c0c38f6 Allow memcheck to take account of VGA_STACK_REDZONE_SIZE -- that is,
account for the fact that on amd64 (really, on amd64-linux) the area
up to 128 bytes below the stack pointer is accessible.  This meant
moving the definitions of VGA_STACK_REDZONE_SIZE to tool-visible
places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3546
2005-04-23 22:42:27 +00:00
Nicholas Nethercote
5446180661 Renamed vg_errcontext.c as errormgr.c, and carved off the relevant parts of
core.h and tool.h into pub_core_errormgr.h and pub_tool_errormgr.h.  All
just to improve general modularity.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3532
2005-04-19 04:10:25 +00:00
Nicholas Nethercote
9aecfe0d13 Added new assert macros vg_assert2 and tl_assert2 which allow you to print a
string explaining more detail if the assertion fails (eg. the value of the
bogus variable) using printf-style format arguments.

One consequence of this is that you can do something like
 
  vg_assert2(0, "bad bad bad");

instead of calling VG_(core_panic).  The advantage of the new approach is
that it shows the file/function/line info for the failing code, whereas
VG_(core_panic)() does not.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3528
2005-04-08 23:28:23 +00:00
Julian Seward
394ef03a88 Get rid of the --sloppy-malloc= flag and the functionality it
controlled (rounding user malloc requests up to a multiple of 4).
Subsequent changes to memcheck made it more or less pointless, it is a
time waster in the malloc/free path, and nobody ever used it AFAIK.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3522
2005-04-05 20:59:55 +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
Nicholas Nethercote
7f22267612 VG_(get_memory_from_mmap_for_client)() need not be tool-visible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3463
2005-03-27 03:48:13 +00:00
Nicholas Nethercote
68647c085d VG_(bbs_done) doesn't need to be tool-visible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3461
2005-03-27 03:17:52 +00:00
Nicholas Nethercote
f912a81248 Add VGA_ prefix to the arch-specific macros {MIN,MAX}_INSTR_SIZE and
REGPARMS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3458
2005-03-27 01:55:21 +00:00
Nicholas Nethercote
36e86a9542 Add VG_ prefix to SKIPLIST_INIT and IS_*_ALIGNED macros. Also pull
IS_PAGE_ALIGNED into tool.h with the others.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3457
2005-03-27 01:42:41 +00:00
Nicholas Nethercote
b3d26947f4 Remove dead macros 'mycat' and 'mycat_wrk'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3455
2005-03-27 01:27:17 +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
203b7b6638 Add missing declaration.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3448
2005-03-26 20:03:07 +00:00
Nicholas Nethercote
b08a041b56 Use "VGO_" prefix for various OS-specific exports.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3437
2005-03-26 02:57:36 +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
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
43e6c44681 Various amd64 syscall improvements (Tom Hughes)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3425
2005-03-24 17:52:02 +00:00
Julian Seward
c0107bd421 Sort out amd64 issues.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3413
2005-03-23 13:10:32 +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
f94393fec0 This commit partly cleans up and modularises ExeContext usage. It doesn't
look like that much, but it's a good first step;  there's more to come.

- vg_errcontext.c:gen_suppressions() and vg_symtab2.c:VG_(mini_stack_dump)()
  had very similar stack-trace-traversing loops.  I factored these out into
  the higher-order function VG_(apply_ExeContext)().  I put this into
  vg_execontext.c, which is the obvious spot.  This is good because before
  this change we had two functions, neither in vg_execontext.c, which were
  crawling all over ExeContexts -- they shouldn't have to do that.
  
- Removed VG_(mini_stack_dump)(), which was almost identical to
  VG_(pp_ExeContext)().

- Removed dead function VG_(get_EIP_from_ExeContext)().

- Replaced a call to VG_(get_ExeContext2)() with the simpler
  VG_(get_ExeContext)() in vg_scheduler.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3394
2005-03-20 23:45:36 +00:00