Julian Seward [Wed, 4 May 2005 13:53:00 +0000 (13:53 +0000)]
Move all the 'scalar' (syscall-arg) tests into x86/. In fact they are
really x86-linux specific, but fixing it all properly will have to
wait for another day.
Julian Seward [Wed, 4 May 2005 00:26:57 +0000 (00:26 +0000)]
Move this test to a more sensible place. Originally it was intended
to check that the threading library hadn't messed up errno. Now that
doesn't make much sense any more. Anyway, now it annoyingly fails due
to memcheck reporting bugs in libpthread et al. Move it to corecheck
so at least it can continue to run and hopefully not continually fail.
Julian Seward [Tue, 3 May 2005 18:19:05 +0000 (18:19 +0000)]
Fix really stupid bug I introduced during recent 64-bitification of
mc_main.c. As so often the case, the regtest system saved the day by
being the first to notice this idiocy.
Julian Seward [Tue, 3 May 2005 15:23:00 +0000 (15:23 +0000)]
VG_(addCfiSI): ignore CfiSIs which state an address range outside of
the segment itself. This may well be hiding bugs in the CFI reader,
but I can't figure out why some .so-s generate very low address
ranges -- sometimes eg 0x0 .. 0x1.
Julian Seward [Tue, 3 May 2005 12:20:15 +0000 (12:20 +0000)]
x86 guest: generate Iop_Neg* in the x86->IR phase. Intent is to
ensure that the non-shadow (real) computation done by the program will
fail if Iop_Neg* is incorrectly handled somehow. Until this point,
Iop_Neg* is only generated by memcheck and so it will not be obvious
if it is mishandled. IOW, this commit enhances verifiability of the
x86-IR-x86 pipeline.
Tom Hughes [Tue, 3 May 2005 09:30:04 +0000 (09:30 +0000)]
Reset the address encoding to the default before parsing the
augmentation string for a new CIE or we may end up using a bogus
encoding from the previous CIE if the new one has no encoding
specified.
Julian Seward [Mon, 2 May 2005 16:16:15 +0000 (16:16 +0000)]
Minor tweakage: use testl rather than andl in three places on the
basis that andl trashes the tested register whereas testl doesn't. In
two out of the three cases this makes no difference since the tested
register is a copy of some other register anyway, but hey.
Tom Hughes [Mon, 2 May 2005 10:28:42 +0000 (10:28 +0000)]
Move the replacement code for the amd64 vsyscalls into the trampoline page
so that it is copied into the client space. This avoid warnings from memcheck
because it doesn't think that code inside valgrind is valid.
Julian Seward [Mon, 2 May 2005 10:25:34 +0000 (10:25 +0000)]
Add macro definitions that make it possible to do cpu/os/both
ifdeffery in a sane way where it's absolutely unavoidable. When
building the core, eg on amd64-linux, the following preprocessor
symbols are defined:
VGA_amd64
VGO_linux
VGP_amd64_linux
etc on other platforms.
Also, include/basic_types.h now defines VG_WORDSIZE and this is what
should be used for ifdefs that need to know the host word size.
ifdefs based on the C compilers built-ins such as __amd64__ etc
are deprecated and will be done away with.
Julian Seward [Mon, 2 May 2005 00:36:27 +0000 (00:36 +0000)]
Create and use summary address range limits for the CFI records in
each SegInfo. This reduces by about a factor of 8 the amount of work
needed to find each such record.
Get the CFI-based frame-unwinder to the point where it works at least
for small examples on x86. Still messy, slow, amd64 specifics not
done, and non-null cie.augmentations are not handled.
Beginnings of a DWARF CFI-based frame-unwinder. Does not yet do
anything. This is needed to get stack snapshots on amd64 code
compiled with -O, and could also be used for stack snapshots on x86
code compiled with -fomit-frame-pointer if it also has CFI info.
Define N_PRIMARY_MAP to actually generate a 64-bit constant on 64-bit
platforms, otherwise the address-masking operations to establish
alignment and primary-mappability are wrong on 64-bit platforms.
Also set the size of fast-mapped address space on 64-bit platforms to
16G.
local_sys_write_stderr: tell gcc what registers the asm trashes.
Otherwise it doesn't save %ebx across the routine, which is fatal as
%ebx is a callee-save register, it seems.
* Modify the instrumenter to use the new primops introduced in
vex rev 1144.
* Observe that mkLazy2 generates IR which often turns into
long and slow code sequences in the back end, primarily because
PCast operations are expensive. Add a couple of special
cases which give noticably better performance when handling
FP-intensive code on x86.
Add a few new primops which allow for more concise expression of
the instrumentation Memcheck generates:
* CmpNEZ{8,16,32,64}, which are equivalent to CmpNE<sz> with one
argument zero
* Neg{8,16,32,64}, which is equivalent to Sub<sz> with the first
argument zero
For 64-bit platforms, add these primops. This gives a complete set of
primops for conversions between the integral types (I8, I16, I32,
I64), so that a widening/narrowing from any type to any other type can
be achieved in a single primop:
For the time being, disable chasing across basic block boundaries.
This fools the redirector to the extent that that strlen et al do not
get reliably intercepted, and hence makes memcheck report some false
errors. Fixing the redirector properly really entails getting rid of
the circularity between the two memory allocators, but that is more
than I have time to sort out right now.
Create a new module: ASpaceMgr, the address space manager. This
contains what was previously vg_memory.c and also vg_procselfmaps.c,
which is really just a helper for the address space manager.
This just moves code around and modularises it a bit. It doesn't yet
resolve the circular dependencies between ASpaceMgr and various other
chunks of functionality (vg_malloc2, vg_symtab2).
Add a new module: the debug-logger. For a while now, we've used the
same logging mechanism to emit both end-user messages and debugging-
valgrind-itself messages. This commit creates a new mechanism for the
latter purpose.
The main feature of m_debuglog is that it has zero dependencies on any
other module and therefore can safely operate all the way through
stage1 and stage2 startup. It is restricted to emitting debug info on
file descriptor 2 (stderr), but that's not a big deal.
As a result of this change the basic formatted-print routines
(vprintf) have been moved from vg_mylibc.c into m_debuglog, so that
m_debuglog remains standalone.
The %y format string is currently disabled, since supporting it ("show
symbol corresponding to this address") would create a dependency from
m_debuglog to the entire debug-info reading machinery and all the
stuff that depends on, thereby making a nonsense of m_debuglog being
standalone. Its omission does not seem to cause any regression tests
to fail, though.
The debug logger is activated with "-d". More "-d"s make it more
verbose.
m_debuglog.o is linked into both stage1 and stage2, but as it is
completely standalone this causes no particular problems.
Create a new module, "sigframe", responsible for creating/destroying
signal frames. This commit looks worse than it is -- really just a
load of moving-code-around.
This is the first multiple-implementation module, in that it has a
single interface (pub_core_sigframe.h) but multiple implementations,
depending on the os-cpu pair. All the grotty details are hidden in
the implementation in m_sigframe/; callers need be aware only of the
interface. Yay.