45 Commits

Author SHA1 Message Date
Julian Seward
8a98207bcf Make VG_(get_StackTrace2) aware of bogus LR values in
replacement/wrapper functions on ppc64-linux, which otherwise mess up
the backtraces.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5549
2006-01-18 04:25:20 +00:00
Julian Seward
5d5a72d1a9 The symbol table reader hides all that dot crazyness on ppc64-linux
now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5538
2006-01-17 02:23:09 +00:00
Julian Seward
5e77fedd75 Fix more ppc64-linux function wrapping and symbol-table bits and pieces.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5523
2006-01-12 21:15:35 +00:00
Nicholas Nethercote
bf162724b9 Merge in r5435 from COMPVBITS. Also added a note to
docs/internals/performance.txt about it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5438
2005-12-25 06:34:04 +00:00
Julian Seward
79bbb4ed42 Make ppc64-linux stack unwinding work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5424
2005-12-23 23:33:51 +00:00
Nicholas Nethercote
3866282110 Remove all remaining profiling gunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5388
2005-12-19 22:48:39 +00:00
Julian Seward
8ba9a34088 Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250
2005-11-29 13:05:56 +00:00
Nicholas Nethercote
1ff57e2e07 I couldn't resist
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5177
2005-11-17 19:40:24 +00:00
Julian Seward
20ba7adf1f Make VG_(apply_StackTrace) stop if it looks like we've overshot main().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5170
2005-11-17 15:12:34 +00:00
Julian Seward
1f93e36cf6 Separate the stack unwind logic for amd64 and x86, so that they can be
differently performance-tuned.  amd64 needs to consult CFI first and
then if that fails (unlikely) follow the %rbp chain.  On x86, the CFI
is almost never helpful, but consulting it first wastes significant
time in allocation-intensive programs.  This commit pulls the two
archs apart and puts the CFI check second on x86.  This reduces start
time for ktuberling on x86 on memcheck from 78 seconds to 75.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5126
2005-11-14 15:18:25 +00:00
Julian Seward
e3f0447592 ppc32 stack unwind: if the initial FP looks bad, don't use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5111
2005-11-13 02:41:35 +00:00
Tom Hughes
efaaa0b74a Add a comment documenting the reason for subtracting one from the IP value
after each pass of the loop.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5012
2005-11-05 00:17:21 +00:00
Tom Hughes
64a4375b1b When unwinding the stack on x86/amd64 subtract one from the value of
ip before starting a new pass of the loop.

The reason for this is that (except for the first pass of the loop) the
value of ip is actually a return address, which is therefore after the
instruction that was executing at the time. This means that if there is
a boundary in the CFI information at that point we can wind up using the
wrong CFI data to do the next unwind if we do it based on the return
address.

This most commonly happens with a tail call where we wind up using the
data for the next function to do the unwind and getting hopelessly lost.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4996
2005-11-04 11:31:33 +00:00
Julian Seward
cc8ccbbfb4 This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive).  That branch is now dead.
Please do not commit anything else to it.

For the most part the merge was not troublesome.  The main areas of
uncertainty are:

- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
  and include it in a couple of places.  Building etc seems to still
  work, but I haven't tried building the documentation.

- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
  stuff was moved from -generic to -linux after the branch was created.
  I think that is satisfactorily glued back together now.

- Regtests: although this appears to work, no .out files appear, which
  is strange, and makes it hard to diagnose regtest failures.  In
  particular memcheck/tests/x86/scalar.stderr.exp remains in a 
  conflicted state.

- amd64 is broken (slightly), and ppc32 will be unbuildable.  I'll
  attend to the former shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789
2005-09-27 19:20:21 +00:00
Nicholas Nethercote
c0f9842cf0 avoid compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4484
2005-08-24 01:56:15 +00:00
Julian Seward
dc5f079f45 rm now-redundant macros.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4465
2005-08-19 20:23:05 +00:00
Julian Seward
ae8dfb4531 Incorporate a patch from Craig Chaney which gives better stack
snapshots on ppc32-linux in the presence of functions subject to
leaf-function optimisations.

At the same time, simplify the stack unwinding logic by basically
implementing it separately for each target.  Having a single piece of
logic for amd64 and x86 was tenable, but merging ppc32 into it is too
confusing.  So now there is an x86/amd64 unwinder and a ppc32
unwinder.

This requires plumbing a link-register value into
VG_(get_StackTrace2), and that in turn requires passing it around
several other stack-trace-related functions.  Hence 7 changed files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4464
2005-08-19 16:02:59 +00:00
Nicholas Nethercote
72e156258a Reinstate stack trace printing on assertion failures. It's terrible
for the module dependency graph, but it's very useful.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4205
2005-07-20 02:41:31 +00:00
Nicholas Nethercote
925075a3cd Remove unneeded #ifdef.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4175
2005-07-19 01:22:26 +00:00
Julian Seward
aa9e22bf1f Fix up ppc32-linux stack unwinding.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4141
2005-07-09 22:51:08 +00:00
Nicholas Nethercote
e7aa6b03de 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4025
2005-06-25 20:49:33 +00:00
Nicholas Nethercote
07965f509c avoid compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4022
2005-06-25 19:52:02 +00:00
Nicholas Nethercote
d463dd2292 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.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Julian Seward
b36f48842a 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3977
2005-06-21 01:41:34 +00:00
Nicholas Nethercote
fc38860306 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3974
2005-06-21 00:28:11 +00:00
Cerion Armour-Brown
d5f7c8aed3 Finally, valgrind on ppc32.
Plenty still to do, but simple programs like ls seem to run ok

Thanks, Paul, for having your ppc port of valgrind 2.4 to work from!




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3969
2005-06-20 15:51:07 +00:00
Nicholas Nethercote
f4d8932fc8 Remove some unnecessary #includes, comment some others.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3966
2005-06-20 03:36:51 +00:00
Nicholas Nethercote
d618b2572c Put VG_(client_trampoline_code) in m_trampoline.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3961
2005-06-19 21:49:28 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
2f407d612c Moved the code trampoline stuff into a new module, m_trampoline. Not
certain this was the right thing to do, but that stuff sure as hell
didn't fit in any of the existing modules.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3929
2005-06-18 03:27:58 +00:00
Nicholas Nethercote
1d0e2e6e41 Created m_machine, for various machine-related things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3903
2005-06-13 04:21:38 +00:00
Nicholas Nethercote
bd0bea1552 Remove VG_ERRTXT_LEN from core.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3886
2005-06-11 05:04:09 +00:00
Nicholas Nethercote
eb2d0a7d06 Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages.  This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842
2005-06-04 19:16:06 +00:00
Nicholas Nethercote
dbc8c6d99c Modularise printing functions in m_libcprint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3840
2005-06-03 03:08:39 +00:00
Nicholas Nethercote
09980587a9 Started modularising vg_mylibc. Put all the standalone stuff -- ie. not
relying on any other modules -- in m_libcbase.

Also converted the 'size' parameters to functions like VG_(memcpy) and
VG_(strncpy) from Int to SizeT, as they should be.

Also removed VG_(atoll16) and VG_(toupper), which weren't being used.

Also made VG_(atoll36) less flexible -- it now only does base-36 numbers
instead of any base in the range 2..36, since base-36 is the only one we
need.  As part of that, I fixed a horrible bug in it which caused it to
return incorrect answers for any number containing the digits 'A'..'I'!
(Eg. for "A; it would return 17 instead of 10!)

Had to disable the assertions in VG_(string_match), since this module can't
see vg_assert, which wasn't ideal but also isn't a disaster.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3838
2005-06-02 03:39:33 +00:00
Nicholas Nethercote
5bdf595e70 Modularised the profiling stuff as m_profile.c. It's much more
sensible now -- no vg_dummy_profile.c, no silly #including of
vg_profile.c from tools.  

Unfortunately, it still doesn't work, due to bad interactions
with signal handling that I don't understand.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3833
2005-06-01 03:09:59 +00:00
Nicholas Nethercote
d13bacd9cd Modularised vg_main.c as m_main.c. Moved some stuff out of it to reduce the
number of files that depend on it, but there are still some which should be
removed in the future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3819
2005-05-31 00:23:43 +00:00
Julian Seward
161cfde150 First pass at adding ability for Memcheck to print all output in XML
form.  The relevant flag is --xml=yes.  Currently this only works with
Memcheck.

Specifying this flag fixes various other options relating to verbosity
and behaviour of the leak checker, so that the resulting output is in
a relatively fixed form suitable for parsing by GUIs.

Still to do:

* Add mechanism to show error counts
* Add regression test
* Document the resulting format



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3773
2005-05-19 00:25:45 +00:00
Nicholas Nethercote
937a49ea05 Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751
2005-05-16 23:31:24 +00:00
Julian Seward
2a2b57fdc5 Fix comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3737
2005-05-16 11:47:17 +00:00
Nicholas Nethercote
1365301e39 Moved the stack-walking macros into m_stacktrace.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3732
2005-05-16 00:16:56 +00:00
Nicholas Nethercote
89a26b8f71 Rename some _SIZE macros as _SZB to make their units clear. This change is
in response to a mixed-units (bytes and words) error we had involving
VGA_STACK_REDZONE_SIZE (which is now VGA_STACK_REDZONE_SZB).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3639
2005-05-08 17:49:37 +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
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
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