Commit Graph

2730 Commits

Author SHA1 Message Date
Nicholas Nethercote
bb0ff0ee26 Correct header comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3597
2005-05-02 13:24:14 +00:00
Julian Seward
e219d86e6d Fix compile warnings on 32-bit platforms, hopefully without breaking
64-bit platforms.  (a.k.a The Portability Game)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3596
2005-05-02 12:53:38 +00:00
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
e014d5790a 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3580
2005-04-28 10:32:02 +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
Julian Seward
f9156cb08c Reinstate the leak checker; it works at least on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3577
2005-04-27 22:46:36 +00:00
Julian Seward
a7b8e8ea58 Handle various new 64-bit integer primops.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3576
2005-04-27 11:40:27 +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
Julian Seward
d2bf76f731 Try a different kludge to get around strlen not being intercepted
early enough.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3573
2005-04-27 00:34:11 +00:00
Julian Seward
a4eecff656 * 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3572
2005-04-26 23:49:24 +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
Tom Hughes
3a9a923718 Support the 64 bit comparison instructions which vex is now using.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3570
2005-04-26 07:44:48 +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
Nicholas Nethercote
a12089811a Inline function that's only used once.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3550
2005-04-24 00:21:01 +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
c97ba2bbaa Add 64-bit values to the bogus-literal detector.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3548
2005-04-23 23:26:29 +00:00