85 Commits

Author SHA1 Message Date
Nicholas Nethercote
ce81b52a84 Make our VG_(isspace)() match libc's isspace(). And remove ISSPACE and
VG_ISSPACE, replacing them with calls to VG_(isspace)().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3439
2005-03-26 04:14:01 +00:00
Nicholas Nethercote
ff514fd09b Rename M_VG_ERRTXT as VG_ERRTXT_LEN, which is more consistent with other
names.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3430
2005-03-25 23:47:16 +00:00
Nicholas Nethercote
f474d2e51a A modularisation + refactoring commit. vg_execontext.c has been split into
two halves: stacktrace.c, which deals with getting, traversing and printing
stack traces;  and execontext.c, which deals with storing stack traces
permanently in a way that avoids duplicates, and comparing them.

One nice outcome:  previously we were often creating ExeContexts, which live
forever, even when they were only needed temporarily.  Ie. this was a memory
leak, which has been removed.

As part of this, new headers have been created, carved off core.h and
tool.h.  Lots of function names have changed, too.

In Massif, I also changed a lot of "eip" names to "ip" to make them less
x86-specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3429
2005-03-25 23:35:48 +00:00
Nicholas Nethercote
f94393fec0 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3394
2005-03-20 23:45:36 +00:00
Nicholas Nethercote
404d5824be Print messages only shown with -v using Vg_DebugMsg, rather than Vg_UserMsg.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3391
2005-03-20 18:21:14 +00:00
Nicholas Nethercote
f7cf78c703 Remove some dead macros.
Move others that are only used in one file, out of core.h into that file.
Remove the "VG_" prefixes while doing it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3337
2005-03-13 06:26:22 +00:00
Nicholas Nethercote
42f4082beb comment-only wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3328
2005-03-13 05:27:57 +00:00
Nicholas Nethercote
05fe123a9e Update copyright notice for 2005 on all relevant files. Don't bother trying
to be selective about it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3303
2005-03-12 16:22:54 +00:00
Nicholas Nethercote
73933817e2 Only try matching if the pointer could be resolved to a name.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3275
2005-03-11 04:46:09 +00:00
Julian Seward
0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00
Julian Seward
efcf1e61ec Complete rewrite (I think this is the 4th incarnation) of translation
table/cache management.  Two main changes.  (1) Translation areas are
recorded using VexGuestExtents, so that Vex is now properly supported
and code deletion works correctly.  (2) Low overhead BB profiling,
enabled by the --profile-flags=<XXXXXXXX> option.  This finds the top
N bbs at exit and shows them, so as to give a basis from which to do
performane tuning.

To support this, the way tt/tc work is changed.  It is still a
sectored arrangement, but now each sector has its own hash table.
This simplifies a lot of things.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3226
2005-01-19 11:55:34 +00:00
Julian Seward
6c9a668a42 Add a new variant for --gen-suppressions: --gen-suppressions=all,
which just prints a suppression for all reported errors without asking
questions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3219
2005-01-10 17:24:47 +00:00
Nicholas Nethercote
ce2585d447 Changed message at the top of files, and the startup message, and the
string in valgrind.pc.in, so that they describe Valgrind as a "dynamic
binary instrumentation framework", and don't mention platforms at all.  

I had to tweak the regtest filters a bit for this.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3178
2004-12-01 14:14:42 +00:00
Nicholas Nethercote
398ce0c269 Cleanups, mostly for the baseBlock removal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3095
2004-11-24 16:43:43 +00:00
Nicholas Nethercote
5197cfe79d Last few skin-->tool changes, in various places.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3063
2004-11-22 19:26:27 +00:00
Nicholas Nethercote
454ab569fe Converted the SK_ prefix to TL_ everywhere.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3060
2004-11-22 18:33:15 +00:00
Nicholas Nethercote
3093a1768b Renamed VG_(skin_panic) as VG_(tool_panic).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3057
2004-11-22 18:02:32 +00:00
Nicholas Nethercote
213ef621b7 Renamed functions with 'Skin' in them: SK_(pp_SkinError),
SK_(eq_SkinError), MAC_(pp_shared_SkinError)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3056
2004-11-22 17:57:07 +00:00
Nicholas Nethercote
cf9cf2a220 Renamed sk_assert() as tl_assert().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3055
2004-11-22 17:18:48 +00:00
Nicholas Nethercote
48aff7c26f Convert the 'skin_errors' need to 'tool_errors'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3053
2004-11-22 16:46:13 +00:00
Nicholas Nethercote
71cc7cf067 Replace magic number with proper constant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3040
2004-11-18 12:45:40 +00:00
Nicholas Nethercote
6c2d25aae6 Don't silently ignore any suppression contexts beyond the 4th -- instead abort
with a warning.  Addresses part of bug #77922.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2946
2004-11-08 13:24:25 +00:00
Nicholas Nethercote
e0e17fab32 Increase the size of M_VG_ERRTXT from 512B to 4KB, increasing the size of C++
names that can be demangled.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2787
2004-10-18 15:47:18 +00:00
Nicholas Nethercote
cc5d7881d8 Arch-abstraction: made vg_execontext.c arch-independent, based on Paul
Mackerras's work.

- introduced arch-neutral macros for getting the instruction/frame/stack
  pointers.

- renamed ExeContext.eips as ExeContext.ips

- renamed esp/ebp/eip to sp/fp/ip in several related files and arch-neutralised
  various comments

- introduced arch-neutral macros for walking the stack


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2663
2004-09-05 21:32:37 +00:00
Nicholas Nethercote
49eea042c1 Arch-abstraction: introduce constants for min and max instruction sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2660
2004-09-04 15:28:37 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
ba210a6364 Arch-abstraction step: renamed "vg_include.h" as "core.h".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2643
2004-09-01 23:58:16 +00:00
Nicholas Nethercote
a71a3c84a5 Simplified the interface to VG_(translate)(), and merged it with
create_translation_for().  Cut about 40 lines of code as a side-effect.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2558
2004-08-03 17:16:51 +00:00
Nicholas Nethercote
38ff4e69d1 Comment changes only: s/skin/tool/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2555
2004-08-03 13:29:09 +00:00
Nicholas Nethercote
c1804774f3 Make VG_(n_errs_found) local; replace globally with a 'get' function. Renamed
vg_n_errs_suppressed too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2546
2004-08-02 12:36:01 +00:00
Nicholas Nethercote
bde70741c7 Make the Supp and Error types local to vg_errcontext.h; they don't need to be
global.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2545
2004-08-02 12:21:09 +00:00
Nicholas Nethercote
c6cf3e0237 typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2443
2004-06-27 12:38:17 +00:00
Nicholas Nethercote
16523cef73 Patch from Tom Hughes:
Patch to allow debuggers other than GDB to be used

    The patch replaces --gdb-attach and --gdb-path with --db-attach and
    --db-command which are more general. The --db-command switch takes a
    command string that can contain one or more instances of %p and %f markers.
    The %p marker is replaced with the PID of the process to attach to and the
    %f marker with the filename of the executable being attached to.

    The default command is "gdb -nw %f %p" which gaves the same result as
    currently.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2232
2004-01-26 16:48:06 +00:00
Nicholas Nethercote
24b4bc848a staticalise
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2229
2004-01-25 20:33:53 +00:00
Nicholas Nethercote
6b0bed393b Anti-globalisation
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2228
2004-01-25 19:30:29 +00:00
Nicholas Nethercote
c756c590cf Convert "skin" to "tool" in various places; almost entirely within comments,
nothing that will affect code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2217
2004-01-21 15:08:04 +00:00
Jeremy Fitzhardinge
ea5dacc8b3 Make --gdb-attach=yes work properly; rather than trying to attach gdb
to itself, Valgrind forks a child, and uses ptrace to manipulate its
state into what the client state would be at that point, and attaches
gdb to that.  In addition to giving gdb clean state to inspect, it
also stops mistakes in gdb (eg, continuing) from killing your target.
It also makes gdb strictly read-only; any state changes made from within
gdb will not be reflected in the running client.  Patch from Tom Hughes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2187
2004-01-06 00:18:21 +00:00
Nicholas Nethercote
07b8e3438b Updated copyright dates for 2004. Also added a couple of missing headers and
footers to some new files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2177
2004-01-04 16:43:23 +00:00
Jeremy Fitzhardinge
1f4c6deede Auto-generate stage2.lds so that the linker script matches the local
linker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2122
2003-12-16 22:26:45 +00:00
Nicholas Nethercote
fb2d543ee8 Started to rescind the name "skin", replacing it with "tool". Did this in all
the places that normal users will see:

  - command line: --tool=foo (although --skin=foo still works)
  - docs: removed all traces (included renaming coregrind_skins.html to
    coregrind_tools.html)
  - in the usage messages
  - in error messages

Also did in in some places that I judged were unlikely to cause clashes with
existing workspaces:

  - in the header comments of many files (eg. "This file is part of Memcheck, a
    Valgrind tool for...")
  - in the regtests script
  - in the .supp files
  - in AUTHORS
  - in README_MISSING_SYSCALL_OR_IOCTL

Also update the AUTHORS file to mention Jeremy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2027
2003-11-14 17:47:54 +00:00
Nicholas Nethercote
d7bfd760a8 Changed error messages: now don't print anything below main() unless the new
option --show-below-main is on.  It's on by default.  It also affects
suppressions generated with --gen-suppressions=yes.  Updated reg tests
accordingly.

Also updated docs for this.  And added some missing command-line args to docs.
Also compartmentalised the options a little in the docs, and rearranged the
order of options in the usage message, in anticipation of a bigger
rearrangement that will be necessary soon -- to distinguish options used by all
skins from those used by error-checking skins, to skin-specific ones.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2020
2003-11-13 17:35:04 +00:00
Jeremy Fitzhardinge
8f0884bbb6 When creating a logfile name, add a sequence number to the name in case
a logfile for that pid already exists.  This may happen for programs
started during system boot which will tend to get the same pid each boot.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1928
2003-10-14 22:13:28 +00:00
Nicholas Nethercote
29c92969ff Fix up the way SK_(update_extra)() is called.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1803
2003-08-19 16:14:42 +00:00
Julian Seward
ffbedad97e Fix the strdup-of-OverlapErr-string problem better. Move the
strdup to MAC_(record_overlap_error), wherein we know that
s is a string.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1786
2003-07-24 23:50:17 +00:00
Julian Seward
2e724ba3df construct_error(): strdup the supplied s (string) param which gives
extra info about some kinds of errors.  It was being allocated on the
stack by complain2/3 in mac_malloc_wrappers.c.

If the constructed error is found to be a duplicate, free the strdup'd
space.  That limits the worst-case space leak to one strdup'd string
for each different error we keep track of, and the latter by default
is limited to 300.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1785
2003-07-24 21:29:40 +00:00
Nicholas Nethercote
0f871c249c A big commit size-wise, but small concept-wise: removed the ThreadState type
from skin's view, replacing all instances with ThreadId.  Much cleaner.  Had to
change the way VG_(get_ExeContext)() worked a little.  Changed the core/skin
major interface because this breaks the old version.  Also fixed a few minor
related things here and there.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1782
2003-07-24 08:45:32 +00:00
Nicholas Nethercote
6b57397875 This commit fixed some bugs in error and suppression handling. Basically, I
had forgotten that some errors (PThread errors) are found by the core, rather
than skins and so the skin shouldn't be involved in handling them.  This commit
fixes the problem.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1770
2003-07-21 10:38:23 +00:00
Julian Seward
f7f560b8e1 Add patch from Sami Liedes <sliedes@cc.hut.fi> making GDB use more flexible:
--gdb-path=/path/to/gdb   allows running some alternate GDB
--input-fd=<n>            allows reading input from some fd other than stdin
I even updated the docs :-)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1754
2003-07-13 10:54:33 +00:00
Julian Seward
c39a6ef339 load_one_suppressions_file(): Make sure to finish reading
up-to-and-including the '}' when the number of callers is >=
VG_N_SUPP_CALLERS.  (Jeffrey Stedfast)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1728
2003-07-06 01:40:11 +00:00
Julian Seward
07258f73de gcc-3.3 as supplied with SuSE 8.2 ("gcc version 3.3 20030226
(prerelease) (SuSE Linux)") seems to complain about signed-vs-unsigned
comparisons, when -Wall is on.  This commit fixes (most of) those
complaints.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1638
2003-05-18 10:05:38 +00:00