Julian Seward [Wed, 29 Jun 2005 10:16:14 +0000 (10:16 +0000)]
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.
Julian Seward [Wed, 29 Jun 2005 08:46:30 +0000 (08:46 +0000)]
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.
Move a heap of tests from corecheck/tests/ into none/tests/. There's
no real point in having them in corecheck/tests since they're not testing
anything that Nulgrind doesn't provide.
Fix off-by-one error that was causing four leak-checking regression test
failures for me, and also fixes bug #106293 for me. Let's hope it has
the same effect for others.
Tom Hughes [Mon, 27 Jun 2005 08:11:01 +0000 (08:11 +0000)]
Improve handling of inlined strlen on amd64 by using the expensive
mode for 64 bit add and subtract operations when the bogus literals
flags is set and by adding two new constants to the list of bogus
literals.
While we're not printing stacktraces from assertion failures, might
as well disable pp_sched_status() -- which produces traces that are less
useful than the main one that has been disabled -- and break the
circular dependence between m_libcassert and m_threadstate.
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.
Cleaned up m_redir.c: renamed some variables and functions, added some
comments, neatened the debugging output, avoided unexpected side-effects
in functions, tweaked code to make it clearer.
Made m_debuginfo not depend on m_aspacemgr, breaking the direct circular
dependence between them. (There's still an indirect one via m_libcmman.)
As a result, I was able to move the Segment type declaration into
pub_core_aspacemgr.h, which is a much better spot. I was also able to
remove a couple of #includes.
Remove the Segment back-pointer from SegInfo. The only place it was
being used was in resolve_redir(), and due to the way resolve_redir()
is called, the involved test was always failing anyway. So we lose
nothing by removing it except some complexity -- there is no longer a
circularity between Segments and SegInfos.
Julian Seward [Sat, 25 Jun 2005 15:22:10 +0000 (15:22 +0000)]
Do not print backtraces in assertion failures. This is an as-yet
unsuccessful attempt to remove m_libcassert from the huge cycle which
most of the modules currently live in.
VG_(get_StackTrace2) can now be privatised, but I haven't done so yet.
Donna Robinson [Sat, 25 Jun 2005 14:43:05 +0000 (14:43 +0000)]
Added some more targets to the docs.
Removed 'the' from 'the default' in 'parial' opt to be consistent
Added opt info for --avoid-strlen-errors (was missing)
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!
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).
Broaden a couple of suppressions so vgtest_ume passes on my machine.
(I wrote this in a commit message the other day, but I'd actually
edited the generated default.supp file rather than the glibc-2.2.supp.)
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.
Removed some repetition in the way VG_(record_fd_open)() is called.
As part of this, VG_(resolve_filename)() no longer calls VG_(malloc)()
and so m_libcfile no longer depends on m_mallocfree.
Julian Seward [Thu, 23 Jun 2005 01:02:53 +0000 (01:02 +0000)]
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.
*/
Tom Hughes [Wed, 22 Jun 2005 12:11:42 +0000 (12:11 +0000)]
Declare my_sigreturn as static. This is correct in so much as it isn't
used anywhere else, but it does cause gcc to issue a warning because
it doesn't realised that the assembly code has defined the function.
The reason for changing it to static despite the warning is that when
it is declared extern PIE builds break on amd64 because gcc generates
code that does a load from the address of the my_sigreturn symbol to
get address of the function instead of just computing the address of
the symbol. In other words it generates this:
mov -212(%rip), %rax
to get the address of the function instead of this:
lea -212(%rip), %rax
Obviously this breaks things because we store the wrong address as
the signal restorer when installing the signal handler...
Make search_all_symtabs() work in the same way as search_all_loctabs()
and search_all_scopetabs(), ie. search through SegInfos instead of Segments.
This reduces m_debuginfo's dependency on m_aspacemgr.
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.
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!
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.
Julian Seward [Tue, 21 Jun 2005 01:41:34 +0000 (01:41 +0000)]
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.
Don't #include pub_core_stacktrace.h in pub_core_execontext.h. So
a few places have to #include pub_core_stacktrace.h themselves, but
that's ok because explicit is better.
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.