378 Commits

Author SHA1 Message Date
Tom Hughes
cca571d1c9 Handle the TIOCMGET ioctl.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4291
2005-07-28 16:26:34 +00:00
Tom Hughes
1dc053205f Handle the HDIO_GETGEO ioctl. Secondary problem found from bug #109780.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4290
2005-07-28 16:13:42 +00:00
Tom Hughes
e7a2d4c9cd Define extra block device ioctls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4289
2005-07-28 16:10:42 +00:00
Nicholas Nethercote
50db609e82 Removed dead declaration.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4284
2005-07-27 20:31:57 +00:00
Julian Seward
0965fe7cb0 Make VG_(clo_vex_control) tool-visible so tools can control how
aggressive Vex is, if they need to do that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4276
2005-07-26 23:47:00 +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
Tom Hughes
a74aa1e74d Yet more system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4227
2005-07-22 15:04:14 +00:00
Nicholas Nethercote
f9ad9b5ad8 Remove bogus legacy declarations, from the time when the AMD64
version of VALGRIND_MAGIC_SEQUENCE printed a message and exited.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4226
2005-07-22 13:03:20 +00:00
Tom Hughes
ed055c7ea2 Bring the vki_sigevent_t definition into line with current kernels.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4216
2005-07-20 13:45:43 +00:00
Nicholas Nethercote
e71b6dab8b Move config.h inclusion from pub_tool_basics.h to pub_core_basics.h so it's
not seen by external tools.  This was requested by Josef W.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4215
2005-07-20 13:18:23 +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
Tom Hughes
0fef787853 Handle the BLKGETSIZE64 ioctl. Fixes bug #104797.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4161
2005-07-18 13:26:55 +00:00
Nicholas Nethercote
234a4c5d54 Fix comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4148
2005-07-17 16:12:59 +00:00
Julian Seward
f13ea11bf8 Clean up endianness macros a bit. Now pub_tool_basics.h defines
VG_LITTLEENDIAN or VG_BIGENDIAN and that's what should be used.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4142
2005-07-10 00:53:42 +00:00
Nicholas Nethercote
91c18e835e Add a simple random number generator to m_libcbase so we don't have
to use the one from glibc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4130
2005-07-08 04:08:59 +00:00
Nicholas Nethercote
fdeaecb9e1 Rename VG_(get_obj)() as VG_(find_seginfo) to be more consistent
with the other function names.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4114
2005-07-06 13:19:11 +00:00
Nicholas Nethercote
0c328e0636 Comment changes only.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4102
2005-07-03 20:22:07 +00:00
Nicholas Nethercote
e67b65d0eb Changed m_hashtable.c to allow the size of the hash table to be specified
when it is created.  Fortunately this didn't affect code outside this
module except for the calls to VG_(HT_construct)().

As a result, we save some memory because not all tables have to be as big
as the ones needed for malloc/free tracking.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4100
2005-07-03 17:53:11 +00:00
Nicholas Nethercote
fbf8653c8b Removed the remnants of the attempt at an ARM port, because it had
bit-rotted badly and was clogging up the code.

I put the useful remnants in docs/porting-to-ARM in case anyone ever
wants to try porting to ARM again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4092
2005-07-02 23:13:59 +00:00
Nicholas Nethercote
4e8bcf9076 Move the last remaining tests out of corecheck.
Also introduced VG_(showing_core_errors)() to make core error display
more consistent.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4073
2005-07-01 04:15:36 +00:00
Nicholas Nethercote
f6fdbbf06d Don't use non-ansi features in valgrind.h in case it's used in a file
compiled with -ansi.  Added a regtest for it.  Fixed bug #103182.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4044
2005-06-28 19:44:10 +00:00
Nicholas Nethercote
1273f0df14 Combine the percentify() functions from Cachegrind and m_transtab into
a single more general one exported from m_libcprint.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4034
2005-06-26 18:43:40 +00:00
Nicholas Nethercote
4b4e694fef Avoid m_redir.c importing priv_symtab.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4024
2005-06-25 20:22:43 +00:00
Nicholas Nethercote
58b0509c03 Rename functions to make the type involved clearer.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4021
2005-06-25 19:51:33 +00:00
Nicholas Nethercote
63bf761416 Moved the mman VG_(*_native)() functions into m_aspacemgr, and removed
the unused init_shadow_page() function.  As a result, m_aspacemgr no longer
depends on m_libcmman, breaking a circular module dependency, good!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4015
2005-06-24 22:17:38 +00:00
Nicholas Nethercote
5986d3e25f Fix bug #107524 -- epoll_ctl does not access 'events' if it's a
EPOLL_CTL_DEL invocation.

Also renamed our "struct epoll_event" to "struct vki_epoll_event" as it
should be called.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4014
2005-06-24 21:41:28 +00:00
Cerion Armour-Brown
5ce68877be Enabled a bunch more syscalls
A few simple progs make it through memcheck now - bzip2, gzip, xfontsel



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4012
2005-06-24 15:26:49 +00:00
Nicholas Nethercote
128115f4df "make dist" fixes from Ralf Wildenhues.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4010
2005-06-24 13:45:56 +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
Julian Seward
9cb0696641 For symbols which have C-level global scope but which we regard as
module-local, use the new ML_ prefix instead of VG_.  This makes it
trivial to see which names are those exported from public module
interfaces: precisely those using VG_.

/* VG_ is for symbols exported from modules.  ML_ (module-local) is
   for symbols which are not intended to be visible outside modules,
   but which cannot be declared as C 'static's since they need to be
   visible across C files within a given module.  It is a mistake for
   a ML_ name to appear in a pub_core_*.h or pub_tool_*.h file.
   Likewise it is a mistake for a VG_ name to appear in a priv_*.h
   file. 
*/



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4000
2005-06-23 01:02:53 +00:00
Donna Robinson
b655e45a8e argh! there were loads of the little beggars ....
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3999
2005-06-23 00:17:51 +00:00
Nicholas Nethercote
f57e78915d I forgot to remove this a while back.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3997
2005-06-22 18:38:41 +00:00
Nicholas Nethercote
2b8699a483 Remove VG_(getcwd_alloc)(), which can be done otherwise pretty easily.
This halves m_libcfile's dependence on m_mallocfree.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3995
2005-06-21 23:44:58 +00:00
Nicholas Nethercote
40a921359c Move VKI_SIGVGKILL and VKI_SIGVGRTUSERMAX out of vki-linux.h since they're
not really from the kernel and they're defined in terms of VG_(max_signal),
which is in m_signals.  Renamed them with the VG_ prefix too, since they're
now not part of the kernel interface.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3990
2005-06-21 22:23:59 +00:00
Nicholas Nethercote
c866712f82 Moved VG_(first_matching_thread_stack), removing m_threadstate's dependency
on m_machine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3983
2005-06-21 04:01:51 +00:00
Nicholas Nethercote
35fc371349 Malloc replacement worked very much like a 'need', but wasn't one.
I've changed it so it now is, which makes it consistent with the
other 'needs'.  Because of this, I was also able to invert the dependence
between m_mallocfree and m_tooliface, which is related to setting
the redzone size for client heap blocks.  As a result, m_tooliface
now doesn't depend on anything except pub_core_basics.h, hooray!
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3979
2005-06-21 03:20:17 +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
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
Robert Walsh
5a9e619817 Fix AMD64 build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3953
2005-06-19 17:52:41 +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
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
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
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
5235a32498 Minor rearrangement, no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3935
2005-06-18 15:07:39 +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
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
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
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
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
Tom Hughes
16982d83e2 Comment fix - the ARCH_SET_xxx constants are in the x86_64 prctl.h as well.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3904
2005-06-13 08:46:57 +00:00