Author: florian
Date: Tue Sep 30 23:15:05 2014
New Revision: 14595
Log:
Merge six easy pieces from the BUF_REMOVAL branch:
r14271 Audit a few buffer sizes, increase one.
r14280 Audit buffer size.
r14296 Remove a few unneeded header files.
r14310 Replace fixed size buffers with a large enough buffers.
r14338 Remove a dead assignment in print_bbcs and make global variable
print_fd a local variable.
r14359 Remove a benign macro redefinition in cachegrind.
Modified:
trunk/ (props changed)
trunk/cachegrind/cg_main.c
trunk/cachegrind/cg_sim.c
trunk/callgrind/callstack.c
trunk/callgrind/dump.c
trunk/drd/drd_clientreq.c
trunk/drd/drd_main.c
trunk/exp-dhat/dh_main.c
Modified: trunk/cachegrind/cg_main.c
==============================================================================
--- trunk/cachegrind/cg_main.c (original)
+++ trunk/cachegrind/cg_main.c Tue Sep 30 23:15:05 2014
@@ -57,7 +57,6 @@
/* Set to 1 for very verbose debugging */
#define DEBUG_CG 0
-#define MIN_LINE_SIZE 16
#define FILE_LEN VKI_PATH_MAX
#define FN_LEN 256
Modified: trunk/cachegrind/cg_sim.c
==============================================================================
--- trunk/cachegrind/cg_sim.c (original)
+++ trunk/cachegrind/cg_sim.c Tue Sep 30 23:15:05 2014
@@ -46,7 +46,7 @@
Int sets_min_1;
Int line_size_bits;
Int tag_shift;
- HChar desc_line[128];
+ HChar desc_line[128]; /* large enough */
UWord* tags;
} cache_t2;
Modified: trunk/callgrind/callstack.c
==============================================================================
--- trunk/callgrind/callstack.c (original)
+++ trunk/callgrind/callstack.c Tue Sep 30 23:15:05 2014
@@ -130,7 +130,7 @@
#endif
if (fn->dump_before) {
- HChar trigger[FN_NAME_LEN];
+ HChar trigger[VG_(strlen)(fn->name) + 20];
VG_(sprintf)(trigger, "--dump-before=%s", fn->name);
CLG_(dump_profile)(trigger, True);
}
@@ -152,7 +152,7 @@
CLG_ASSERT(fn != 0);
if (fn->dump_after) {
- HChar trigger[FN_NAME_LEN];
+ HChar trigger[VG_(strlen)(fn->name) + 20];
VG_(sprintf)(trigger, "--dump-after=%s", fn->name);
CLG_(dump_profile)(trigger, True);
}
Modified: trunk/callgrind/dump.c
==============================================================================
--- trunk/callgrind/dump.c (original)
+++ trunk/callgrind/dump.c Tue Sep 30 23:15:05 2014
@@ -1479,7 +1479,6 @@
/* Helper for print_bbccs */
-static Int print_fd;
static const HChar* print_trigger;
static HChar print_buf[BUF_LEN];
@@ -1491,7 +1490,7 @@
CLG_DEBUG(1, "+ print_bbccs(tid %d)\n", CLG_(current_tid));
- print_fd = new_dumpfile(print_buf, CLG_(current_tid), print_trigger);
+ Int print_fd = new_dumpfile(print_buf, CLG_(current_tid), print_trigger);
if (print_fd <0) {
CLG_DEBUG(1, "- print_bbccs(tid %d): No output...\n", CLG_(current_tid));
return;
@@ -1572,7 +1571,6 @@
init_dump_array();
init_debug_cache();
- print_fd = -1;
print_trigger = trigger;
if (!CLG_(clo).separate_threads) {
Modified: trunk/drd/drd_clientreq.c
==============================================================================
--- trunk/drd/drd_clientreq.c (original)
+++ trunk/drd/drd_clientreq.c Tue Sep 30 23:15:05 2014
@@ -35,7 +35,6 @@
#include "drd_suppression.h" // drd_start_suppression()
#include "drd_thread.h"
#include "pub_tool_basics.h" // Bool
-#include "pub_tool_debuginfo.h" // VG_(describe_IP)()
#include "pub_tool_libcassert.h"
#include "pub_tool_libcassert.h" // tl_assert()
#include "pub_tool_libcprint.h" // VG_(message)()
Modified: trunk/drd/drd_main.c
==============================================================================
--- trunk/drd/drd_main.c (original)
+++ trunk/drd/drd_main.c Tue Sep 30 23:15:05 2014
@@ -40,7 +40,6 @@
#include "pub_drd_bitmap.h"
#include "pub_tool_vki.h" // Must be included before pub_tool_libcproc
#include "pub_tool_basics.h"
-#include "pub_tool_debuginfo.h" // VG_(describe_IP)()
#include "pub_tool_libcassert.h" // tl_assert()
#include "pub_tool_libcbase.h" // VG_(strcmp)
#include "pub_tool_libcprint.h" // VG_(printf)
Modified: trunk/exp-dhat/dh_main.c
==============================================================================
--- trunk/exp-dhat/dh_main.c (original)
+++ trunk/exp-dhat/dh_main.c Tue Sep 30 23:15:05 2014
@@ -1094,7 +1094,7 @@
static void show_APInfo ( APInfo* api )
{
- HChar bufA[80];
+ HChar bufA[80]; // large enough
VG_(memset)(bufA, 0, sizeof(bufA));
if (api->tot_blocks > 0) {
show_N_div_100( bufA, ((ULong)api->tot_bytes * 100ULL)
@@ -1121,7 +1121,7 @@
ULong aad_frac_10k
= g_guest_instrs_executed == 0
? 0 : (10000ULL * aad) / g_guest_instrs_executed;
- HChar buf[16];
+ HChar buf[80]; // large enough
show_N_div_100(buf, aad_frac_10k);
VG_(umsg)("deaths: %'llu, at avg age %'llu "
"(%s%% of prog lifetime)\n",
@@ -1130,7 +1130,7 @@
VG_(umsg)("deaths: none (none of these blocks were freed)\n");
}
- HChar bufR[80], bufW[80];
+ HChar bufR[80], bufW[80]; // large enough
VG_(memset)(bufR, 0, sizeof(bufR));
VG_(memset)(bufW, 0, sizeof(bufW));
if (api->tot_bytes > 0) {
|