Commit Graph

3089 Commits

Author SHA1 Message Date
Nicholas Nethercote
577e69aafd Fix up the libc_freeres_wrapper code so that m_main depends on m_redir,
not the other way around.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3956
2005-06-19 18:58:03 +00:00
Nicholas Nethercote
e260572784 Move VG_(sanity_check_general) out of m_main.c into scheduler.c.
Removes the dependence of m_scheduler/ on m_main.c;  reduces the 
dependence of m_signals.c on m_main.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3955
2005-06-19 18:49:19 +00:00
Nicholas Nethercote
62fa883300 Move VG_(bbs_done) out of main and make it local in scheduler.c. This
removes the dependence of m_translate.c and m_libcassert.c on m_main.c.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3954
2005-06-19 18:38:24 +00:00
Robert Walsh
5a9e619817 Fix AMD64 build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3953
2005-06-19 17:52:41 +00:00
Julian Seward
a7d31aa20e Get rid of the ELFSZ define, which is created at the configure stage
and use VG_WORDSIZE, as that is used everywhere else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3952
2005-06-19 16:14:06 +00:00
Nicholas Nethercote
31c2215413 Removed dependency on <sys/mman.h> by using our own versions of
mmap/munmap.  Required making VG_(munmap_native) public.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3951
2005-06-19 16:10:47 +00:00
Nicholas Nethercote
33acb88c87 Add a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3950
2005-06-19 16:07:49 +00:00
Julian Seward
77da2562b8 Un-break the build on SuSE 9.1 (x86). It seems that something in
<fcntl.h> messes up stuff acquired indirectly from vki-x86-linux.h.
This fix is therefore a kludge; it merely puts our defines ahead of
the glibc ones.  The right solution is to entirely remove the glibc
dependency.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3949
2005-06-19 15:58:33 +00:00
Nicholas Nethercote
cbc13040fb Don't #include <sys/stat.h>, which was causing problems due to
it redefining certain names which clashed with field names in vki*.h.
There are plenty more glibc-isms that can be removed from m_main.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3948
2005-06-19 15:46:27 +00:00
Nicholas Nethercote
d15cb4af4e Fixed a bug in .valgrindrc reading I introduced recently -- freeing memory
I should not have.

Added a regression test for it.

MERGE TO 2.4 REPOSITORY


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3947
2005-06-19 15:34:59 +00:00
Nicholas Nethercote
b2f4f4cba0 Get "make dist" closer to working again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3946
2005-06-19 05:43:21 +00:00
Nicholas Nethercote
acd3f7169e In m_redir.c, no longer need to handle the case of redirection to
a symbol -- we always redirect to a specific address.  This simplifies
things a bit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3945
2005-06-19 05:14:03 +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
Robert Walsh
d9cbc3ffec Fix x86_64 build.
Also fix vgtest_ume (although it fails on x86_64.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3943
2005-06-18 18:58:14 +00:00
Nicholas Nethercote
0a3457c592 Add some missing "_H" suffixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3942
2005-06-18 18:49:40 +00:00
Nicholas Nethercote
a3cbc0960e Add some svn:ignore entries.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3941
2005-06-18 18:44:33 +00:00
Nicholas Nethercote
f4871f2c72 Move CPUID functions into their own module, m_cpuid.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3940
2005-06-18 18:31:26 +00:00
Nicholas Nethercote
a0a6af2854 Make the stage2.lds building platform-independent by not trying to match
an exact address (idea from Paul Mackerras' PPC port).  Thus it could be
moved into coregrind/Makefile.am.

Let me know if this breaks anything on other platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3939
2005-06-18 16:41:30 +00:00
Nicholas Nethercote
6404b199cb Moved call_on_new_stack_0_1 and jump_and_switch_stacks to better places.
This enabled the removal of $ARCH/jmp_with_stack.c, hurrah!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3938
2005-06-18 15:54:25 +00:00
Nicholas Nethercote
f478d7edd2 Move VG_(set_fault_catcher) out of tool.h. Had to create a
pub_tool_signals.h for this which I didn't want to, but I couldn't
see how else to do it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3937
2005-06-18 15:18:15 +00:00
Nicholas Nethercote
25fae61848 Replace use of __amd64__ with VGA_amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3936
2005-06-18 15:09:28 +00:00
Nicholas Nethercote
5235a32498 Minor rearrangement, no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3935
2005-06-18 15:07:39 +00:00
Tom Hughes
7c81be39dd Make do_syscall_WRK take UWord arguments and return UWord results to
avoid inappropriate truncations on 64 bit systems. Also make it static
as it is not used anywhere else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3934
2005-06-18 11:58:18 +00:00
Tom Hughes
ef523c9682 Export amd64 specific trampline offsets.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3933
2005-06-18 11:37:01 +00:00
Nicholas Nethercote
2c4e465cf7 Move VG_CLO_DEFAULT_LOGPORT to a better spot.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3932
2005-06-18 04:13:54 +00:00
Nicholas Nethercote
1279058c7c Renamed tool_asm.h as pub_basics_asm.h. Removed core_asm.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3931
2005-06-18 04:10:56 +00:00
Nicholas Nethercote
521eb8fd80 Moved VGA_(getArchAndSubArch) into m_translate and made it local. This
allowed the removal of $ARCH/state.c, hooray!



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3930
2005-06-18 03:44:34 +00:00
Nicholas Nethercote
2f407d612c Moved the code trampoline stuff into a new module, m_trampoline. Not
certain this was the right thing to do, but that stuff sure as hell
didn't fit in any of the existing modules.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3929
2005-06-18 03:27:58 +00:00
Nicholas Nethercote
cbab2cf707 Moved VG_BUGS_TO out of basic_types.h into libcassert.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3928
2005-06-18 02:25:16 +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
bf54d4eff9 Forgot to remove these decls in the last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3926
2005-06-18 01:42:21 +00:00
Nicholas Nethercote
1c843d6ef8 Moved two functions out of $ARCH/state.c into m_main, the only module
that uses them.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3925
2005-06-18 01:35:16 +00:00
Nicholas Nethercote
b54b42c310 Rename m_syscalls/ as m_syswrap/ to complete the module renaming.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3924
2005-06-17 22:27:21 +00:00
Nicholas Nethercote
626d5c129c Renamed the m_syscalls module m_syswrap, which better describes what it
does and better distinguishes it from m_syscall.  Did everything for this
except renaming the m_syscalls/ directory -- I'll do that shortly, I don't
think Subversion can handle renaming a directory and files within that
directory at the same time.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3923
2005-06-17 22:19:06 +00:00
Nicholas Nethercote
cfbf606ac5 Moved the basic syscall stuff out of m_libcbase.c into a new module
m_syscall.c.  Plus some associated cleanups.

Moved VG_(sigreturn) into m_signals.c and made it local.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3922
2005-06-17 21:31:45 +00:00
Nicholas Nethercote
67424caf39 Fix strchr. It was rather bogus.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3921
2005-06-17 19:28:29 +00:00
Julian Seward
e40e2c0cee Don't do strlen on ui->compdir if it is NULL. Duh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3920
2005-06-17 13:06:53 +00:00
Nicholas Nethercote
fbf54ace13 Renamed VG_(mark_from_registers) to the more general
VG_(apply_to_GP_regs).  Moved it into m_machine.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3919
2005-06-17 03:06:27 +00:00
Nicholas Nethercote
c9a033dc8c Forgot to add strchrc.stderr.exp.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3918
2005-06-16 13:14:51 +00:00
Tom Hughes
c3f8f5cbfe Make sure redirects are fully initialised and add them to the resolved
list straight away if they are resolved or we will wind up asserting.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3917
2005-06-16 09:20:43 +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
Julian Seward
d0029796b7 Update expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3915
2005-06-15 21:34:35 +00:00
Tom Hughes
98c5263a8e Enable the fadvise system calls again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3914
2005-06-15 10:31:10 +00:00
Tom Hughes
8e503ef920 Fix message to refer to the correct file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3913
2005-06-15 10:24:26 +00:00
Tom Hughes
cd3fd144e8 When separate debug information is used make sure we look for all
the DWARF sections we now need in the separate debug file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3912
2005-06-15 10:19:43 +00:00
Julian Seward
6793eb773d Complete the merge of Eric Estievenart's DWARF2 directory-reading
patch.  This actually requires a major restructuring of the DWARF2
line number reading stuff.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3911
2005-06-14 21:51:14 +00:00
Julian Seward
66755d61e5 Be quieter when outputting XML.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3910
2005-06-13 18:22:17 +00:00
Julian Seward
90e98b737e Updates to the rest of the debuginfo module to track directory names.
The only interesting part is a change of signature of
VG_(get_filename_linenum) so that callers can optionally request
directory info too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3909
2005-06-13 17:39:06 +00:00
Julian Seward
56b4d07c7d Partially merge in a (heavily modified) patch from Eric Estievenart
which adds support for reading directory names from DWARF2 debug info.

Also rework the representation of file and directory tables in the
DWARF2 reader.  This removes a longstanding but only-just-discovered
curiousity that the previous code expanded the filename table one
entry at a time, so that reading file names from a DWARF2 object was
quadratic in the number of file names.  It's now N log N.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3908
2005-06-13 17:33:27 +00:00
Julian Seward
ced9276574 Updated date :-)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3907
2005-06-13 16:50:29 +00:00