Commit Graph

1805 Commits

Author SHA1 Message Date
Julian Seward
f2cdf4536b Handle DW_CFA_register.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3595
2005-05-02 12:25:13 +00:00
Julian Seward
6b7de988f2 Re-enable vex bb chasing. In fact this accidentally got reenabled in
r3582; this commit formalises that.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3594
2005-05-02 12:24:39 +00:00
Julian Seward
96e2bfed39 rm debug printing
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3593
2005-05-02 10:39:16 +00:00
Julian Seward
1ab9dd1d31 Initial cleanups based on target-specific defines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3592
2005-05-02 10:33:44 +00:00
Tom Hughes
d6a91b8ec3 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3591
2005-05-02 10:28:42 +00:00
Julian Seward
5496e4553b 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3590
2005-05-02 10:25:34 +00:00
Julian Seward
2275f4f69b Sort the CFI summary table and do lookups in it using binary search.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3589
2005-05-02 09:43:44 +00:00
Julian Seward
b011f9ebf7 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3588
2005-05-02 00:36:27 +00:00
Julian Seward
b7221a869c CFI: if summarisation fails, don't add the result to our collection of
CfiSI records.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3587
2005-05-02 00:34:19 +00:00
Julian Seward
6d35a0cb59 Fix various other CFI-frame-unwind bits and pieces.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3586
2005-05-01 23:50:08 +00:00
Julian Seward
530e53d6be * handle DW_CFA_offset_extended_sf
* make --trace-cfi=yes work, to assist in debugging this


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3585
2005-05-01 20:24:06 +00:00
Tom Hughes
895a3deea4 Get DWARF CFI handling going on amd64 systems. This also required getting
handling of augmentation strings right.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3584
2005-05-01 15:14:01 +00:00
Julian Seward
d86f35b2dc New flag --trace-cfi=yes|no [no], which is for debugging the CFI reader.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3583
2005-05-01 08:55:38 +00:00
Julian Seward
5af19949f8 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3582
2005-04-30 18:47:48 +00:00
Julian Seward
80d1085300 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3581
2005-04-30 07:55:58 +00:00
Julian Seward
efbfebe72e Even more pissing with inline asm around to placate gcc-3.4 -fpic. We
can't trash %ebx without gcc getting unhappy, so trash %edi instead.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3579
2005-04-28 09:40:53 +00:00
Julian Seward
e55e18c4ba 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3578
2005-04-27 23:17:48 +00:00
Tom Hughes
9767dcb99f Make the debug log module work on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3575
2005-04-27 09:23:02 +00:00
Tom Hughes
dd35e4a4cb Rework the inline assembly implementations of write and getpid for x86 to
work in PIE builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3574
2005-04-27 08:58:53 +00:00
Tom Hughes
dd1b51f37c Add support for the fadvise system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3571
2005-04-26 08:13:24 +00:00
Julian Seward
589f217d3f A bunch of redirections for SuSE 9.2 on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3569
2005-04-25 17:08:32 +00:00
Tom Hughes
6bfc4741ab Use %lu for all length values in debug messages or you will sometimes
get nonense on 64 bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3568
2005-04-25 16:55:44 +00:00
Julian Seward
c862370c01 amd64 build fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3567
2005-04-25 16:21:17 +00:00
Julian Seward
9fa6d3838b 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3566
2005-04-25 15:49:10 +00:00
Julian Seward
894840bfcb Use __FUNCTION__ correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3565
2005-04-25 15:42:57 +00:00
Julian Seward
3f12fcbba8 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).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3564
2005-04-25 11:11:44 +00:00
Julian Seward
05efe1dcb6 More debug printing
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3563
2005-04-25 02:38:28 +00:00
Julian Seward
a16787b1b5 More printing fine-tuning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3562
2005-04-25 02:37:56 +00:00
Julian Seward
638c3a1240 Print debugging info at various places in the startup sequence.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3561
2005-04-25 02:05:54 +00:00
Julian Seward
920e4c17ad Print a bit more prettily.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3560
2005-04-25 02:04:54 +00:00
Julian Seward
487756039c 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.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3559
2005-04-25 01:36:56 +00:00
Julian Seward
7a5882a9b1 Relax the requirement that a pub_tool_<modulename>.h file must exist
even if it defines nothing.  That's a bit silly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3558
2005-04-24 14:34:42 +00:00
Julian Seward
0d4f070b04 Make amd64-linux build again after m_sigframe hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3557
2005-04-24 14:31:29 +00:00
Julian Seward
48d6381e24 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3556
2005-04-24 14:18:14 +00:00
Julian Seward
4ea28e5187 Rename the first three modules as per naming scheme.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3555
2005-04-24 12:33:12 +00:00
Julian Seward
b277eef67d Add statement-of-intent re top level module structure.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3554
2005-04-24 12:19:13 +00:00
Julian Seward
c9356b36be Add initialisation-order sanity checks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3553
2005-04-24 11:22:44 +00:00
Julian Seward
d82491f9da Update comment about stack management, and remove some unused
functions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3552
2005-04-24 11:05:55 +00:00
Julian Seward
8ee1f7bca4 A leftover from the days of our own libpthread; now irrelevant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3551
2005-04-24 10:41:53 +00:00
Julian Seward
78e24d41bd Add intercepts for operator new(unsigned long) and operator
new[](unsigned long).  The 32-bit ones take unsigned int args, not
unsigned longs, and so the existing name-set did not capture them.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3549
2005-04-24 00:04:42 +00:00
Julian Seward
2c4c0c38f6 Allow memcheck to take account of VGA_STACK_REDZONE_SIZE -- that is,
account for the fact that on amd64 (really, on amd64-linux) the area
up to 128 bytes below the stack pointer is accessible.  This meant
moving the definitions of VGA_STACK_REDZONE_SIZE to tool-visible
places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3546
2005-04-23 22:42:27 +00:00
Julian Seward
82378116c1 Add another redirect that we need. This has no effect at present
because the redirect syms are set up only after the initial read of
/proc/self/maps and by then ld-linux.so.2 is already aboard.  Fixing
this properly requires fixing the address space management stuff
properly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3534
2005-04-20 14:32:32 +00:00
Nicholas Nethercote
5446180661 Renamed vg_errcontext.c as errormgr.c, and carved off the relevant parts of
core.h and tool.h into pub_core_errormgr.h and pub_tool_errormgr.h.  All
just to improve general modularity.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3532
2005-04-19 04:10:25 +00:00
Nicholas Nethercote
9aecfe0d13 Added new assert macros vg_assert2 and tl_assert2 which allow you to print a
string explaining more detail if the assertion fails (eg. the value of the
bogus variable) using printf-style format arguments.

One consequence of this is that you can do something like
 
  vg_assert2(0, "bad bad bad");

instead of calling VG_(core_panic).  The advantage of the new approach is
that it shows the file/function/line info for the failing code, whereas
VG_(core_panic)() does not.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3528
2005-04-08 23:28:23 +00:00
Julian Seward
96f7c469bb Reword error messages in a not-quite-so-terse way.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3525
2005-04-07 02:24:23 +00:00
Julian Seward
6022de545d Even more syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3524
2005-04-07 02:23:50 +00:00
Julian Seward
394ef03a88 Get rid of the --sloppy-malloc= flag and the functionality it
controlled (rounding user malloc requests up to a multiple of 4).
Subsequent changes to memcheck made it more or less pointless, it is a
time waster in the malloc/free path, and nobody ever used it AFAIK.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3522
2005-04-05 20:59:55 +00:00
Tom Hughes
67b984d856 Removed bogus (UInt) casts from the amd64 signal frame builder and some
unecessary casts and code from the x86 signal frame builders.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3521
2005-04-05 18:36:05 +00:00
Nicholas Nethercote
fe21329e16 Renamed and retyped the fields relating to valgrind's stack in os_state_t to
make their role clearer and their behaviour more consistent with the fields
describing the client's stack.  Also made the code in x86-linux/syscalls.c
and amd64-linux/syscalls.c more word-size-independent, which is not strictly
necessary but makes the code similarities between the two files more
obvious.

One consequence of this is that Valgrind's stack on AMD64 is now 16384 * 8
bytes, rather than 16384 * 4 bytes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3520
2005-04-05 02:49:09 +00:00
Tom Hughes
eaea598d41 Removed references to client_stack_base which no longer exists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3519
2005-04-04 07:15:04 +00:00