90 Commits

Author SHA1 Message Date
Philippe Waroquiers
00ef870633 When process dies due to a signal, show the signal and the stacktrace
at default verbosity


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15251
2015-05-17 18:31:55 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Philippe Waroquiers
f85702628a 342353 - Allow dumping full massif output while valgrind is still running
Patch from Andre Goddard Rosa



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14992
2015-03-07 19:20:12 +00:00
Philippe Waroquiers
b08bb282f8 342063 wrong format specifier for test mcblocklistsearch in gdbserver_tests
Patch from Ivo Raisr.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14826
2014-12-21 17:02:38 +00:00
Julian Seward
3e94809f28 Slightly change the help text for some options that involve
user-supplied enumeration values.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14447
2014-09-03 21:58:54 +00:00
Mark Wielaard
41e08a29eb Tweak gdbserver_tests/mcinfcallWSRU.stderrB.exp to match more gdb versions.
Some gdb versions don't show the source line:number after switching
threads in #0  0x........ in do_burn (). Filter "at line:number" out
and don't expect it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14427
2014-09-02 10:16:42 +00:00
Mark Wielaard
f65b136853 gdbserver_tests filter out and don't expect empty lines.
Some filters might have left some empty lines in the output.  Filter them
out explicitly and don't expect any empty lines in any of the .exp files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14381
2014-08-28 22:51:38 +00:00
Mark Wielaard
736294a7ac gdbserver_tests/filter_gdb filter out 'entry value'.
Some versions of gdb might try to print the entry value of an
argument if they know it with @entry=... Filter that out too.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14380
2014-08-28 21:42:45 +00:00
Philippe Waroquiers
3b9ae3e047 Check that vgdb ptrace actions do not cause a EINTR or whatever
to go out of the select syscall


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14378
2014-08-28 20:19:41 +00:00
Mark Wielaard
ce0631c3ee Workaround bug 338633. gdbserver_tests/nlcontrolc.vgtest hangs on arm64.
Disable the test on arm64 for now to keep make regtest from hanging.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14376
2014-08-28 18:47:54 +00:00
Mark Wielaard
b89d33b962 Tweak gdbserver_tests/hgtls.stdoutB.exp filter_gdb a little for older GDB.
Older GDB (7.2 on i386) don't print out which variable+offset an argument
pointer in a breakpoint function points to. The hgtls test already tests
whether the p pointer/test points to the expected tests array element.
So don't expect gdb to print it also and filter it out with filter_gdb.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14331
2014-08-22 10:14:28 +00:00
Philippe Waroquiers
d08707f577 * Unbreak build on macos (and on other platforms) that do not have
HAVE_DLINFO_RTLD_DI_TLS_MODID.
* add the copyright notice in auxprogs/getoff.c
* add more prereq to hgtls.vgtest



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14297
2014-08-16 21:00:15 +00:00
Philippe Waroquiers
2101636621 Some cleanup post QGetTlsAddr commit
* remove useless commented line in hgtls.vgtest
* avoid some #ifdef in arch specific code, hoping to discover more compile
  time errors.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14287
2014-08-15 13:03:24 +00:00
Philippe Waroquiers
bc353dfe97 fix 338160: Implement QGetTlsAddr query so that GDB+V gdbsrv can print __thread variables.
To implement QGetTlsAddr, gdbsrv has to know how to get the glibc dtv
address and the module id from the link_map.
These 2 things are dependent on the internals of glibc.
The dependency is mostly isolated in a few lines of arch dependent
code or in an external utility that used a hack + -ldl lib to find
the offset of the modid in the link_map structure.

Tested on x86/amd64/ppc64/s390x. Somewhat tested on ppc32 and arm64.
Untested/a few #ifdef-ed lines not compiled on arm/mips32/mips64
and darwin.

For more background info about thread local storage handling, see
'ELF Handling For Thread-Local Storage' http://www.akkadia.org/drepper/tls.pdf

Changes:
* auxprogs/getoff.c new auxilliary program to get platform specific offsets
  (currently only the offset for the module id in struct link_map).
* configure.ac : check for dlinfo(RTLD_DI_TLS_MODID) needed for getoff.c
* new gdbserver_tests/hgtls, testing various types of __thread variables
* various m_gdbserver files:
  - implement decoding of the QGetTlsAddr query
  - for each platform: platform specific code to get the dtv
  - call to external program getoff-<platform> the first time an
    __thread variable is printed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14283
2014-08-15 10:27:52 +00:00
Florian Krohm
1d58be2780 glibc 2.3.4 does not appear to define PTRACE_GETSIGINFO. This was
observed on a RHEL5 system on s390. Provide a suitable definition.
Tweak gdbserver_tests/filter_stderr to ignore messages related to
interrupted poll system calls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14197
2014-07-27 12:24:46 +00:00
Philippe Waroquiers
6629c56543 Add a new heuristic 'length64' to detect interior pointers
pointing at offset 64bit of a block, when the first 8 bytes contains
the block size - 8. This is e.g. used by sqlite3MemMalloc.

Patch by Matthias Schwarzott (with small modif)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14179
2014-07-21 19:55:11 +00:00
Philippe Waroquiers
ef4e827246 Patch adding (or showing the proper/not confusing) helgrind thread nr for block
and stack address description.

* A race condition on an allocated block shows the stacktrace, but
  does not show the thread # that allocated the block.
  This patch adds the output of the thread # that allocated the block.

*  The patch also fixes the confusion that might appear between
  the core threadid and the helgrind thread nr in Stack address description:
  A printed stack addrinfo was containing a thread id, while all other helgrind
  messages are using (supposed to use) an 'helgrind thread #' which
  is used in the thread announcement.

    Basically, the idea is to let a tool set a "tool specific thread nr'
    in an addrinfo.
    The pretty printing of the addrinfo is then by preference showing this
    thread nr (if it was set, i.e. different of 0).
    Currently, only helgrind uses this addrinfo tnr.

    Note: in xml mode, the output is matching the protocol description.
    I.e., GUI should not be impacted by this change, if they properly implement
    the xml protocol.


* Also, make the output produced by m_addrinfo consistent:
  The  message 'block was alloc'd at'  is changed to be like all other
  output : one character indent, and starting with an uppercase



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14175
2014-07-18 00:03:58 +00:00
Philippe Waroquiers
0f722418ac have helgrind filter_stderr transforming tid n into tid #x
to avoid gdbserver_tests/hginfo random failures
caused by thread scheduling differences


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14000
2014-06-06 23:45:46 +00:00
Philippe Waroquiers
183b978d08 Factorises the address code description and printing
of memcheck and helgrind in a common module:
  pub_tool_addrinfo.h pub_core_addrinfo.h m_addrinfo.c

At the same time, the factorised code is made usable by other
tools also (and is used by the gdbserver command 'v.info location'
which replaces the helgrind 'describe addr' introduced 1 week ago
and which is now callable by all tools).

The new address description code can describe more addresses
(e.g. for memcheck, if the block is not on the free list anymore,
but is in an arena free list, this will also be described).

Similarly, helgrind address description can now describe more addresses
when --read-var-info=no is given (e.g. global symbols are
described, or addresses on the stack are described as
being on the stack, freed blocks in the arena free list are
described, ...).
See e.g. the change in helgrind/tests/annotate_rwlock.stderr.exp
or locked_vs_unlocked2.stderr.exp

The patch touches many files, but is basically a lot of improvements
in helgrind output files.
The code changes are mostly refactorisation of existing code.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13965
2014-05-14 20:39:27 +00:00
Mark Wielaard
1c16e7fb7f Add send_signal to gdbserver_tests/Makefile.am (dist_noinst_SCRIPTS).
If the send_signal script is missing the nlvgdbsigqueue test would hang.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13961
2014-05-13 20:42:04 +00:00
Philippe Waroquiers
4b81782886 Also give the indication on how to use vgdb when --vgdb-stop-at is given
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13919
2014-04-29 19:04:50 +00:00
Philippe Waroquiers
d4afe02753 Increase some sleep time to (try to) avoid some failure.
With the new sleep time, no failure on 1200 runs of the test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13916
2014-04-27 08:23:17 +00:00
Philippe Waroquiers
dc21443635 Filter lines such as:
+38     ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.

This should make nlgone_exit work on s390 suse and x86_64 suse


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13913
2014-04-26 20:40:41 +00:00
Philippe Waroquiers
38471445e1 Make the test (more) deterministic by having send_signal using
a guardcmd before sending the signal.
This allows to be sure that the signal are emitted when vgdb
is attached.
We still have one 'sleep' in the test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13912
2014-04-26 20:23:47 +00:00
Philippe Waroquiers
5bdc88da20 Improve the comments in the test
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13911
2014-04-26 20:01:28 +00:00
Philippe Waroquiers
922a8c4f8d Due to timing problem, test was not properly testing.
What needs to be ensured is:
   vgdb is attached (i.e. is ptracing valgrind)
   2 sigusr1 signals are sent while vgdb is ptracing
     vgdb will queue these signals
   when continuing, the queued signals are delivered.

With 3.9.0, the above causes an internal error in valgrind:
valgrind: m_syswrap/syswrap-main.c:1436 (vgPlain_client_syscall): Assertion 'sci->status.what == SsIdle' failed.

It would be better to have explicit synchronisation in the test
rather than counting on 'sleep xxx' to have things done in the
order that tests the signal queueing.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13910
2014-04-26 19:55:33 +00:00
Philippe Waroquiers
887231c654 Remove the 2 sed expressions that were trying to massage the
stacktrace for the last program instruction encountered with
  --vgdb-stop-at=exit
These are not needed anymore, as these lines are now removed


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13907
2014-04-24 21:56:21 +00:00
Philippe Waroquiers
ac230f7fcb Too difficult to match the stacktrace of the last instruction
of a program => let's remove these (uninteresting) lines
rather than trying to 'sed' them to make them look the same
on different OS/platform/....


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13906
2014-04-24 21:52:02 +00:00
Philippe Waroquiers
e548d704c3 * Modify nlgone_exit so that it tests --vgdb-stop-at=startup,exit
* remove empty lines from nlgone_*.stdinB.gdb, as these empty
  lines are (surprisingly) repeating the previous gdb command.
  Empty lines should be be put in the *gdb files.
* And add yet another sed expression in filter_gdb to cope with
  the different place where a thread exits.
  (this filter technique is now *really* arriving in a dead end
   e.g. the link between the comment and the sed expression is very
   poor).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13905
2014-04-23 21:27:07 +00:00
Philippe Waroquiers
8b7a52c4cb - The option "--vgdb-stop-at=event1,event2,..." allows the user
to ask GDB server to stop before program execution, at the end
  of the program execution and on Valgrind internal errors.

- A new monitor command "v.set hostvisibility" that allows GDB server
  to provide access to Valgrind internal host status/memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13900
2014-04-20 13:41:10 +00:00
Philippe Waroquiers
74fb3e1c3e vgdb must not transmit signals when gdbserver has been ptrace-invoked.
Most of the time, Valgrind masks async signals, and polls for such
signals at regular interval.
There is a very narrow range of code (around client syscall logic)
where such signals are unmasked (as they must be able to interrupt
syscalls).
This is the only range of code where Valgrind is expecting to
receive such a signal.

When gdbserver is ptraced invoked, Valgrind is artificially made
to jump out of this code portion. Signals are not masked.
When ptraceing valgrind, vgdb will get these signals but cannot
transmit them immediately, otherwise they arrive in range
of code where they are not expected (causing internal error
in syscall logic) and/or causing gdbserver syscalls to be
interrupted.

3 solutions to solve that were looked at:
1. have the gdbserver code masking signals "as quickly as possible".
 Easy to implement, but this leaves still a small window
 of code where signals are not masked and would cause a problem.
2. have vgdb setting the SIGMASK of valgrind before invoking
  gdbserver.
  This would be easy to implement, but changing the SIGMASK
  of the ptrace-d process is only available on very recent kernels.
3. have vgdb queuing signals, and only transmitting them once
   gdbserver invocation is finished.
This 3rd solution has been implemented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13896
2014-04-15 22:35:23 +00:00
Philippe Waroquiers
492a8ae2a2 Implement gdbsrv "v.info stats" command giving statistics for valgrind core + tools
* addition of VG_(needs_print_stats) in pub_tool_tooliface.h
* use the above in memcheck and helgrind
* output valgrind stats and calls print_stats in server.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13760
2013-12-15 20:24:43 +00:00
Philippe Waroquiers
b8ed3a5b65 Fix 326462 Refactor vgdb to isolate invoker stuff into separate module
vgdb.c contained (conditionally compiled) "invoker" code to have ptrace syscalls
used to allow gdb/vgdb to connect to a valgrind process blocked in a syscall.
This "invoker" code is ptrace based.
Not all platforms are using ptrace.
=> refactor vgdb so as allow invoker code to be added more cleanly
for non ptrace based platforms (e.g. Darwin, Solaris).

* add file vgdb.h for:
   - definition of the vgdb-invoker interface
   - common declarations between vgdb.c and vgdb-invoker implementations
* move ptrace related code from vgdb.c to new file vgdb-invoker-ptrace.c
* new file vgdb-invoker-none.c containing an empty invoker implementation
  used on platforms that do not (yet) have a invoker implementation
  (e.g. android and darwin).
* modified Makefile.am to use one of the vgdb-invoker-*.c file depending
  on the platform.
* small changes related to changing ptraceinvoker to invoker in various files:
  gdbserver_tests/make_local_links, gdbserver_tests/nlcontrolc.vgtest,
  gdbserver_tests/mcinvokeRU.vgtest, gdbserver_tests/nlsigvgdb.vgtest  
  gdbserver_tests/mcinvokeWS.vgtest, coregrind/m_gdbserver/README_DEVELOPERS

Patch from Ivo Raisr, slightly modified



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13743
2013-12-01 14:56:28 +00:00
Philippe Waroquiers
90902aaf13 Fix use of uninit heuristic set for monitor command
* initialise leak_check heuristic parameter in the leak_check monitor command
* show the default value (none heuristic) in the monitor help command
  (none value chosen as default as this gives a backward compatible
   behaviour).
* document the heuristic leak check parameter in memcheck manual
  monitor command section



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13631
2013-10-09 20:12:39 +00:00
Philippe Waroquiers
e2ba2f3671 add heuristics decreasing false possible "possible leaks" in c++ code.
The option --leak-check-heuristics=heur1,heur2,... can activate
various heuristics to decrease the number of false positive
"possible leaks" for C++ code. The available heuristics are
detecting valid interior pointers to std::stdstring, to new[] allocated
arrays with elements having destructors and to interior pointers pointing
to an inner part of a C++ object using multiple inheritance.

This fixes 280271 Valgrind reports possible memory leaks on still-reachable
std::string 

This has been tested on x86/amd64/ppc32/ppc64.

First performance measurements seems to show a neglectible impact on
the leak search.

More feedback welcome both on performance and functional aspects
(false positive 'possibly leaked' rate decrease and/or 
false negative 'possibly leaked' rate increase).

Note that the heuristic is not checking that the memory has been
allocated with "new" or "new[]", as it is expected that in some cases,
specific alloc fn are used for c++ objects instead of the standard new/new[].
If needed, we might add an option to check the alloc functions
to be new/new[].



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13582
2013-09-29 13:47:32 +00:00
Philippe Waroquiers
6e3bb2af58 Fix 324514 gdbserver monitor cmd output behaviour consistency + allow user
to put a "marker" msg in process log output

* v.info n_errs_found accepts optional msg, added in the output of
   the monitor command.

* use VG_(printf) rather than VG_(gdb_printf) when output of command
  should be redirected according to v.set gdb_output|log_output|mixed_output

* also avoid calling gdb_printf in output sink processing
  to output zero bytes, as gdb_printf expects to have a null terminated
  string, which is not ensured when 0 bytes have to be output.

* some minor reformatting (replace char* xxx by char *xxx).




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13532
2013-09-04 21:42:43 +00:00
Philippe Waroquiers
d4d5d3790b add a test + assert for GDB bug bypassed in r13472
* modify mcwatchpoints to print a 50000 char array
* add an assert to check the max allowed size



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13476
2013-07-30 20:26:06 +00:00
Dejan Jevtic
3abde5b717 mips64: Wrong address size.
On MIPS64 address of 'undefined' can be 64-bit width.
When we are trying to access that address we need to use 0x%lx
instead of 0x%x.
Fixes gdbserver_tests/mcvabits for MIPS64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13457
2013-07-17 09:56:24 +00:00
Philippe Waroquiers
2ce4aedfab fix 319235 --db-attach=yes is broken with Yama ptrace scoping enabled
On Ubuntu systems, ptrace_scoping could forbid a process to ptrace another.
This ptrace scoping was already handled for vgdb by using SET_PTRACER
(the valgrind process must be ptraced by vgdb when it is blocked
in a syscall).
set_ptracer is however also needed when the old mechanism --db-attach=yes
is used.
The following changes are done:
* make the set_ptracer logic callable outside gdbserver
* make set_ptracer less restrictive (i.e. allow all
  processes of the user to ptrace). This removes a limitation for vgdb.
* call the set_ptracer in the child launched for --db-attach=yes
* cleaned up the ptrace scope restriction message and doc as vgdb
  is now working properly by default, even with ptrace_scope enabled.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13384
2013-05-09 21:29:23 +00:00
Philippe Waroquiers
ec83134fa2 fix 315545 (find_TTEntry_from_hcode): Assertion '(UChar*)sec->tt[tteNo].tcptr <= (UChar*)hcode' failed
Assertion 
  valgrind: m_transtab.c:674 (find_TTEntry_from_hcode):
  Assertion '(UChar*)sec->tt[tteNo].tcptr <= (UChar*)hcode' failed.
failure (encountered on some platforms while running gdbsrv tests).

The problem is related to invalidated entries and the host_extents
mapping between hostcode and the translation table entry.

The problem: when an entry is invalidated, the translation table
entry is changed to status Deleted. However, the host extent array
element is not cleaned up.
If a search for a host code address (find_TTEntry_from_hcode)
finds this entry, the translation table entry in Deleted status
is considered as a 'not found', which ensures that the invalidated
entry is not used (e.g. for chaining).
This is all ok.

However, it might be that this Deleted entry is re-used
(see function VG_(add_to_transtab), searching for a Empty
or Deleted entry.
If the Deleted entry is re-used, then a search for the
dead host code can give a result pointing to the re-used
entry. That is clearly wrong.
Note that it is unclear if this bug can only be triggered
while using gdbsrv or if this bug can be triggered with
just the "normal" invalidation logic of translation.
gdbsrv being a heavy "user" of invalidation, it might
be it helps to trigger the code. Alternatively, as gdbsrv
invalidation is special (e.g. invalidation of some entries
is done during translation of other entries), it might be
the bug is specific to gdbsrv.

In any case, to avoid the bug:
searching for an host code address must not only
ignore Deleted entries, but must also ignore an entry
found via a host_extent element which is for a Deleted
entry that was re-used afterwards (pointed to by a
newer host_extent element).


Multiple solutions are possible for fixing the bug:
Sol1: cleanup the host_extents array when an entry is deleted.
  The cleanup is however deemed costly:
  Each invalidate operation must do a search in the host_extents.
  The host_extents array must then be "compacted" to remove
  the "dead" host extent element from the array.
  The compact operation can be avoided if instead of removing
  the element, one marks instead the element as "dead"
  e.g. by using one bit of UInt len for that:
     UInt len : 31;
     Bool dead : 1;
  This avoids the compact, but still incurrs the cost of
  search and modify the host_extent for each entry invalidated.
  Invalidating entries seems to be a critical operation
  (e.g. specific ECLASS related  data structures have been
   done to allow fast deletion).
  => it is deemed that a solution not incurring cost during
  invaliation is preferrable.

* Sol 2: detect in find_TTEntry_from_hcode
  that the host_extent element is re-used, and handle it similarly
  to an host_extents which points at a Deleted entry.
  This detection is possible as if an entry is re-used after
  having been deleted, this implies that its host code will be
  after the end of the host code of the deleted entry
  (as host code of a sector is not re-used).
  The attached patch implements this solution.

* Sol 3: avoid re-using an entry : the entry would then stay
  in Deleted state. This is deemed not ok as it would
  imply that invalidation of entries will cause a sector to
  become full faster.

The patch:
* adds a new function
  Bool HostExtent__is_dead (const HostExtent* hx, const Sector* sec)
  telling if the host extent hx from sector sec is a dead entry.
* this function is used in find_TTEntry_from_hcode so that
  dead host extents are not resulting in host code to be found.
* adds a regression test which caused the assert failure before
  (bug was found/reported/isolated in a small test case by Dejan Jevtic).
* To check the logic of HostExtent__is_dead, m_transtab.c sanity check is
  completed to verify that the nr of entries in use in a sector is equal
  to the nr of non dead entries in the host extent array.
* adds/improves traces in m_transtab.c (enabled at compile
  time using #define DEBUG_TRANSTAB).
  Some already existing 'if (0)' conditions are replaced
  by if (DEBUG_TRANSTAB)

Regression tested on 
   f12/x86
   debian6/amd64 (also with export EXTRA_REGTEST_OPTS=--sanity-level=4)




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13290
2013-02-24 23:16:58 +00:00
Philippe Waroquiers
d9a9aa9786 Implement the gdbsrv monitor command v.do expensive_sanity_check_general
(useful to check the sanity of valgrind on request and/or from GDB,
when an error is reported by the tool).
Also re-order the NEWS entries to put the internals things after
the user level new functions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13262
2013-01-23 22:10:28 +00:00
Philippe Waroquiers
6fb1158a78 Implement --merge-recursive-frames + provide VALGRIND_MONITOR_COMMAND client req.
In a big applications, some recursive algorithms have created
hundreds of thousands of stacktraces, taking a lot of memory.

Option --merge-recursive-frames=<number> tells Valgrind to
detect and merge (collapse) recursive calls when recording stack traces.
The value is changeable using the monitor command
'v.set merge-recursive-frames'.

Also, this provides a new client request: VALGRIND_MONITOR_COMMAND
allowing to execute a gdbsrv monitor command from the client
program.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13246
2013-01-20 17:11:58 +00:00
Philippe Waroquiers
dd96336e7f update a test following revision 13220
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13221
2013-01-10 22:35:33 +00:00
Philippe Waroquiers
1618b44d28 Fix 284540 and 307465
284540 Memcheck shouldn't count suppressions matching still-reachable allocations
307465 --show-possibly-lost=no should bring down the error count / exit code

Using the options --show-leak-kinds=kind1,kind2,.. and
--errors-for-leak-kinds=kind1,kind2,.., each leak kind (definite, indirect,
possible, reachable) can now be individually reported and/or counted as
an error.
In a leak suppression entry, an optional line 'match-leak-kinds:'
controls which leak kinds are suppressed by this entry.
This is a.o. useful to avoid definite leaks being "catched"
by a suppression entry aimed at suppressing possibly lost blocks.
Default behaviour is the same as 3.8.1

Old args (--show-reachable and --show-possibly-lost) are still accepted.

Addition of a new test (memcheck/tests/lks) testing the new args
and the new suppression line.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13170
2012-12-08 17:54:16 +00:00
Philippe Waroquiers
0df0a2725c Fix 308644 vgdb command for having the info for the track-fds option
(allows to have the list of opened fds and the associated info
on request from GDB or from the shell, using vgdb)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13072
2012-10-21 14:37:14 +00:00
Philippe Waroquiers
aff39b640c Fix 308341 vgdb should report process exit (or fatal signal)
patch from Mark Wielaard.
(with small modifications).
Also clarified some comments related to the resume reply.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13052
2012-10-17 21:32:03 +00:00
Philippe Waroquiers
bc8e05a56e fix 308321 testsuite memcheck filter interferes with gdb_filter
Patch from Mark Wielaard.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13043
2012-10-14 18:16:41 +00:00
Philippe Waroquiers
8783c37469 fix 307155 filter_gdb should filter out syscall-template.S T_PSEUDO
With some glibc version (e.g. on fedora 16), gdb output contains
a line with T_PSEUDO which should be filtered out.

Patch from Mark Wielaard.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13013
2012-09-24 21:12:41 +00:00
Philippe Waroquiers
63c4b7e167 Use -s USR1 instead of -10 to send SIGUSR1 signal
On mips32, 10 is SIGBUS. This was making all tests using
simulate_control_c looping for ever or a long time.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12873
2012-08-15 13:27:23 +00:00
Philippe Waroquiers
36ca11463d Remove --vex-iropt-precise-memory-exns, implement --vex-iropt-register-updates
* Option --vex-iropt-precise-memory-exns has been removed.
  It is replaced by --vex-iropt-register-updates which accepts
  3 values : 'unwindregs-at-mem-access' (replacing
  --vex-iropt-precise-memory-exns=no), 'allregs-at-mem-access'
  (replacing --vex-iropt-precise-memory-exns=yes)
  and a new value 'allregs-at-each-insn'.
  'allregs-at-each-insn' allows the Valgrind gdbserver to always
  show up to date values to GDB.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12809
2012-08-01 22:03:12 +00:00