You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(5) |
3
(2) |
4
(8) |
5
(10) |
|
6
(3) |
7
(9) |
8
(7) |
9
(8) |
10
(7) |
11
(4) |
12
(11) |
|
13
(5) |
14
(17) |
15
(6) |
16
(15) |
17
|
18
(3) |
19
(1) |
|
20
(6) |
21
(18) |
22
(5) |
23
(9) |
24
(6) |
25
(3) |
26
(1) |
|
27
(1) |
28
|
29
(8) |
30
(5) |
|
|
|
|
From: <sv...@va...> - 2015-09-02 21:58:02
|
Author: philippe
Date: Wed Sep 2 22:57:53 2015
New Revision: 15618
Log:
- The default value for --leak-check-heuristics has been changed from
"none" to "all". This helps to reduce the number of possibly
lost blocks, in particular for C++ applications.
Modified:
trunk/NEWS
trunk/memcheck/docs/mc-manual.xml
trunk/memcheck/mc_include.h
trunk/memcheck/mc_main.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Sep 2 22:57:53 2015
@@ -32,6 +32,9 @@
* ==================== TOOL CHANGES ====================
* Memcheck:
+ - The default value for --leak-check-heuristics has been changed from
+ "none" to "all". This helps to reduce the number of possibly
+ lost blocks, in particular for C++ applications.
- The default value for --keep-stacktraces has been changed from
"malloc-then-free" to "malloc-and-free". This has a small cost in
Modified: trunk/memcheck/docs/mc-manual.xml
==============================================================================
--- trunk/memcheck/docs/mc-manual.xml (original)
+++ trunk/memcheck/docs/mc-manual.xml Wed Sep 2 22:57:53 2015
@@ -811,7 +811,7 @@
<varlistentry id="opt.leak-check-heuristics" xreflabel="--leak-check-heuristics">
<term>
- <option><![CDATA[--leak-check-heuristics=<set> [default: none] ]]></option>
+ <option><![CDATA[--leak-check-heuristics=<set> [default: all] ]]></option>
</term>
<listitem>
<para>Specifies the set of leak check heuristics to be used
Modified: trunk/memcheck/mc_include.h
==============================================================================
--- trunk/memcheck/mc_include.h (original)
+++ trunk/memcheck/mc_include.h Wed Sep 2 22:57:53 2015
@@ -642,7 +642,7 @@
#define HiS(h,s) ((s) & H2S(h))
/* Heuristics set to use for the leak search.
- Default : no heuristic. */
+ Default : all heuristics. */
extern UInt MC_(clo_leak_check_heuristics);
/* Assume accesses immediately below %esp are due to gcc-2.96 bugs.
Modified: trunk/memcheck/mc_main.c
==============================================================================
--- trunk/memcheck/mc_main.c (original)
+++ trunk/memcheck/mc_main.c Wed Sep 2 22:57:53 2015
@@ -5699,7 +5699,10 @@
VgRes MC_(clo_leak_resolution) = Vg_HighRes;
UInt MC_(clo_show_leak_kinds) = R2S(Possible) | R2S(Unreached);
UInt MC_(clo_error_for_leak_kinds) = R2S(Possible) | R2S(Unreached);
-UInt MC_(clo_leak_check_heuristics) = 0;
+UInt MC_(clo_leak_check_heuristics) = H2S(LchStdString)
+ | H2S( LchLength64)
+ | H2S( LchNewArray)
+ | H2S( LchMultipleInheritance);
Bool MC_(clo_workaround_gcc296_bugs) = False;
Int MC_(clo_malloc_fill) = -1;
Int MC_(clo_free_fill) = -1;
@@ -5879,7 +5882,7 @@
" where kind is one of:\n"
" definite indirect possible reachable all none\n"
" --leak-check-heuristics=heur1,heur2,... which heuristics to use for\n"
-" improving leak search false positive [none]\n"
+" improving leak search false positive [all]\n"
" where heur is one of:\n"
" stdstring length64 newarray multipleinheritance all none\n"
" --show-reachable=yes same as --show-leak-kinds=all\n"
|
Author: philippe
Date: Wed Sep 2 22:26:34 2015
New Revision: 15617
Log:
Enhance block_list memcheck gdbserver monitor command
Due to the (still to be done) default activation of --leak-check-heuristics=all,
improve the block_list monitor command for easier display of blocks
found reachable via heuristics.
Modified:
trunk/NEWS
trunk/gdbserver_tests/mchelp.stdoutB.exp
trunk/memcheck/docs/mc-manual.xml
trunk/memcheck/mc_include.h
trunk/memcheck/mc_leakcheck.c
trunk/memcheck/mc_main.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Sep 2 22:26:34 2015
@@ -48,10 +48,14 @@
than get_vbits when you need to associate byte data value with
their corresponding validity bits.
- - The 'block_list' monitor command now accepts an optional argument
- 'limited <max_blocks>' to control the nr of block addresses
- printed. Also, if a block has been found using an heuristic, then
- 'block_list' will now show the heuristic after the block size.
+ - The 'block_list' monitor command has been enhanced:
+ o it can print a range of loss records
+ o it now accepts an optional argument 'limited <max_blocks>'
+ to control the nr of block printed.
+ o if a block has been found using an heuristic, then
+ 'block_list' now shows the heuristic after the block size.
+ o the loss records/blocks to print can be limited to the blocks
+ found via specified heuristics.
- The C helper functions used to instrument loads on x86-linux and
arm-linux (both 32-bit only) have been replaced by handwritten
Modified: trunk/gdbserver_tests/mchelp.stdoutB.exp
==============================================================================
--- trunk/gdbserver_tests/mchelp.stdoutB.exp (original)
+++ trunk/gdbserver_tests/mchelp.stdoutB.exp Wed Sep 2 22:26:34 2015
@@ -41,8 +41,12 @@
leak_check summary any
leak_check full kinds indirect,possible
leak_check full reachable any limited 100
- block_list <loss_record_nr> [unlimited*|limited <max_blocks>]
+ block_list <loss_record_nr>|<loss_record_nr_from>..<loss_record_nr_to>
+ [unlimited*|limited <max_blocks>]
+ [heuristics heur1,heur2,...]
after a leak search, shows the list of blocks of <loss_record_nr>
+ (or of the range <loss_record_nr_from>..<loss_record_nr_to>).
+ With heuristics, only shows the blocks found via heur1,heur2,...
* = defaults
who_points_at <addr> [<len>]
shows places pointing inside <len> (default 1) bytes at <addr>
@@ -106,8 +110,12 @@
leak_check summary any
leak_check full kinds indirect,possible
leak_check full reachable any limited 100
- block_list <loss_record_nr> [unlimited*|limited <max_blocks>]
+ block_list <loss_record_nr>|<loss_record_nr_from>..<loss_record_nr_to>
+ [unlimited*|limited <max_blocks>]
+ [heuristics heur1,heur2,...]
after a leak search, shows the list of blocks of <loss_record_nr>
+ (or of the range <loss_record_nr_from>..<loss_record_nr_to>).
+ With heuristics, only shows the blocks found via heur1,heur2,...
* = defaults
who_points_at <addr> [<len>]
shows places pointing inside <len> (default 1) bytes at <addr>
Modified: trunk/memcheck/docs/mc-manual.xml
==============================================================================
--- trunk/memcheck/docs/mc-manual.xml (original)
+++ trunk/memcheck/docs/mc-manual.xml Wed Sep 2 22:26:34 2015
@@ -1903,12 +1903,19 @@
</listitem>
<listitem>
- <para><varname>block_list <loss_record_nr>
- [unlimited*|limited <max_blocks>]</varname>
- shows the list of blocks belonging to <loss_record_nr>.
+ <para><varname>block_list <loss_record_nr>|<loss_record_nr_from>..<loss_record_nr_to>
+ [unlimited*|limited <max_blocks>]
+ [heuristics heur1,heur2,...]
+ </varname>
+ shows the list of blocks belonging to
+ <varname><loss_record_nr></varname> (or to the loss records range
+ <varname><loss_record_nr_from>..<loss_record_nr_to></varname>).
The nr of blocks to print can be controlled using the
<varname>limited</varname> argument followed by the maximum nr
of blocks to output.
+ If one or more heuristics are given, only prints the loss records
+ and blocks found via one of the given <varname>heur1,heur2,...</varname>
+ heuristics.
</para>
<para> A leak search merges the allocated blocks in loss records :
Modified: trunk/memcheck/mc_include.h
==============================================================================
--- trunk/memcheck/mc_include.h (original)
+++ trunk/memcheck/mc_include.h Wed Sep 2 22:26:34 2015
@@ -460,11 +460,16 @@
// maintains the lcp.deltamode given in the last call to detect_memory_leaks
extern LeakCheckDeltaMode MC_(detect_memory_leaks_last_delta_mode);
-// prints the list of blocks corresponding to the given loss_record_nr.
-// (up to maximum max_blocks)
-// Returns True if loss_record_nr identifies a correct loss record from last
-// leak search, returns False otherwise.
-Bool MC_(print_block_list) ( UInt loss_record_nr, UInt max_blocks);
+// prints the list of blocks corresponding to the given loss_record_nr slice
+// (from/to) (up to maximum max_blocks)
+// Returns True if loss_record_nr_from identifies a correct loss record
+// from last leak search, returns False otherwise.
+// Note that loss_record_nr_to can be bigger than the nr of loss records. All
+// loss records after from will then be examined and maybe printed.
+// If heuristics != 0, print only the loss records/blocks found via
+// one of the heuristics in the set.
+Bool MC_(print_block_list) ( UInt loss_record_nr_from, UInt loss_record_nr_to,
+ UInt max_blocks, UInt heuristics);
// Prints the addresses/registers/... at which a pointer to
// the given range [address, address+szB[ is found.
Modified: trunk/memcheck/mc_leakcheck.c
==============================================================================
--- trunk/memcheck/mc_leakcheck.c (original)
+++ trunk/memcheck/mc_leakcheck.c Wed Sep 2 22:26:34 2015
@@ -1544,10 +1544,15 @@
}
}
-Bool MC_(print_block_list) ( UInt loss_record_nr, UInt max_blocks)
+Bool MC_(print_block_list) ( UInt loss_record_nr_from,
+ UInt loss_record_nr_to,
+ UInt max_blocks,
+ UInt heuristics)
{
+ UInt loss_record_nr;
UInt i, n_lossrecords;
LossRecord* lr;
+ Bool lr_printed;
UInt remaining = max_blocks;
if (lr_table == NULL || lc_chunks == NULL || lc_extras == NULL) {
@@ -1561,52 +1566,75 @@
}
n_lossrecords = VG_(OSetGen_Size)(lr_table);
- if (loss_record_nr >= n_lossrecords)
- return False; // Invalid loss record nr.
+ if (loss_record_nr_from >= n_lossrecords)
+ return False; // Invalid starting loss record nr.
+
+ if (loss_record_nr_to >= n_lossrecords)
+ loss_record_nr_to = n_lossrecords - 1;
tl_assert (lr_array);
- lr = lr_array[loss_record_nr];
+
+ for (loss_record_nr = loss_record_nr_from;
+ loss_record_nr <= loss_record_nr_to && remaining > 0;
+ loss_record_nr++) {
+ lr = lr_array[loss_record_nr];
+ lr_printed = False;
+
+ /* If user asks to print a specific loss record, we print
+ the block details, even if no block will be shown for this lr.
+ If user asks to print a range of lr, we only print lr details
+ when at least one block is shown. */
+ if (loss_record_nr_from == loss_record_nr_to) {
+ /* (+1 on loss_record_nr as user numbering for loss records
+ starts at 1). */
+ MC_(pp_LossRecord)(loss_record_nr+1, n_lossrecords, lr);
+ lr_printed = True;
+ }
- // (re-)print the loss record details.
- // (+1 on loss_record_nr as user numbering for loss records starts at 1).
- MC_(pp_LossRecord)(loss_record_nr+1, n_lossrecords, lr);
-
- // Match the chunks with loss records.
- for (i = 0; i < lc_n_chunks && remaining > 0; i++) {
- MC_Chunk* ch = lc_chunks[i];
- LC_Extra* ex = &(lc_extras)[i];
- LossRecord* old_lr;
- LossRecordKey lrkey;
- lrkey.state = ex->state;
- lrkey.allocated_at = MC_(allocated_at)(ch);
-
- old_lr = VG_(OSetGen_Lookup)(lr_table, &lrkey);
- if (old_lr) {
- // We found an existing loss record matching this chunk.
- // If this is the loss record we are looking for, output the pointer.
- if (old_lr == lr_array[loss_record_nr]) {
- if (ex->heuristic)
- VG_(umsg)("%p[%lu] (found via heuristic %s)\n",
- (void *)ch->data, (SizeT)ch->szB,
- pp_heuristic (ex->heuristic));
- else
- VG_(umsg)("%p[%lu]\n",
- (void *)ch->data, (SizeT)ch->szB);
- remaining--;
- if (ex->state != Reachable) {
- // We can print the clique in all states, except Reachable.
- // In Unreached state, lc_chunk[i] is the clique leader.
- // In IndirectLeak, lc_chunk[i] might have been a clique leader
- // which was later collected in another clique.
- // For Possible, lc_chunk[i] might be the top of a clique
- // or an intermediate clique.
- print_clique(i, 1, &remaining);
+ // Match the chunks with loss records.
+ for (i = 0; i < lc_n_chunks && remaining > 0; i++) {
+ MC_Chunk* ch = lc_chunks[i];
+ LC_Extra* ex = &(lc_extras)[i];
+ LossRecord* old_lr;
+ LossRecordKey lrkey;
+ lrkey.state = ex->state;
+ lrkey.allocated_at = MC_(allocated_at)(ch);
+
+ old_lr = VG_(OSetGen_Lookup)(lr_table, &lrkey);
+ if (old_lr) {
+ // We found an existing loss record matching this chunk.
+ // If this is the loss record we are looking for, output the
+ // pointer.
+ if (old_lr == lr_array[loss_record_nr]
+ && (heuristics == 0 || HiS(ex->heuristic, heuristics))) {
+ if (!lr_printed) {
+ MC_(pp_LossRecord)(loss_record_nr+1, n_lossrecords, lr);
+ lr_printed = True;
+ }
+
+ if (ex->heuristic)
+ VG_(umsg)("%p[%lu] (found via heuristic %s)\n",
+ (void *)ch->data, (SizeT)ch->szB,
+ pp_heuristic (ex->heuristic));
+ else
+ VG_(umsg)("%p[%lu]\n",
+ (void *)ch->data, (SizeT)ch->szB);
+ remaining--;
+ if (ex->state != Reachable) {
+ // We can print the clique in all states, except Reachable.
+ // In Unreached state, lc_chunk[i] is the clique leader.
+ // In IndirectLeak, lc_chunk[i] might have been a clique
+ // leader which was later collected in another clique.
+ // For Possible, lc_chunk[i] might be the top of a clique
+ // or an intermediate clique.
+ print_clique(i, 1, &remaining);
+ }
}
+ } else {
+ // No existing loss record matches this chunk ???
+ VG_(umsg)("error: no loss record found for %p[%lu]?????\n",
+ (void *)ch->data, (SizeT)ch->szB);
}
- } else {
- // No existing loss record matches this chunk ???
- VG_(umsg)("error: no loss record found for %p[%lu]?????\n",
- (void *)ch->data, (SizeT)ch->szB);
}
}
return True;
Modified: trunk/memcheck/mc_main.c
==============================================================================
--- trunk/memcheck/mc_main.c (original)
+++ trunk/memcheck/mc_main.c Wed Sep 2 22:26:34 2015
@@ -6032,8 +6032,12 @@
" leak_check summary any\n"
" leak_check full kinds indirect,possible\n"
" leak_check full reachable any limited 100\n"
-" block_list <loss_record_nr> [unlimited*|limited <max_blocks>]\n"
+" block_list <loss_record_nr>|<loss_record_nr_from>..<loss_record_nr_to>\n"
+" [unlimited*|limited <max_blocks>]\n"
+" [heuristics heur1,heur2,...]\n"
" after a leak search, shows the list of blocks of <loss_record_nr>\n"
+" (or of the range <loss_record_nr_from>..<loss_record_nr_to>).\n"
+" With heuristics, only shows the blocks found via heur1,heur2,...\n"
" * = defaults\n"
" who_points_at <addr> [<len>]\n"
" shows places pointing inside <len> (default 1) bytes at <addr>\n"
@@ -6064,6 +6068,81 @@
VG_(printf) ("\n"); // Terminate previous line
}
+
+/* Returns the address of the next non space character,
+ or address of the string terminator. */
+static HChar* next_non_space (HChar *s)
+{
+ while (*s && *s == ' ')
+ s++;
+ return s;
+}
+
+/* Parse an integer slice, i.e. a single integer or a range of integer.
+ Syntax is:
+ <integer>[..<integer> ]
+ (spaces are allowed before and/or after ..).
+ Return True if range correctly parsed, False otherwise. */
+static Bool VG_(parse_slice) (HChar* s, HChar** saveptr,
+ UInt *from, UInt *to)
+{
+ HChar* wl;
+ HChar *endptr;
+ endptr = NULL;////
+ wl = VG_(strtok_r) (s, " ", saveptr);
+
+ /* slice must start with an integer. */
+ if (wl == NULL) {
+ VG_(gdb_printf) ("expecting integer or slice <from>..<to>\n");
+ return False;
+ }
+ *from = VG_(strtoull10) (wl, &endptr);
+ if (endptr == wl) {
+ VG_(gdb_printf) ("invalid integer or slice <from>..<to>\n");
+ return False;
+ }
+
+ if (*endptr == '\0' && *next_non_space(*saveptr) != '.') {
+ /* wl token is an integer terminating the string
+ or else next token does not start with .
+ In both cases, the slice is a single integer. */
+ *to = *from;
+ return True;
+ }
+
+ if (*endptr == '\0') {
+ // iii .. => get the next token
+ wl = VG_(strtok_r) (NULL, " .", saveptr);
+ } else {
+ // It must be iii..
+ if (*endptr != '.' && *(endptr+1) != '.') {
+ VG_(gdb_printf) ("expecting slice <from>..<to>\n");
+ return False;
+ }
+ if ( *(endptr+2) == ' ') {
+ // It must be iii.. jjj => get the next token
+ wl = VG_(strtok_r) (NULL, " .", saveptr);
+ } else {
+ // It must be iii..jjj
+ wl = endptr+2;
+ }
+ }
+
+ *to = VG_(strtoull10) (wl, &endptr);
+ if (*endptr != '\0') {
+ VG_(gdb_printf) ("missing/wrong 'to' of slice <from>..<to>\n");
+ return False;
+ }
+
+ if (*from > *to) {
+ VG_(gdb_printf) ("<from> cannot be bigger than <to> "
+ "in slice <from>..<to>\n");
+ return False;
+ }
+
+ return True;
+}
+
/* return True if request recognised, False otherwise */
static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
{
@@ -6316,22 +6395,19 @@
case 5: { /* block_list */
HChar* wl;
- HChar *endptr;
HChar *the_end;
- UInt lr_nr = 0;
+ UInt lr_nr_from = 0;
+ UInt lr_nr_to = 0;
- wl = VG_(strtok_r) (NULL, " ", &ssaveptr);
- if (wl != NULL)
- lr_nr = VG_(strtoull10) (wl, &endptr);
- if (wl == NULL || *endptr != '\0') {
- VG_(gdb_printf) ("malformed or missing integer\n");
- } else {
- UInt limit_blocks;
+ if (VG_(parse_slice) (NULL, &ssaveptr, &lr_nr_from, &lr_nr_to)) {
+ UInt limit_blocks = 999999999;
Int int_value;
-
- wl = VG_(strtok_r) (NULL, " ", &ssaveptr);
- if (wl != NULL) {
- switch (VG_(keyword_id) ("unlimited limited ",
+ UInt heuristics = 0;
+
+ for (wl = VG_(strtok_r) (NULL, " ", &ssaveptr);
+ wl != NULL;
+ wl = VG_(strtok_r) (NULL, " ", &ssaveptr)) {
+ switch (VG_(keyword_id) ("unlimited limited heuristics ",
wl, kwd_report_all)) {
case -2: return True;
case -1: return True;
@@ -6355,15 +6431,27 @@
}
limit_blocks = (UInt) int_value;
break;
+ case 2: /* heuristics */
+ wcmd = VG_(strtok_r) (NULL, " ", &ssaveptr);
+ if (wcmd == NULL
+ || !VG_(parse_enum_set)(MC_(parse_leak_heuristics_tokens),
+ True,/*allow_all*/
+ wcmd,
+ &heuristics)) {
+ VG_(gdb_printf) ("missing or malformed heuristics set\n");
+ return True;
+ }
+ break;
default:
tl_assert (0);
}
- } else {
- limit_blocks = 999999999;
}
- /* lr_nr-1 as what is shown to the user is 1 more than the index
- in lr_array. */
- if (lr_nr == 0 || ! MC_(print_block_list) (lr_nr-1, limit_blocks))
+ /* substract 1 from lr_nr_from/lr_nr_to as what is shown to the user
+ is 1 more than the index in lr_array. */
+ if (lr_nr_from == 0 || ! MC_(print_block_list) (lr_nr_from-1,
+ lr_nr_to-1,
+ limit_blocks,
+ heuristics))
VG_(gdb_printf) ("invalid loss record nr\n");
}
return True;
|
|
From: <sv...@va...> - 2015-09-02 15:47:41
|
Author: florian
Date: Wed Sep 2 16:47:33 2015
New Revision: 15616
Log:
Suppress unwanted clang 3.7 warnings.
Fix undefined behaviour in perf/tinycc.c
Modified:
trunk/configure.ac
trunk/drd/tests/Makefile.am
trunk/memcheck/tests/Makefile.am
trunk/none/tests/linux/Makefile.am
trunk/perf/tinycc.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Sep 2 16:47:33 2015
@@ -1887,6 +1887,8 @@
AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
+AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
+AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
@@ -2514,6 +2516,10 @@
do {
asm ("bndmov %bnd0,(%rsp)");
asm ("bndldx 3(%rbx,%rdx), %bnd2");
+ asm ("bnd call foo\n"
+ bnd jmp end\n"
+ foo: bnd ret\n"
+ end: nop");
} while (0)
]])], [
ac_have_as_mpx=yes
Modified: trunk/drd/tests/Makefile.am
==============================================================================
--- trunk/drd/tests/Makefile.am (original)
+++ trunk/drd/tests/Makefile.am Wed Sep 2 16:47:33 2015
@@ -453,6 +453,7 @@
concurrent_close_SOURCES = concurrent_close.cpp
monitor_example_SOURCES = monitor_example.cpp
new_delete_SOURCES = new_delete.cpp
+new_delete_CXXFLAGS = $(AM_CXXFLAGS) @FLAG_W_NO_MISMATCHED_NEW_DELETE@
free_is_write_CFLAGS = $(AM_CFLAGS)
pth_barrier_CFLAGS = $(AM_CFLAGS)
Modified: trunk/memcheck/tests/Makefile.am
==============================================================================
--- trunk/memcheck/tests/Makefile.am (original)
+++ trunk/memcheck/tests/Makefile.am Wed Sep 2 16:47:33 2015
@@ -462,6 +462,7 @@
memcmptest_CFLAGS = $(AM_CFLAGS) -fno-builtin-memcmp
mismatches_SOURCES = mismatches.cpp
+mismatches_CXXFLAGS = $(AM_CXXFLAGS) @FLAG_W_NO_MISMATCHED_NEW_DELETE@
new_nothrow_SOURCES = new_nothrow.cpp
new_override_SOURCES = new_override.cpp
Modified: trunk/none/tests/linux/Makefile.am
==============================================================================
--- trunk/none/tests/linux/Makefile.am (original)
+++ trunk/none/tests/linux/Makefile.am Wed Sep 2 16:47:33 2015
@@ -37,4 +37,5 @@
# Special needs
pthread_stack_LDADD = -lpthread
-stack_overflow_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@
+stack_overflow_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ \
+ @FLAG_W_NO_INFINITE_RECURSION@
Modified: trunk/perf/tinycc.c
==============================================================================
--- trunk/perf/tinycc.c (original)
+++ trunk/perf/tinycc.c Wed Sep 2 16:47:33 2015
@@ -10433,7 +10433,7 @@
bit_pos = (vtop->type.t >> VT_STRUCT_SHIFT) & 0x3f;
bit_size = (vtop->type.t >> (VT_STRUCT_SHIFT + 6)) & 0x3f;
/* remove bit field info to avoid loops */
- vtop->type.t &= ~(VT_BITFIELD | (-1 << VT_STRUCT_SHIFT));
+ vtop->type.t &= ~(VT_BITFIELD | (~0U << VT_STRUCT_SHIFT));
/* generate shifts */
vpushi(32 - (bit_pos + bit_size));
gen_op(TOK_SHL);
@@ -11930,7 +11930,7 @@
bit_pos = (ft >> VT_STRUCT_SHIFT) & 0x3f;
bit_size = (ft >> (VT_STRUCT_SHIFT + 6)) & 0x3f;
/* remove bit field info to avoid loops */
- vtop[-1].type.t = ft & ~(VT_BITFIELD | (-1 << VT_STRUCT_SHIFT));
+ vtop[-1].type.t = ft & ~(VT_BITFIELD | (~0U << VT_STRUCT_SHIFT));
/* duplicate destination */
vdup();
|
|
From: <sv...@va...> - 2015-09-02 15:46:12
|
Author: florian
Date: Wed Sep 2 16:46:05 2015
New Revision: 3182
Log:
Fix undefined behaviours (left shifting a negative value)
as pointed out by clang 3.7
Modified:
trunk/priv/guest_ppc_toIR.c
Modified: trunk/priv/guest_ppc_toIR.c
==============================================================================
--- trunk/priv/guest_ppc_toIR.c (original)
+++ trunk/priv/guest_ppc_toIR.c Wed Sep 2 16:46:05 2015
@@ -1710,12 +1710,12 @@
static IRExpr* addr_align( IRExpr* addr, UChar align )
{
IRType ty = mode64 ? Ity_I64 : Ity_I32;
- Long mask;
+ ULong mask;
switch (align) {
case 1: return addr; // byte aligned
- case 2: mask = ((Long)-1) << 1; break; // half-word aligned
- case 4: mask = ((Long)-1) << 2; break; // word aligned
- case 16: mask = ((Long)-1) << 4; break; // quad-word aligned
+ case 2: mask = ~0ULL << 1; break; // half-word aligned
+ case 4: mask = ~0ULL << 2; break; // word aligned
+ case 16: mask = ~0ULL << 4; break; // quad-word aligned
default:
vex_printf("addr_align: align = %u\n", align);
vpanic("addr_align(ppc)");
|
|
From: <sv...@va...> - 2015-09-02 15:43:40
|
Author: mjw
Date: Wed Sep 2 16:43:31 2015
New Revision: 15615
Log:
Bug 351873 Newer gcc doesn't allow __builtin_tabortdc[i] in ppc32 mode.
Modified:
trunk/NEWS
trunk/none/tests/ppc64/test_touch_tm.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Sep 2 16:43:31 2015
@@ -362,6 +362,7 @@
351534 Fix incorrect header guard
351756 Intercept platform_memchr$VARIANT$Haswell on OS X
351858 ldsoexec support on Solaris
+351873 Newer gcc doesn't allow __builtin_tabortdc[i] in ppc32 mode
n-i-bz Provide implementations of certain compiler builtins to support
compilers that may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Modified: trunk/none/tests/ppc64/test_touch_tm.c
==============================================================================
--- trunk/none/tests/ppc64/test_touch_tm.c (original)
+++ trunk/none/tests/ppc64/test_touch_tm.c Wed Sep 2 16:43:31 2015
@@ -8,8 +8,10 @@
* The rest are just treated as NOPS.
*/
__builtin_tabort (0);
+#ifdef __PPC64__
__builtin_tabortdc (0,0,0);
__builtin_tabortdci (0,0,0);
+#endif
__builtin_tabortwc (0,0,0);
__builtin_tabortwci (0,0,0);
__builtin_tbegin (0);
|