Commit Graph

70 Commits

Author SHA1 Message Date
Julian Seward
c930639c1d Don't claim that the --single-step= and --optimise= flags exist any
more.  They have been replaced by --vex-guest-max-insns= and the
--vex-iropt-* flags.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4241
2005-07-24 07:39:17 +00:00
Julian Seward
a421699ed2 Rename tags in XML <status> block.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4240
2005-07-24 07:33:15 +00:00
Julian Seward
4a7697b939 --branchpred= doesn't do anything (I'm not sure what it ever did do). Rm'd.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4239
2005-07-24 07:23:54 +00:00
Julian Seward
1bafc58697 Get rid of --support-elan3=. This flag wasn't doing anything since
the Elan3 user-space driver now works on unmodified Valgrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4238
2005-07-24 07:15:44 +00:00
Julian Seward
57252ed688 Rename --smc-support= to --smc-check=.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4237
2005-07-24 07:00:45 +00:00
Julian Seward
6789f6542e A commit which is almost all trivial change.
- m_main: if --log-file-qualifier applies, do not add ".pid"
  at the end of the name

- Fix the logic which detected whether the just-devised name
  already existed.  This was broken (by me) because it could not
  distinguish the reasons for failing to open the logfile.

  Doing this required changing the return type of VG_(open)
  from Int to SysRes (to make failure reasons visible) and 
  that's the cause of most of the changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4228
2005-07-23 09:18:34 +00:00
Nicholas Nethercote
ff19526f03 Recategorise some options in the usage message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4206
2005-07-20 03:03:28 +00:00
Julian Seward
ae8310aa86 Use %t rather than %s in some places for constructing XML output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4188
2005-07-19 15:00:25 +00:00
Julian Seward
59bfcbf43c New command line option: --xml-user-comment=XMLTEXT, which allows
copying of arbitrary bits of XML text to the XML output.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4186
2005-07-19 14:18:56 +00:00
Julian Seward
7cdf76a10b Show Valgrind's args too in the XML output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4183
2005-07-19 12:39:11 +00:00
Julian Seward
038f2032c8 Add time stamps to XML START/FINISH indications.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4182
2005-07-19 12:17:51 +00:00
Julian Seward
89b76a72f4 New command line option: --log-file-qualifier=VAR. When specified,
the contents of environment variable VAR (viz, $VAR) are incorporated
into logfile names.  This makes it easy to incorporate environmental
information into logfile names.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4180
2005-07-19 11:25:02 +00:00
Cerion Armour-Brown
fbf125e1c8 xml output for tool=none is fine too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4147
2005-07-13 14:18:24 +00:00
Julian Seward
38c03a213e A longer gdb-attach delay for ppc
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4134
2005-07-08 18:24:04 +00:00
Julian Seward
50773ee7a1 Support for self modifying code on unfriendly platforms (x86, amd64)
via the use of self-checking translations.  (Friendly platforms which
have icache-invalidation instructions we can observe, such as ppc32,
are already handled correctly.)  This should finally fix the
longstanding problem of V incorrectly handling calls of statically
nested functions (a gcc extension), and more generally make it a lot
easier to use V to debug dynamic code generation systems.

Since self-checking is a large performance overhead, there is some
control via a command line flag:

   --smc-support=none 

      Don't make any translations self-checking.

   --smc-support=stack

      Add checking code for translations taken from segments which
      have the SF_GROWDOWN flag set -- stacks, basically.
      This is the default.  It should make gcc nested functions and
      GNU Ada work correctly with no intervention from the user.

   --smc-support=all

      Make all translations self-checking.  This is expensive and 
      you want to do this if you're debugging a JIT compiler or
      some such.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4122
2005-07-07 10:05:05 +00:00
Julian Seward
2613087077 --time-stamp=yes is incompatible with --xml=yes, at least for the moment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4118
2005-07-06 19:46:48 +00:00
Nicholas Nethercote
f41f28519b Tweak debug output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4103
2005-07-03 20:22:39 +00:00
Julian Seward
2f997267fa ppc32-linux: Vex implements dcbz correctly now. No need to mess with
the auxv to fool glibc into not using it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4067
2005-06-30 12:10:45 +00:00
Julian Seward
d84d0a72ff XML printing fixes for printing to file descriptors.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4054
2005-06-29 23:15:56 +00:00
Julian Seward
a609b352a9 ppc32: reinstate collection of cache-line-size info from the auxv
array at startup.  This is used in m_transtab.  However this info is
not yet fed to Vex, so it's still important to zero-out the auxv field
holding cache line size info passed to the client, so as to stop the
client's glibc using dcbz.  This will be fixed.

Also get rid of a bunch more ppc32-specific vdso stuff in m_main that
doesn't need to be done.  This now means ppc32-linux specifics in
m_main are only marginally intrusive than the x86-linux or amd64-linux
specifics in m_main.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4052
2005-06-29 10:16:14 +00:00
Julian Seward
3785945d45 Get rid of some VDSO finding stuff which was ifdef VGP_ppc32_linux but
apparently pointless as per recent mail from PaulM since ppc32-linux
does not use VDSOs yet.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4051
2005-06-29 08:46:30 +00:00
Nicholas Nethercote
b9bec5539d Remove all the completely unused SF_* flags. I suspect some of the
remaining ones have no interesting effect, but I left them in.

Also simplify the signature for VG_(get_memory_from_mmap_for_client)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4045
2005-06-28 22:14:53 +00:00
Nicholas Nethercote
1e4188a229 Fix comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4040
2005-06-28 02:54:52 +00:00
Nicholas Nethercote
1474691624 Break up VG_(show_BB_profile)(), and move half of it into m_main. This
removes m_transtab's dependence on m_translate (breaking a circular
dependence) and m_debuginfo, hooray.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4035
2005-06-26 20:44:48 +00:00
Nicholas Nethercote
f4ee5eee2a Moved Robert's stack tracking code out of m_aspacemgr into a new module
m_stacks, because it's a nicely distinct and stand-alone piece of
functionality.  This happily removes m_aspacemgr's dependence on
m_mallocfree (there was an apparent dependence due to the #include, even if
it didn't manifest itself in practice -- very important!) and m_options (not
so important).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4009
2005-06-24 03:28:30 +00:00
Julian Seward
de2a4b30fd Disable debug printing by default so we have any hope of getting
regtest passes on ppc32-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4007
2005-06-23 22:37:56 +00:00
Julian Seward
b0c84aea55 Kludge up wait_for_gdb even more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4006
2005-06-23 21:37:47 +00:00
Nicholas Nethercote
d463dd2292 Removed the VGA_/VGO_/VGP_ prefixes for arch/OS/platform-specific
things.  These made sense when the arch/OS/platform-specific code was in
one module, but as that code got mixed in with generic code the boundary
between generic and non-generic blurred, and the distinction made less
sense.  So let's get rid of them.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Nicholas Nethercote
514f201d55 Added VG_() prefixes to functions exported from m_ume to avoid
namespace pollution.

Also broadened a couple of _dl_* suppressions so that vgtest_ume
passes on my machine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3993
2005-06-21 23:03:36 +00:00
Nicholas Nethercote
82a9510ad7 Rename ume.c/ume.h as m_ume.c/pub_core_ume.h to be consistent with
all the other modules.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3992
2005-06-21 22:47:54 +00:00
Nicholas Nethercote
8220768b9f Tweaked m_tooliface to reduce its dependencies on other things:
- VG_(sanity_check_needs)() now returns a message to m_main if it fails, 
  for m_main to print and abort, rather than printing an error message and
  aborting itself.  This removes the dependency on m_libcprint and
  m_libcassert.

- Passing in an extra param to VG_(sanity_check_needs)() that says if
  shadow memory has been allocated, rather than using
  VG_(get_shadow_size)().  This removes the dependency on m_aspacemgr.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3978
2005-06-21 01:54:38 +00:00
Julian Seward
b36f48842a Simplify the implementation of m_trampoline and the stuff that refers
to it.  Now there are no more offsets and no copying of code into the
stack.  We just redirect directly to entry points in m_syscalls.S.

This will mess up pointercheck, since the redirect targets are now in
Valgrind's address space, not the client's.  But pointercheck is hosed
anyway, and I'd rather back off to something simple whilst ppc32 is
stabilised.  When the address space management stuff is overhauled
then pointercheck may or may not get reinstated, and if it does then
the trampoline stuff will need revisiting.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3977
2005-06-21 01:41:34 +00:00
Nicholas Nethercote
7b34a6fb7e turn off debugging output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3975
2005-06-21 00:28:43 +00:00
Nicholas Nethercote
fc38860306 Don't #include pub_core_debuginfo.h in pub_core_aspacemgr.h. So have
to #include it explicitly in lots of other places, but at least the 
dependency is clear now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3974
2005-06-21 00:28:11 +00:00
Julian Seward
aaa54d8e29 (Re)-drop reliance on <sys/mman.h> and disable ppc32-linux specific
vdso-related mashing until the purpose of it is clarified.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3970
2005-06-20 18:03:17 +00:00
Cerion Armour-Brown
d5f7c8aed3 Finally, valgrind on ppc32.
Plenty still to do, but simple programs like ls seem to run ok

Thanks, Paul, for having your ppc port of valgrind 2.4 to work from!




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3969
2005-06-20 15:51:07 +00:00
Nicholas Nethercote
b054cd9608 whoops
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3959
2005-06-19 19:38:03 +00:00
Nicholas Nethercote
1b3a92639e Moved VG_(start_debugger) out of m_main.c into its own module,
m_debugger.  This removes the dependence of m_signals.c and m_errormgr.c
on m_main.c.  It required also moving VG_(clexecfd) out of m_main.c;  I put
it in m_libcproc.c which seemed like an ok-but-not-great choice.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3957
2005-06-19 19:25:44 +00:00
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
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
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
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
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
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
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
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
9e1ebca132 Emit XML preamble in a more parseable way.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3906
2005-06-13 16:48:32 +00:00