12 Commits

Author SHA1 Message Date
Julian Seward
b2250a1adf Consistently call init() before doing any MALLOC_TRACE, since the
latter depends on function pointers obtained by the former.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5550
2006-01-19 03:35:37 +00:00
Julian Seward
f9a9e03c7a Merge in function wrapping support from the FNWRAP branch. That
branch hereby becomes inactive.  This currently breaks everything
except x86; fixes for amd64/ppc32 to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5520
2006-01-12 12:32:32 +00:00
Nicholas Nethercote
e1a645cce6 Renamed coregrind.h to pub_core_clreq.h and introduced pub_tool_clreq.h to
be consistent with the module naming scheme.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5398
2005-12-21 20:22:52 +00:00
Tom Hughes
014fc8c051 Use an soname of libc.so* for libc redirects so that we catch a wider
range of libc's such as uclibc as well as glibc. Fixes bug 114289.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4916
2005-10-13 15:51:12 +00:00
Nicholas Nethercote
d2d79a668a Partial implementation of mallinfo(). It still puts zero in all
the fields, but all the plumbing is now there so that m_mallocfree.c
can fill them in.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4441
2005-08-17 05:01:37 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
c5a38c663b Created coregrind.h, a counterpart to valgrind.h containing the internal
client requests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3927
2005-06-18 02:18:04 +00:00
Nicholas Nethercote
3ae4d1a0ab A cleanup of the redirection stuff.
- Renamed VG_INTERCEPT as VG_REPLACE_FUNCTION to make its purpose
  clearer.

- Renamed VG_WRAPPER as VG_NOTIFY_ON_LOAD to make its purpose cleare.
  Started calling that stuff "load notification".

- Moved various things into m_redir.c, a much more sensible place for
  them.  This reduced the number of exported functions overall.  Renamed
  intercept_demangle() as Z_decode() as part of this.

- Improved the documentation of this stuff, especially in
  pub_core_redir.c.

- Got --run-libc-freeres=yes working again.  It was doing nothing.

- Renamed vg_inject.so as vg_preload_core.so to match
  vg_preload_<tool>.so

- Renamed vg_intercept.c as vg_preloaded.c.  (I kept the "vg_" prefix
  because this filename can appear in stack traces, so the "vg_" is a
  useful hint for users that it belongs to Valgrind.)

- Removed all the Memcheck-specific calls to add_redirect_sym_to_sym()
  from VG_(setup_redirect_table)(), instead using VG_REPLACE_FUNCTION in
  mac_replace_strmem.c, just like vg_replace_malloc.c.  This is the
  right way to do it.  This required moving some of
  coregrind/pub_core_redir.h into the newly added
  include/pub_tool_redir.h.  add_redirect_sym_to_sym() is no longer
  used...

- Now only handing off symbols to m_redir for inspection/decoding after
  they have been deemed to be interesting by the symbol table reader.

- Factored out commonality between the add_redirect_*_to_* functions
  into add_redirect_X_to_X().

- Added "Zh", meaning '-' ('h' for "hyphen"), to the Z-decoding scheme,
  to handle sonames like "ld-linux-x86-64.so.2".

- Added a FAQ explaining the newly found issue of glibc aliasing 
  sometimes causing the wrong function name to appear in stack traces.

- Added a new regtest strchr.c.  It's possible this will fail on some
  platforms.  If so, an alternative output file can be provided, but
  I'd like to see it in practice first.

It's possible that there will be minor breakage on other
platforms/setups, but it should be minimal and easily fixable.

Plus some ordinary cleanups in symtab.c:

- Removed the old optimisation from VG_(addStr)() whereby it kept track
  of the previous 5 added strings and avoiding duplicating any of them.
  Turns out it was barely having any effect any more, and just
  complicated things.

- Made read_symtab() more readable, by introducing a new variable
  "sym_name" and introducing the auxiliary function
  is_symbol_interesting().

- renamed the module variable 'segInfo' as 'segInfo_list' to make it
  more obvious it's a module variable and not just some ordinary local
  variable (which was an easy mistake to make).

-----------------------------------------------------------------------------

XXX: [later] remove add_redirect_sym_to_sym, and everything related to
     X_to_sym?  (ie. only need X_to_addr)

XXX: better function names?  all those 'resolved' names...
     [later...]




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3916
2005-06-16 03:56:58 +00:00
Nicholas Nethercote
ea46df465c Remove the hard-coding of "_vgi_" as the intercept prefix in
vg_replace_malloc.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3882
2005-06-11 03:28:48 +00:00
Nicholas Nethercote
38d2799b5b Having moved VG_(arena_strdup)() out of core.h, core.h no longer
needs to #include pub_core_mallocfree.h.  As a result, we need
to #include it explicitly everywhere else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3881
2005-06-11 01:31:52 +00:00
Nicholas Nethercote
bdd2546a12 Move declaration of "struct vg_mallocfunc_info" from core.h into
pub_core_replacemalloc.h, to reduce its exposure.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3662
2005-05-11 18:51:53 +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