Julian Seward [Wed, 23 Mar 2005 02:53:13 +0000 (02:53 +0000)]
PRE_(mmap2) and PRE(old_mmap): if not MAP_FIXED but addr != 0, don't
fail if we can't get addr; instead get something arbitrary. This is
what SUSv3 requires.
Julian Seward [Tue, 22 Mar 2005 02:24:05 +0000 (02:24 +0000)]
Turns out the recent IRStmt_NoOp hackery broke the IR optimiser quite
seriously. It was still transforming correctly, but many of the
transformations had been hampered by no longer being able to recognise
no-ops properly. This hopefully fixes it.
Julian Seward [Tue, 22 Mar 2005 01:55:35 +0000 (01:55 +0000)]
Mucho buggering about jmp_with_stack and its kin. Jeez. Now the
amd64 version is broken again. Writing code with undocumented
assumptions should be a firable offense. At the very least.
Julian Seward [Tue, 22 Mar 2005 00:19:55 +0000 (00:19 +0000)]
jmp_with_stack is a hack which makes no sense on archs which pass args
in registers. Replace it (for amd64) with something more disciplined:
call_on_new_stack_0_0 and call_on_new_stack_0_1.
Julian Seward [Mon, 21 Mar 2005 01:35:02 +0000 (01:35 +0000)]
Bring in the beginnings of 64-bit cleanness for IR mangling in cachegrind:
* use mkIRExpr_HWord to wrap constants
* add a bunch of paranoia to check we're not screwing up too obviously
Julian Seward [Mon, 21 Mar 2005 01:06:20 +0000 (01:06 +0000)]
The Icc typechecker police have been round banging on our doors again.
Placating icc -Wall is a Herculean task; I don't know if it will ever
get completed.
Julian Seward [Mon, 21 Mar 2005 00:55:49 +0000 (00:55 +0000)]
Track Vex API change in rev 1062: pass both the guest and host word
sizes to the instrumentatation functions. Make most of the tools
abort if they are not the same; we can't handle that case yet.
Julian Seward [Mon, 21 Mar 2005 00:15:53 +0000 (00:15 +0000)]
Add a new IR statement kind: IRStmt_NoOp, to denote a no-operation.
These are generated by the IR optimiser. The use of no-ops replaces
the old practice of allowing a BB to contain NULL pointers in its
statement array as a way of denoting no-ops. NULL stmts are now no
longer allowed under any circumstances, and the IR sanity checker will
reject any BB containing them.
Move VG_(get_EIP)() out of vg_execontext.c, where it doesn't belong, into
vg_main.c, where it doesn't also really belong but at least it's now next to
VG_(get_stack_pointer)() which is very similar.
This commit partly cleans up and modularises ExeContext usage. It doesn't
look like that much, but it's a good first step; there's more to come.
- vg_errcontext.c:gen_suppressions() and vg_symtab2.c:VG_(mini_stack_dump)()
had very similar stack-trace-traversing loops. I factored these out into
the higher-order function VG_(apply_ExeContext)(). I put this into
vg_execontext.c, which is the obvious spot. This is good because before
this change we had two functions, neither in vg_execontext.c, which were
crawling all over ExeContexts -- they shouldn't have to do that.
- Removed VG_(mini_stack_dump)(), which was almost identical to
VG_(pp_ExeContext)().
- Removed dead function VG_(get_EIP_from_ExeContext)().
- Replaced a call to VG_(get_ExeContext2)() with the simpler
VG_(get_ExeContext)() in vg_scheduler.c.
Reinstated Cachegrind. Seems to be working ok -- numbers compare pretty
well with those for the CVS version... the I1 accesses are noticeably
higher, but everything else is nearly the same.
There's some ugliness in spots, partly due to shortcomings with Vex. And
CPUID auto-detection is currently disabled, because cpuid is disabled in
general.
Julian Seward [Wed, 16 Mar 2005 18:19:10 +0000 (18:19 +0000)]
Add a new kind of IR stmt: "instruction marks" (IRStmt_IMark), so as
to support profiling. It is the responsibility of front ends (toIR.c)
to generate these. For each instruction, the first IR stmt emitted
should be an IMark, stating the guest address and length of the guest
instruction represented by the IR that follows. All IR stmts
following the IMark but before the next IMark are then assumed to
'belong to' the guest insn described by the first IMark. IMarks do
not denote executable code and can be ignored at any point in the
proceedings; they are an optional addition which help
profiling-annotators to navigate the IR stmt stream.
This commit adds IR level infrastructure for IMarks and IMark
generation in the x86 front end. The amd64 and ppc32 front end are
not yet done.
Julian Seward [Wed, 16 Mar 2005 13:57:58 +0000 (13:57 +0000)]
Add guest_TISTART and guest_TILEN fields to all guest state structs,
since eventually users of the library will refer to them, and unless
they exist in all guest states, compilation failure will result.
These fields contain the size and length of an area of icache
invalidated by any icache-flushing instruction encountered. On x86
and amd64 there is no such insn and so they are zeroed at startup and
play no further role at all. But on ppc32 they are written to as a
result of executing an 'icbi' instruction.
Julian Seward [Wed, 16 Mar 2005 12:37:30 +0000 (12:37 +0000)]
Remove pth_once from memcheck/tests. It already exists in
corecheck/tests and there is no point in duplicating it. Given that
it was intended to check the behaviour of our now-defunct pthread
implementation there's not much point in keeping it at all.
Julian Seward [Wed, 16 Mar 2005 12:11:12 +0000 (12:11 +0000)]
Get rid of VG_(client_free) as it was never used. Rename its
counterpart VG_(client_alloc) to VG_(get_memory_from_mmap_for_client).
Man, this low level memory management is an undisciplined mess.
Julian Seward [Wed, 16 Mar 2005 11:52:25 +0000 (11:52 +0000)]
Add %EBP/%RBP to the set of registers for which redundant-PUT
elimination is not done. This is needed so that Valgrind can
construct correct stack traces on x86/amd64. Curiously enough old
UCode valgrind didn't do this correctly, but because it doesn't
optimise as aggressively as Vex, we didn't notice this. Overall
result is that Vex-based valgrind now produces more accurate stack
traces, at least on x86, than valgrind-2.4.X will.
Fixed xer_ca flag calc for subfze,
Cleaned up ghelpers.c: calc_xer_ca, calc_xer_ov
Cleaned up toIR.c dis_int_arith, dis_int_cmp, dis_int_logic, dis_int_shift