See trunk r10465 commit message for details.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10466
if (reinitialization)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_reinit %s 0x%lx count %ld -> %ld",
+ "[%d/%d] barrier_reinit %s 0x%lx count %ld -> %ld\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
barrier_get_typename(p),
else
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_init %s 0x%lx",
+ "[%d/%d] barrier_init %s 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
barrier_get_typename(p),
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_destroy %s 0x%lx",
+ "[%d/%d] barrier_destroy %s 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
barrier_get_typename(p),
* not. The only cause I know of that can trigger this is that libgomp.so
* has been compiled with --enable-linux-futex.
*/
- VG_(message)(Vg_UserMsg, "");
+ VG_(message)(Vg_UserMsg, "\n");
VG_(message)(Vg_UserMsg,
"Please verify whether gcc has been configured"
- " with option --disable-linux-futex.");
+ " with option --disable-linux-futex.\n");
VG_(message)(Vg_UserMsg,
- "See also the section about OpenMP in the DRD manual.");
- VG_(message)(Vg_UserMsg, "");
+ "See also the section about OpenMP in the DRD manual.\n");
+ VG_(message)(Vg_UserMsg, "\n");
}
tl_assert(p);
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_pre_wait %s 0x%lx iteration %ld",
+ "[%d/%d] barrier_pre_wait %s 0x%lx iteration %ld\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
barrier_get_typename(p),
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_post_wait %s 0x%lx iteration %ld%s",
+ "[%d/%d] barrier_post_wait %s 0x%lx iteration %ld%s\n",
VG_(get_running_tid)(),
tid,
p ? barrier_get_typename(p) : "(?)",
if (s_trace_clientobj)
{
- VG_(message)(Vg_UserMsg, "Adding client object 0x%lx of type %d", a1, t);
+ VG_(message)(Vg_UserMsg, "Adding client object 0x%lx of type %d\n", a1, t);
}
p = VG_(OSetGen_AllocNode)(s_clientobj_set, sizeof(*p));
if (s_trace_clientobj)
{
- VG_(message)(Vg_UserMsg, "Removing client object 0x%lx of type %d",
+ VG_(message)(Vg_UserMsg, "Removing client object 0x%lx of type %d\n",
p->any.a1, p->any.type);
}
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_init cond 0x%lx",
+ "[%d/%d] cond_init cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_destroy cond 0x%lx",
+ "[%d/%d] cond_destroy cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_pre_wait cond 0x%lx",
+ "[%d/%d] cond_pre_wait cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_post_wait cond 0x%lx",
+ "[%d/%d] cond_post_wait cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_signal cond 0x%lx",
+ "[%d/%d] cond_signal cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_broadcast cond 0x%lx",
+ "[%d/%d] cond_broadcast cond 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
cond);
{
tl_assert(cl->any.first_observed_at);
VG_(message)(Vg_UserMsg,
- "%s 0x%lx was first observed at:",
+ "%s 0x%lx was first observed at:\n",
DRD_(clientobj_type_name)(cl->any.type),
obj);
VG_(pp_ExeContext)(cl->any.first_observed_at);
void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
{
AddrInfo ai;
- const unsigned descr_size = 256;
- Char* descr1 = VG_(malloc)("drd.error.drdr2.1", descr_size);
- Char* descr2 = VG_(malloc)("drd.error.drdr2.2", descr_size);
+
+ XArray* /* of HChar */ descr1
+ = VG_(newXA)( VG_(malloc), "drd.error.drdr2.1",
+ VG_(free), sizeof(HChar) );
+ XArray* /* of HChar */ descr2
+ = VG_(newXA)( VG_(malloc), "drd.error.drdr2.2",
+ VG_(free), sizeof(HChar) );
tl_assert(dri);
tl_assert(dri->addr);
tl_assert(descr1);
tl_assert(descr2);
- descr1[0] = 0;
- descr2[0] = 0;
- VG_(get_data_description)(descr1, descr2, descr_size, dri->addr);
- if (descr1[0] == 0)
+ (void) VG_(get_data_description)(descr1, descr2, dri->addr);
+ /* If there's nothing in descr1/2, free them. Why is it safe to to
+ VG_(indexXA) at zero here? Because VG_(get_data_description)
+ guarantees to zero terminate descr1/2 regardless of the outcome
+ of the call. So there's always at least one element in each XA
+ after the call.
+ */
+ if (0 == VG_(strlen)( VG_(indexXA)( descr1, 0 ))) {
+ VG_(deleteXA)( descr1 );
+ descr1 = NULL;
+ }
+ if (0 == VG_(strlen)( VG_(indexXA)( descr2, 0 ))) {
+ VG_(deleteXA)( descr2 );
+ descr2 = NULL;
+ }
+ /* Assume (assert) that VG_(get_data_description) fills in descr1
+ before it fills in descr2 */
+ if (descr1 == NULL)
+ tl_assert(descr2 == NULL);
+ /* So anyway. Do we have something useful? */
+ if (descr1 == NULL)
{
+ /* No. Do Plan B. */
describe_malloced_addr(dri->addr, dri->size, &ai);
}
VG_(message)(Vg_UserMsg,
- "Conflicting %s by thread %d/%d at 0x%08lx size %ld",
+ "Conflicting %s by thread %d/%d at 0x%08lx size %ld\n",
dri->access_type == eStore ? "store" : "load",
DRD_(DrdThreadIdToVgThreadId)(dri->tid),
dri->tid,
dri->addr,
dri->size);
VG_(pp_ExeContext)(VG_(get_error_where)(err));
- if (descr1[0])
+ if (descr1 != NULL)
{
- VG_(message)(Vg_UserMsg, "%s", descr1);
- VG_(message)(Vg_UserMsg, "%s", descr2);
+ VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr1, 0));
+ if (descr2 != NULL)
+ VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr2, 0));
}
else if (ai.akind == eMallocd && ai.lastchange)
{
VG_(message)(Vg_UserMsg,
"Address 0x%lx is at offset %ld from 0x%lx."
- " Allocation context:",
+ " Allocation context:\n",
dri->addr, ai.rwoffset, dri->addr - ai.rwoffset);
VG_(pp_ExeContext)(ai.lastchange);
}
if (sect_kind != Vg_SectUnknown)
{
VG_(message)(Vg_UserMsg,
- "Allocation context: %s section of %s",
+ "Allocation context: %s section of %s\n",
VG_(pp_SectKind)(sect_kind),
sect_name);
}
else
{
- VG_(message)(Vg_UserMsg, "Allocation context: unknown.");
+ VG_(message)(Vg_UserMsg, "Allocation context: unknown.\n");
}
}
if (s_show_conflicting_segments)
dri->access_type);
}
- VG_(free)(descr2);
- VG_(free)(descr1);
+ if (descr2)
+ VG_(deleteXA)(descr2);
+ if (descr1)
+ VG_(deleteXA)(descr1);
}
static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)
return False;
}
+static void drd_tool_error_before_pp(Error* const e)
+{
+ /* No need to do anything; drd_tool_error_pp does all
+ the work. */
+}
+
static void drd_tool_error_pp(Error* const e)
{
static DrdThreadId s_last_tid_printed = 1;
if (err_extra && *err_extra != s_last_tid_printed)
{
- VG_UMSG("%s:", DRD_(thread_get_name)(*err_extra));
+ VG_(umsg)("%s:\n", DRD_(thread_get_name)(*err_extra));
s_last_tid_printed = *err_extra;
}
if (p->recursion_count >= 0)
{
VG_(message)(Vg_UserMsg,
- "%s: mutex 0x%lx, recursion count %d, owner %d.",
+ "%s: mutex 0x%lx, recursion count %d, owner %d.\n",
VG_(get_error_string)(e),
p->mutex,
p->recursion_count,
else
{
VG_(message)(Vg_UserMsg,
- "The object at address 0x%lx is not a mutex.",
+ "The object at address 0x%lx is not a mutex.\n",
p->mutex);
}
VG_(pp_ExeContext)(VG_(get_error_where)(e));
case CondErr: {
CondErrInfo* cdei =(CondErrInfo*)(VG_(get_error_extra)(e));
VG_(message)(Vg_UserMsg,
- "%s: cond 0x%lx",
+ "%s: cond 0x%lx\n",
VG_(get_error_string)(e),
cdei->cond);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
case CondDestrErr: {
CondDestrErrInfo* cdi = (CondDestrErrInfo*)(VG_(get_error_extra)(e));
VG_(message)(Vg_UserMsg,
- "%s: cond 0x%lx, mutex 0x%lx locked by thread %d/%d",
+ "%s: cond 0x%lx, mutex 0x%lx locked by thread %d/%d\n",
VG_(get_error_string)(e),
cdi->cond, cdi->mutex,
DRD_(DrdThreadIdToVgThreadId)(cdi->owner), cdi->owner);
VG_(message)(Vg_UserMsg,
"Probably a race condition: condition variable 0x%lx has"
" been signaled but the associated mutex 0x%lx is not"
- " locked by the signalling thread.",
+ " locked by the signalling thread.\n",
cei->cond, cei->mutex);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
first_observed(cei->cond);
case CondWaitErr: {
CondWaitErrInfo* cwei = (CondWaitErrInfo*)(VG_(get_error_extra)(e));
VG_(message)(Vg_UserMsg,
- "%s: condition variable 0x%lx, mutexes 0x%lx and 0x%lx",
+ "%s: condition variable 0x%lx, mutexes 0x%lx and 0x%lx\n",
VG_(get_error_string)(e),
cwei->cond,
cwei->mutex1,
SemaphoreErrInfo* sei = (SemaphoreErrInfo*)(VG_(get_error_extra)(e));
tl_assert(sei);
VG_(message)(Vg_UserMsg,
- "%s: semaphore 0x%lx",
+ "%s: semaphore 0x%lx\n",
VG_(get_error_string)(e),
sei->semaphore);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
BarrierErrInfo* bei = (BarrierErrInfo*)(VG_(get_error_extra)(e));
tl_assert(bei);
VG_(message)(Vg_UserMsg,
- "%s: barrier 0x%lx",
+ "%s: barrier 0x%lx\n",
VG_(get_error_string)(e),
bei->barrier);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
if (bei->other_context)
{
VG_(message)(Vg_UserMsg,
- "Conflicting wait call by thread %d/%d:",
+ "Conflicting wait call by thread %d/%d:\n",
DRD_(DrdThreadIdToVgThreadId)(bei->other_tid),
bei->other_tid);
VG_(pp_ExeContext)(bei->other_context);
RwlockErrInfo* p = (RwlockErrInfo*)(VG_(get_error_extra)(e));
tl_assert(p);
VG_(message)(Vg_UserMsg,
- "%s: rwlock 0x%lx.",
+ "%s: rwlock 0x%lx.\n",
VG_(get_error_string)(e),
p->rwlock);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
HoldtimeErrInfo* p =(HoldtimeErrInfo*)(VG_(get_error_extra)(e));
tl_assert(p);
tl_assert(p->acquired_at);
- VG_(message)(Vg_UserMsg, "Acquired at:");
+ VG_(message)(Vg_UserMsg, "Acquired at:\n");
VG_(pp_ExeContext)(p->acquired_at);
VG_(message)(Vg_UserMsg,
- "Lock on %s 0x%lx was held during %d ms (threshold: %d ms).",
+ "Lock on %s 0x%lx was held during %d ms (threshold: %d ms).\n",
VG_(get_error_string)(e),
p->synchronization_object,
p->hold_time_ms,
}
case GenericErr: {
//GenericErrInfo* gei =(GenericErrInfo*)(VG_(get_error_extra)(e));
- VG_(message)(Vg_UserMsg, "%s", VG_(get_error_string)(e));
+ VG_(message)(Vg_UserMsg, "%s\n", VG_(get_error_string)(e));
VG_(pp_ExeContext)(VG_(get_error_where)(e));
break;
}
default:
VG_(message)(Vg_UserMsg,
- "%s",
+ "%s\n",
VG_(get_error_string)(e));
VG_(pp_ExeContext)(VG_(get_error_where)(e));
break;
{
// Tool error reporting.
VG_(needs_tool_errors)(drd_tool_error_eq,
+ drd_tool_error_before_pp,
drd_tool_error_pp,
False,
drd_tool_error_update_extra,
vc = DRD_(vc_aprint)(DRD_(thread_get_vc)(DRD_(thread_get_running_tid)()));
VG_(message)(Vg_UserMsg,
- "%s 0x%lx size %ld (vg %d / drd %d / vc %s)",
+ "%s 0x%lx size %ld (vg %d / drd %d / vc %s)\n",
access_type == eLoad
? "load "
: access_type == eStore
if (DRD_(thread_get_trace_fork_join)())
{
VG_(message)(Vg_DebugMsg,
- "drd_pre_thread_create creator = %d/%d, created = %d",
+ "drd_pre_thread_create creator = %d/%d, created = %d\n",
creator, drd_creator, created);
}
}
if (DRD_(thread_get_trace_fork_join)())
{
VG_(message)(Vg_DebugMsg,
- "drd_post_thread_create created = %d/%d",
+ "drd_post_thread_create created = %d/%d\n",
vg_created, drd_created);
}
if (! DRD_(get_check_stack_accesses)())
if (DRD_(thread_get_trace_fork_join)())
{
VG_(message)(Vg_DebugMsg,
- "drd_thread_finished tid = %d/%d%s",
+ "drd_thread_finished tid = %d/%d%s\n",
vg_tid,
drd_tid,
DRD_(thread_get_joinable)(drd_tid)
- DRD_(thread_get_stack_min_min)(drd_tid));
VG_(message)(Vg_UserMsg,
"thread %d/%d%s finished and used %ld bytes out of %ld"
- " on its stack. Margin: %ld bytes.",
+ " on its stack. Margin: %ld bytes.\n",
vg_tid,
drd_tid,
DRD_(thread_get_joinable)(drd_tid)
ULong pu_join = DRD_(thread_get_update_conflict_set_join_count)();
VG_(message)(Vg_UserMsg,
- " thread: %lld context switches.",
+ " thread: %lld context switches.\n",
DRD_(thread_get_context_switch_count)());
VG_(message)(Vg_UserMsg,
- "confl set: %lld full updates and %lld partial updates;",
+ "confl set: %lld full updates and %lld partial updates;\n",
DRD_(thread_get_compute_conflict_set_count)(),
pu);
VG_(message)(Vg_UserMsg,
- " %lld partial updates during segment creation,",
+ " %lld partial updates during segment creation,\n",
pu_seg_cr);
VG_(message)(Vg_UserMsg,
- " %lld because of mutex/sema/cond.var. operations,",
+ " %lld because of mutex/sema/cond.var. operations,\n",
pu_mtx_cv);
VG_(message)(Vg_UserMsg,
- " %lld because of barrier/rwlock operations and",
+ " %lld because of barrier/rwlock operations and\n",
pu - pu_seg_cr - pu_mtx_cv - pu_join);
VG_(message)(Vg_UserMsg,
" %lld partial updates because of thread join"
- " operations.",
+ " operations.\n",
pu_join);
VG_(message)(Vg_UserMsg,
- " segments: created %lld segments, max %lld alive,",
+ " segments: created %lld segments, max %lld alive,\n",
DRD_(sg_get_segments_created_count)(),
DRD_(sg_get_max_segments_alive_count)());
VG_(message)(Vg_UserMsg,
- " %lld discard points and %lld merges.",
+ " %lld discard points and %lld merges.\n",
DRD_(thread_get_discard_ordered_segments_count)(),
DRD_(sg_get_segment_merge_count)());
VG_(message)(Vg_UserMsg,
"segmnt cr: %lld mutex, %lld rwlock, %lld semaphore and"
- " %lld barrier.",
+ " %lld barrier.\n",
DRD_(get_mutex_segment_creation_count)(),
DRD_(get_rwlock_segment_creation_count)(),
DRD_(get_semaphore_segment_creation_count)(),
DRD_(get_barrier_segment_creation_count)());
VG_(message)(Vg_UserMsg,
" bitmaps: %lld level one"
- " and %lld level two bitmaps were allocated.",
+ " and %lld level two bitmaps were allocated.\n",
DRD_(bm_get_bitmap_creation_count)(),
DRD_(bm_get_bitmap2_creation_count)());
VG_(message)(Vg_UserMsg,
- " mutex: %lld non-recursive lock/unlock events.",
+ " mutex: %lld non-recursive lock/unlock events.\n",
DRD_(get_mutex_lock_count)());
DRD_(print_malloc_stats)();
}
}
VG_(message)(Vg_DebugMsg,
- "malloc/free: in use at exit: %lu bytes in %lu blocks.",
+ "malloc/free: in use at exit: %lu bytes in %lu blocks.\n",
nbytes, nblocks);
VG_(message)(Vg_DebugMsg,
- "malloc/free: %lu allocs, %lu frees, %lu bytes allocated.",
+ "malloc/free: %lu allocs, %lu frees, %lu bytes allocated.\n",
s_cmalloc_n_mallocs,
s_cmalloc_n_frees, s_cmalloc_bs_mallocd);
if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg, " ");
+ VG_(message)(Vg_DebugMsg, " \n");
}
/*--------------------------------------------------------------------*/
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] mutex_destroy %s 0x%lx rc %d owner %d",
+ "[%d/%d] mutex_destroy %s 0x%lx rc %d owner %d\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
DRD_(mutex_get_typename)(p),
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] mutex_init %s 0x%lx",
+ "[%d/%d] mutex_init %s 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
DRD_(mutex_type_name)(mutex_type),
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] %s %s 0x%lx rc %d owner %d",
+ "[%d/%d] %s %s 0x%lx rc %d owner %d\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
trylock ? "pre_mutex_lock " : "mutex_trylock ",
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] %s %s 0x%lx rc %d owner %d%s",
+ "[%d/%d] %s %s 0x%lx rc %d owner %d%s\n",
VG_(get_running_tid)(),
drd_tid,
post_cond_wait ? "cond_post_wait " : "post_mutex_lock",
VG_(message)(Vg_UserMsg,
"The impossible happened: mutex 0x%lx is locked"
" simultaneously by two threads (recursion count %d,"
- " owners %d and %d) !",
+ " owners %d and %d) !\n",
p->a1, p->recursion_count, p->owner, drd_tid);
p->owner = drd_tid;
}
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] mutex_unlock %s 0x%lx rc %d",
+ "[%d/%d] mutex_unlock %s 0x%lx rc %d\n",
vg_tid,
drd_tid,
p ? DRD_(mutex_get_typename)(p) : "(?)",
tl_assert(p);
if (p->mutex_type != mutex_type)
{
- VG_(message)(Vg_UserMsg, "??? mutex 0x%lx: type changed from %d into %d",
+ VG_(message)(Vg_UserMsg, "??? mutex 0x%lx: type changed from %d into %d\n",
p->a1, p->mutex_type, mutex_type);
}
tl_assert(p->mutex_type == mutex_type);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] rwlock_destroy 0x%lx",
+ "[%d/%d] rwlock_destroy 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
p->a1);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] rwlock_init 0x%lx",
+ "[%d/%d] rwlock_init 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
rwlock);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] pre_rwlock_rdlock 0x%lx",
+ "[%d/%d] pre_rwlock_rdlock 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
rwlock);
{
VG_(message)(Vg_UserMsg,
"reader-writer lock 0x%lx is already locked for"
- " writing by calling thread",
+ " writing by calling thread\n",
p->a1);
}
}
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] post_rwlock_rdlock 0x%lx",
+ "[%d/%d] post_rwlock_rdlock 0x%lx\n",
VG_(get_running_tid)(),
drd_tid,
rwlock);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] pre_rwlock_wrlock 0x%lx",
+ "[%d/%d] pre_rwlock_wrlock 0x%lx\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
rwlock);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] post_rwlock_wrlock 0x%lx",
+ "[%d/%d] post_rwlock_wrlock 0x%lx\n",
VG_(get_running_tid)(),
drd_tid,
rwlock);
if (DRD_(s_trace_rwlock))
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] rwlock_unlock 0x%lx",
+ "[%d/%d] rwlock_unlock 0x%lx\n",
vg_tid,
drd_tid,
rwlock);
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_init 0x%lx value %u",
+ "[%d/%d] semaphore_init 0x%lx value %u\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
semaphore,
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_destroy 0x%lx value %u",
+ "[%d/%d] semaphore_destroy 0x%lx value %u\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
semaphore,
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_wait 0x%lx value %u -> %u",
+ "[%d/%d] semaphore_wait 0x%lx value %u -> %u\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
semaphore,
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_post 0x%lx value %u -> %u",
+ "[%d/%d] semaphore_post 0x%lx value %u -> %u\n",
VG_(get_running_tid)(),
DRD_(thread_get_running_tid)(),
semaphore,
{
if (DRD_(s_trace_suppression))
{
- VG_(message)(Vg_DebugMsg, "start suppression of 0x%lx sz %ld (%s)",
+ VG_(message)(Vg_DebugMsg, "start suppression of 0x%lx sz %ld (%s)\n",
a1, a2 - a1, reason);
}
{
if (DRD_(s_trace_suppression))
{
- VG_(message)(Vg_DebugMsg, "finish suppression of 0x%lx sz %ld",
+ VG_(message)(Vg_DebugMsg, "finish suppression of 0x%lx sz %ld\n",
a1, a2 - a1);
VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
}
tl_assert(a1 < a2);
if (! DRD_(is_suppressed)(a1, a2))
{
- VG_(message)(Vg_DebugMsg, "?? [0x%lx,0x%lx[ not suppressed ??", a1, a2);
+ VG_(message)(Vg_DebugMsg, "?? [0x%lx,0x%lx[ not suppressed ??\n", a1, a2);
VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
tl_assert(False);
}
{
VG_(message)(Vg_DebugMsg,
"stop_using_mem(0x%lx, %ld) finish suppression of"
- " 0x%lx", a1, a2 - a1, b);
+ " 0x%lx\n", a1, a2 - a1, b);
}
}
}
", new vc: %s", vc);
VG_(free)(vc);
}
- VG_(message)(Vg_DebugMsg, "%s", msg);
+ VG_(message)(Vg_DebugMsg, "%s\n", msg);
VG_(free)(msg);
}
{
VG_(message)(Vg_DebugMsg,
"Context switch from thread %d/%d to thread %d/%d;"
- " segments: %llu",
+ " segments: %llu\n",
s_vg_running_tid, DRD_(g_drd_running_tid),
DRD_(DrdThreadIdToVgThreadId)(drd_tid), drd_tid,
DRD_(sg_get_segments_alive_count)());
vc_min = DRD_(vc_aprint)(&thread_vc_min);
vc_max = DRD_(vc_aprint)(&thread_vc_max);
VG_(message)(Vg_DebugMsg,
- "Discarding ordered segments -- min vc is %s, max vc is %s",
+ "Discarding ordered segments -- min vc is %s, max vc is %s\n",
vc_min, vc_max);
VG_(free)(vc_min);
VG_(free)(vc_max);
char *str1, *str2;
str1 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joiner].last->vc);
str2 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joinee].last->vc);
- VG_(message)(Vg_DebugMsg, "Before join: joiner %s, joinee %s",
+ VG_(message)(Vg_DebugMsg, "Before join: joiner %s, joinee %s\n",
str1, str2);
VG_(free)(str1);
VG_(free)(str2);
{
char* str;
str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[joiner].last->vc);
- VG_(message)(Vg_DebugMsg, "After join: %s", str);
+ VG_(message)(Vg_DebugMsg, "After join: %s\n", str);
VG_(free)(str);
}
}
char *str1, *str2;
str1 = DRD_(vc_aprint)(&old_vc);
str2 = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
- VG_(message)(Vg_DebugMsg, "thread %d: vc %s -> %s", tid, str1, str2);
+ VG_(message)(Vg_DebugMsg, "thread %d: vc %s -> %s\n", tid, str1, str2);
VG_(free)(str1);
VG_(free)(str2);
}
{
const ThreadId vg_tid = DRD_(DrdThreadIdToVgThreadId)(tid);
- VG_(message)(Vg_UserMsg, "%s (thread %d/%d)", msg, vg_tid, tid);
+ VG_(message)(Vg_UserMsg, "%s (thread %d/%d)\n", msg, vg_tid, tid);
if (vg_tid != VG_INVALID_THREADID)
{
else
{
VG_(message)(Vg_UserMsg,
- " (thread finished, call stack no longer available)");
+ " (thread finished, call stack no longer available)\n");
}
}
str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
VG_(message)(Vg_DebugMsg,
- "computing conflict set for thread %d/%d with vc %s",
+ "computing conflict set for thread %d/%d with vc %s\n",
DRD_(DrdThreadIdToVgThreadId)(tid), tid, str);
VG_(free)(str);
}
char* vc;
vc = DRD_(vc_aprint)(&p->vc);
- VG_(message)(Vg_DebugMsg, "conflict set: thread [%d] at vc %s",
+ VG_(message)(Vg_DebugMsg, "conflict set: thread [%d] at vc %s\n",
tid, vc);
VG_(free)(vc);
}
str = DRD_(vc_aprint)(&q->vc);
VG_(message)(Vg_DebugMsg,
- "conflict set: [%d] merging segment %s",
+ "conflict set: [%d] merging segment %s\n",
j, str);
VG_(free)(str);
}
str = DRD_(vc_aprint)(&q->vc);
VG_(message)(Vg_DebugMsg,
- "conflict set: [%d] ignoring segment %s",
+ "conflict set: [%d] ignoring segment %s\n",
j, str);
VG_(free)(str);
}
if (s_trace_conflict_set_bm)
{
- VG_(message)(Vg_DebugMsg, "[%d] new conflict set:", tid);
+ VG_(message)(Vg_DebugMsg, "[%d] new conflict set:\n", tid);
DRD_(bm_print)(*conflict_set);
- VG_(message)(Vg_DebugMsg, "[%d] end of new conflict set.", tid);
+ VG_(message)(Vg_DebugMsg, "[%d] end of new conflict set.\n", tid);
}
}
str = DRD_(vc_aprint)(&DRD_(g_threadinfo)[tid].last->vc);
VG_(message)(Vg_DebugMsg,
- "updating conflict set for thread %d/%d with vc %s",
+ "updating conflict set for thread %d/%d with vc %s\n",
DRD_(DrdThreadIdToVgThreadId)(tid), tid, str);
VG_(free)(str);
}
str = DRD_(vc_aprint)(&q->vc);
VG_(message)(Vg_DebugMsg,
- "conflict set: [%d] merging segment %s", j, str);
+ "conflict set: [%d] merging segment %s\n", j, str);
VG_(free)(str);
}
DRD_(bm_mark)(DRD_(g_conflict_set), DRD_(sg_bm)(q));
str = DRD_(vc_aprint)(&q->vc);
VG_(message)(Vg_DebugMsg,
- "conflict set: [%d] ignoring segment %s", j, str);
+ "conflict set: [%d] ignoring segment %s\n", j, str);
VG_(free)(str);
}
}
if (s_trace_conflict_set_bm)
{
- VG_(message)(Vg_DebugMsg, "[%d] updated conflict set:", tid);
+ VG_(message)(Vg_DebugMsg, "[%d] updated conflict set:\n", tid);
DRD_(bm_print)(DRD_(g_conflict_set));
- VG_(message)(Vg_DebugMsg, "[%d] end of updated conflict set.", tid);
+ VG_(message)(Vg_DebugMsg, "[%d] end of updated conflict set.\n", tid);
}
tl_assert(thread_conflict_set_up_to_date(DRD_(g_drd_running_tid)));