36 Commits

Author SHA1 Message Date
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Julian Seward
b1a67076a2 Better checking for command line options that should be either 'yes'
or 'no'.  Fixes #269144.  (a125246@prtnx.com, Florian Krohm
<britzel@acm.org>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11767
2011-05-17 16:29:29 +00:00
Julian Seward
2ee9e90486 Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727
2011-05-06 21:02:55 +00:00
Nicholas Nethercote
11f94ef626 Make error messages at start-up more consistent. Every line of such
messages now begin with "valgrind: ", and they're more often printed before
the preamble.  This required introducing a new message kind, Vg_FailMsg, and
functions VG_(fmsg) and VG_(fmsg_bad_option), and removing
VG_(err_bad_option).

Where we used to have horrible output like this:

    [ocean:~/grind/ws2] vg5 --tool=massif --threshold=101 date
    ==31877== Massif, a heap profiler
    ==31877== Copyright (C) 2003-2010, and GNU GPL'd, by Nicholas Nethercote
    ==31877== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
    ==31877== Command: date
    ==31877== 
    ==31877== --threshold must be between 0.0 and 100.0
    valgrind: Bad option '--threshold'; aborting.
    valgrind: Use --help for more information.

We now have nice output like this:

    [ocean:~/grind/ws2] vg2 --tool=massif --threshold=101 date
    valgrind: Bad option: --threshold=101
    valgrind: --threshold must be between 0.0 and 100.0
    valgrind: Use --help for more information or consult the user manual.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11209
2010-07-06 04:05:23 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Julian Seward
8ffe2fdefa Tidy up of messaging:
* For all tools and the core, don't show statistics when -v is in
  effect.  Instead, try to restrict -v to mostly user-useful
  stuff.

* A new flag --stats=no|yes [no] produces statistics output instead.

* Fix longstanding problem in that Memcheck's leak checker ran after
  the core's error manager module shut down, thereby not showing use
  counts of leak suppressions.  This fixes #186790.

* As a consequence, the leak checker text output of Memcheck has
  changed a bit -- leak check is done before the final error
  summary is done (much more logical), and the output has been
  tidied up a bit.

* Helgrind, Drd and Ptrcheck now also print "For counts of
  detected and suppressed errors, rerun with: -v", which makes
  them consistent with Memcheck in this regard.  These are
  filtered out by the regtest filter scripts.

For all tools except Memcheck, the regtests are unchanged.  On
Memcheck regtests still fail due to rearrangements of the leak
checker output.  This will be fixed by a followup commit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10746
2009-08-07 15:46:56 +00:00
Julian Seward
22ec466157 Merge include/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10476
2009-07-15 14:52:18 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
da695aa41a atoll() is a terrible function -- you can't do any error checking with it.
Some of our option processing code uses it.  This means that eg.
'--log-fd=9xxx' logs to fd 9, and '--log-fd=blahblahblah' logs to 0 (because
atoll() returns 0 if the string doesn't contain a number!)

It turns out that most of our option processing uses VG_(strtoll*) instead
of VG_(atoll).  The reason that not all of it does is that the
option-processing macros are underpowered -- they currently work well if you
just want to assign the value to a variable, eg:

        VG_BOOL_CLO(arg, "--heap",   clo_heap)
   else VG_BOOL_CLO(arg, "--stacks", clo_stacks)

   else VG_NUM_CLO(arg, "--heap-admin", clo_heap_admin)
   else VG_NUM_CLO(arg, "--depth",      clo_depth)

(This works because they are actually an if-statement, but it looks odd.)

VG_NUM_CLO uses VG_(stroll10).  But if you want to do any checking or
processing, you can't use those macros, leading to code like this:

      else if (VG_CLO_STREQN(9,  arg, "--log-fd=")) {
         log_to            = VgLogTo_Fd;
         VG_(clo_log_name) = NULL;
         tmp_log_fd        = (Int)VG_(atoll)(&arg[9]);
      }

So this commit:
- Improves the *_CLO_* macros so that they can be used in all circumstances.
  They're now just expressions (albeit ones with side-effects, setting the
  named variable appropriately).  Thus they can be used as if-conditions,
  and any post-checking or processing can occur in the then-statement.  And
  malformed numeric arguments (eg. --log-fd=foo) aren't accepted.  This also
  means you don't have to specify the lengths of any option strings anywhere
  (eg.  the 9 in the --log-fd example above).  The use of a wrong number
  caused at least one bug, in Massif.
- Updates all places where the macros were used.
- Updates Helgrind to use the *_CLO_* macros (it didn't use them).
- Updates Callgrind to use the *_CLO_* macros (it didn't use them), except
  for the more esoteric option names (those with numbers in the option
  name).  This allowed getUInt() and getUWord() to be removed.
- Improves the cache option parsing in Cachegrind and Callgrind -- now uses
  VG_(strtoll10)(), detects overflow, and is shorter.
- Uses INT instead of NUM in the macro names, to distinguish better vs. the
  DBL macro.
- Removes VG_(atoll*) and the few remaining uses -- they're wretched
  functions and VG_(strtoll*) should be used instead.
- Adds the VG_STREQN macro.
- Changes VG_BINT_CLO and VG_BHEX_CLO to abort if the given value is outside
  the range -- the current silent truncation is likely to cause confusion as
  much as anything.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9255
2009-02-25 01:01:05 +00:00
Nicholas Nethercote
a8c9970a34 Cleaned up the mess that was the treatment of "below main" functions such as
'__libc_start_main', in Massif, m_debuginfo and m_stacktrace.  As part of
this, --show-below-main is now visible to tools, and Massif pays attention
to it.

Improved the description of --show-below-main=yes in the manual.

Replaced some instances of "__libc_start_main" in the test *.exp files with
"(below main)", which is what will actually be seen.  Also updated
scalar.stderr.exp*, which should make it get closer to actually passing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9131
2009-02-10 06:48:00 +00:00
Julian Seward
3b60492dc1 Add a comment re VG_(expand_file_name).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8773
2008-11-17 12:45:01 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Julian Seward
443b85bdee Move VG_(clo_backtrace_size) to a tool-visible header file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7331
2008-01-09 18:37:41 +00:00
Julian Seward
9ad4d494fa New options for Memcheck, --malloc-fill=<hexnumber> and
--fill-free=<hexnumber>, which cause malloc'd(etc) and free'd(etc)
blocks to be filled with the specified value.  This can apparently be
useful for shaking out hard-to-track-down memory corruption.  The
definedness/addressability of said areas is not affected -- only the
contents.  Documentation to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7259
2007-11-30 21:41:40 +00:00
Julian Seward
f5adf7f83a Get rid of VG_NUMW_CLO, as it is pretty much identical to VG_NUM_CLO,
and only used in one place.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7257
2007-11-30 17:50:44 +00:00
Nicholas Nethercote
79d4505e99 Back out r7221, which was incorrect.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7224
2007-11-26 02:55:12 +00:00
Nicholas Nethercote
73f9cade8f Fix NUM_CLO checking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7221
2007-11-26 00:00:32 +00:00
Nicholas Nethercote
4d236e4fb2 Tweak VG_(expand_file_name), as per Josef's suggestions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7204
2007-11-23 22:37:35 +00:00
Nicholas Nethercote
d6b40a390d Fixed up the log file mess throughout, including the docs. This killed
--log-file-qualifier and --log-file-exactly.

Updated NEWS some in preparation for 3.3.0.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7202
2007-11-23 01:41:32 +00:00
Nicholas Nethercote
4481b0b4be Add support for %q in --massif-out-file. Todo: use this mechanism for the
core and Cachegrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7200
2007-11-22 23:01:59 +00:00
Nicholas Nethercote
b8e2d6e145 - Make other integer CLO macros more correct, as I did for VG_NUM_CLO in the
last commit.
- Add a VG_DBL_CLO for fractional arguments.
- Make Massif's --threshold and --peak-inaccuracy arguments fractional.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7150
2007-11-11 22:15:58 +00:00
Nicholas Nethercote
13c597f709 Add four 'strtoll' variants, which are like 'atoll' but let you detect if
the string converted wasn't entirely numeric.  Using them for numeric
command-line options -- previously if you had a option "--foo=<n>", where
<n> is supposed to be an integer, then "--foo=blah" would be interpreted as
"--foo=0", because the "blah" would be converted to zero and the remaining
chars wouldn't be noticed.

Fixed an incorrect command-line option in two massif tests that this change
exposed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7149
2007-11-11 21:58:21 +00:00
Julian Seward
4f00b6d36d Make the --max-stackframe machinery 64-bit clean.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6788
2007-08-28 17:03:01 +00:00
Julian Seward
0dfa208588 Essentially non-functional tidyings and improvements to debuginfo
reading.  Two sets of changes:

* New flags for debugging the readers.  
  --debug-dump=syms
  --debug-dump=line
  --debug-dump=frames

  These (currently accepted but nonfunctional) are intended to
  create output in the style of (that is, identical to)
    /usr/bin/readelf --syms
    /usr/bin/readelf --debug-dump=line
    /usr/bin/readelf --debug-dump=frames
  respectively.  The plan is that flaws in these readers can then
  be easily found by diff-ing the output against that from readelf.

  Also, a new flag --trace-symtab-patt=<object filename pattern>
  which is used to limit all debuginfo-related debug info to the
  set of shared object names matching the given pattern.  This
  facilitates extracting the debuginfo details of one specific
  shared object, which is usually what is required, rather than
  having to wade through megabytes of junk from every object in
  the process.

* Propagate the avma/svma/image address-naming scheme
  (as described at the top of debuginfo.c) through large parts of
  readelf.c and readdwarf.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6588
2007-02-12 17:47:14 +00:00
Julian Seward
ae7b3f3305 Make VG_(clo_log_file_qualifier) tool-visible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6571
2007-02-07 19:50:55 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
fb8234c9d4 Move a couple of functions out of tool view.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6324
2006-10-19 17:31:37 +00:00
Julian Seward
f4560d1332 Move functions which deal with bad command line options from m_main
into m_options.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6233
2006-10-15 01:25:13 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +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
0965fe7cb0 Make VG_(clo_vex_control) tool-visible so tools can control how
aggressive Vex is, if they need to do that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4276
2005-07-26 23:47:00 +00:00
Julian Seward
59bfcbf43c New command line option: --xml-user-comment=XMLTEXT, which allows
copying of arbitrary bits of XML text to the XML output.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4186
2005-07-19 14:18:56 +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