static Bool handle_gdb_monitor_command (ThreadId tid, const HChar *req)
{
HChar* wcmd;
- HChar s[VG_(strlen(req)) + 1]; /* copy for strtok_r */
+ HChar s[VG_(strlen)(req) + 1]; /* copy for strtok_r */
HChar *ssaveptr;
VG_(strcpy) (s, req);
CLG_(instrument_state) = CLG_(clo).instrument_atstart;
- if (VG_(clo_verbosity > 0)) {
+ if (VG_(clo_verbosity) > 0) {
VG_(message)(Vg_UserMsg,
"For interactive control, run 'callgrind_control%s%s -h'.\n",
(VG_(arg_vgdb_prefix) ? " " : ""),
#define AM_SANITY_CHECK \
do { \
- if (VG_(clo_sanity_level >= 3)) \
+ if (VG_(clo_sanity_level) >= 3) \
aspacem_assert(VG_(am_do_sync_check) \
(__PRETTY_FUNCTION__,__FILE__,__LINE__)); \
} while (0)
/* First, count how many memory segments to dump */
num_phdrs = 1; /* start with notes */
for(i = 0; i < n_seg_starts; i++) {
- if (!may_dump(VG_(am_find_nsegment(seg_starts[i]))))
+ if (!may_dump(VG_(am_find_nsegment)(seg_starts[i])))
continue;
num_phdrs++;
off = VG_PGROUNDUP(off);
for(i = 0, idx = 1; i < n_seg_starts; i++) {
- seg = VG_(am_find_nsegment(seg_starts[i]));
+ seg = VG_(am_find_nsegment)(seg_starts[i]);
if (!may_dump(seg))
continue;
VG_(lseek)(core_fd, phdrs[1].p_offset, VKI_SEEK_SET);
for(i = 0, idx = 1; i < n_seg_starts; i++) {
- seg = VG_(am_find_nsegment(seg_starts[i]));
+ seg = VG_(am_find_nsegment)(seg_starts[i]);
if (!should_dump(seg))
continue;
Int i;
UInt num_phdrs = 2; /* two CORE note sections */
for (i = 0; i < n_seg_starts; i++) {
- if (!may_dump(VG_(am_find_nsegment(seg_starts[i]))))
+ if (!may_dump(VG_(am_find_nsegment)(seg_starts[i])))
continue;
num_phdrs++;
/* fill program headers for segments */
UInt idx;
for (i = 0, idx = 2; i < n_seg_starts; i++) {
- NSegment const *seg = VG_(am_find_nsegment(seg_starts[i]));
+ NSegment const *seg = VG_(am_find_nsegment)(seg_starts[i]);
if (!may_dump(seg))
continue;
VG_(lseek)(core_fd, phdrs[2].p_offset, VKI_SEEK_SET);
for (i = 0, idx = 2; i < n_seg_starts; i++) {
- NSegment const *seg = VG_(am_find_nsegment(seg_starts[i]));
+ NSegment const *seg = VG_(am_find_nsegment)(seg_starts[i]);
if (!should_dump(seg))
continue;
knows the name of the file associated with this mapping. This
allows us to print the names of exe/dll files in the stack trace
when running programs under wine. */
- if ( (seg = VG_(am_find_nsegment(a))) != NULL
+ if ( (seg = VG_(am_find_nsegment)(a)) != NULL
&& (filename = VG_(am_get_filename)(seg)) != NULL ) {
*buf = filename;
return True;
if (cmd.cmd == LC_SEGMENT_CMD) {
struct SEGMENT_COMMAND seg;
ML_(cur_read_get)(&seg, cur, sizeof(seg));
- if (0 == VG_(strncmp(&seg.segname[0],
- segname, sizeof(seg.segname)))) {
+ if (0 == VG_(strncmp)(&seg.segname[0],
+ segname, sizeof(seg.segname))) {
DiCursor sects_cur = ML_(cur_plus)(cur, sizeof(seg));
Int s;
for (s = 0; s < seg.nsects; s++) {
struct SECTION sect;
ML_(cur_step_get)(§, §s_cur, sizeof(sect));
- if (0 == VG_(strncmp(sect.sectname, sectname,
- sizeof(sect.sectname)))) {
+ if (0 == VG_(strncmp)(sect.sectname, sectname,
+ sizeof(sect.sectname))) {
DiSlice res = img;
res.ioff = sect.offset;
res.szB = sect.size;
/* ret[0 .. envc-1] is live now. */
/* Find and remove a binding for VALGRIND_LAUNCHER. */
for (i = 0; i < envc; i++)
- if (0 == VG_(memcmp(ret[i], v_launcher, v_launcher_len)))
+ if (0 == VG_(memcmp)(ret[i], v_launcher, v_launcher_len))
break;
if (i < envc) {
SizeT v_launcher_len = VG_(strlen)(v_launcher);
for (i = 0; i < envc; i++)
- if (!VG_(memcmp(ret[i], v_launcher, v_launcher_len))) {
+ if (!VG_(memcmp)(ret[i], v_launcher, v_launcher_len)) {
/* VALGRIND_LAUNCHER was found. */
break;
}
s = *saveptr;
/* Scan leading delimiters. */
- s += VG_(strspn (s, delim));
+ s += VG_(strspn) (s, delim);
if (*s == '\0')
{
*saveptr = s;
/* Find the end of the token. */
token = s;
- s = VG_(strpbrk (token, delim));
+ s = VG_(strpbrk) (token, delim);
if (s == NULL)
/* This token finishes the string. */
*saveptr = token + VG_(strlen) (token);
VG_(printf_xml)("\n");
}
- if (VG_(clo_xml) || VG_(clo_verbosity > 0)) {
+ if (VG_(clo_xml) || VG_(clo_verbosity) > 0) {
if (VG_(clo_xml))
VG_(printf_xml)("<preamble>\n");
);
VG_(printf)("pp_ksigaction: { ");
for (i = 1; i <= VG_(max_signal); i++)
- if (VG_(sigismember(&(sa->sa_mask),i)))
+ if (VG_(sigismember)(&(sa->sa_mask),i))
VG_(printf)("%d ", i);
VG_(printf)("}\n");
}
if (a != 0) {
tst->os_state.schedctl_data = 0;
a = VG_PGROUNDDN(a);
- if (VG_(am_find_anon_segment(a)))
+ if (VG_(am_find_anon_segment)(a))
VG_(am_notify_munmap)(a, VKI_PAGE_SIZE);
}
}
if (params->rbuf) {
Addr addr = (Addr)params->rbuf;
- if (!VG_(am_find_anon_segment(addr))) {
+ if (!VG_(am_find_anon_segment)(addr)) {
/* This segment is new and was mapped by the kernel. */
UInt prot, flags;
SizeT size;
tst->os_state.schedctl_data = a;
/* Returned address points to a block in a mapped page. */
- if (!VG_(am_find_anon_segment(a))) {
+ if (!VG_(am_find_anon_segment)(a)) {
Addr page = VG_PGROUNDDN(a);
UInt prot = VKI_PROT_READ | VKI_PROT_WRITE | VKI_PROT_EXEC;
UInt flags = VKI_MAP_ANONYMOUS;
/* The kernel always places redzone before and after the allocated page.
Check this assertion now; the tool can later request to allocate
a Valgrind segment and aspacemgr will place it adjacent. */
- const NSegment *seg = VG_(am_find_nsegment(page - 1));
+ const NSegment *seg = VG_(am_find_nsegment)(page - 1);
vg_assert(seg == NULL || seg->kind == SkResvn);
- seg = VG_(am_find_nsegment(page + VKI_PAGE_SIZE));
+ seg = VG_(am_find_nsegment)(page + VKI_PAGE_SIZE);
vg_assert(seg == NULL || seg->kind == SkResvn);
/* The address space manager works with whole pages. */
guest_start, range, who );
/* Pre-deletion sanity check */
- if (VG_(clo_sanity_level >= 4)) {
+ if (VG_(clo_sanity_level) >= 4) {
Bool sane = sanity_check_all_sectors();
vg_assert(sane);
}
unredir_discard_translations( guest_start, range );
/* Post-deletion sanity check */
- if (VG_(clo_sanity_level >= 4)) {
+ if (VG_(clo_sanity_level) >= 4) {
TTEno i;
TTEntry* tte;
Bool sane = sanity_check_all_sectors();
UWord result = 0;
const DrdThreadId drd_tid = DRD_(thread_get_running_tid)();
- tl_assert(vg_tid == VG_(get_running_tid()));
+ tl_assert(vg_tid == VG_(get_running_tid)());
tl_assert(DRD_(VgThreadIdToDrdThreadId)(vg_tid) == drd_tid
|| (VG_USERREQ__GDB_MONITOR_COMMAND == arg[0]
&& vg_tid == VG_INVALID_THREADID));
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
/* The assert below has been commented out because of performance reasons.*/
tl_assert(DRD_(thread_get_running_tid)()
- == DRD_(VgThreadIdToDrdThreadId)(VG_(get_running_tid())));
+ == DRD_(VgThreadIdToDrdThreadId)(VG_(get_running_tid)()));
#endif
if (DRD_(running_thread_is_recording_loads)()
#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
/* The assert below has been commented out because of performance reasons.*/
tl_assert(DRD_(thread_get_running_tid)()
- == DRD_(VgThreadIdToDrdThreadId)(VG_(get_running_tid())));
+ == DRD_(VgThreadIdToDrdThreadId)(VG_(get_running_tid)()));
#endif
if (DRD_(running_thread_is_recording_stores)()
SizeT pc_get_extra_suppression_info ( const Error* err,
/*OUT*/HChar* buf, Int nBuf )
{
- ErrorKind ekind = VG_(get_error_kind )(err);
+ ErrorKind ekind = VG_(get_error_kind)(err);
tl_assert(buf);
tl_assert(nBuf >= 1);
/* 2nd and subsequent locking of a lock by its owner */
tl_assert(lk->heldW);
/* assert: lk is only held by one thread .. */
- tl_assert(VG_(sizeUniqueBag(lk->heldBy)) == 1);
+ tl_assert(VG_(sizeUniqueBag)(lk->heldBy) == 1);
/* assert: .. and that thread is 'thr'. */
tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr)
== VG_(sizeTotalBag)(lk->heldBy));
static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
{
HChar* wcmd;
- HChar s[VG_(strlen(req))]; /* copy for strtok_r */
+ HChar s[VG_(strlen)(req)]; /* copy for strtok_r */
HChar *ssaveptr;
Int kwdid;
static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
{
HChar* wcmd;
- HChar s[VG_(strlen(req)) + 1]; /* copy for strtok_r */
+ HChar s[VG_(strlen)(req) + 1]; /* copy for strtok_r */
HChar *ssaveptr;
VG_(strcpy) (s, req);
if (eof) return True; // old LeakSupp style, no match-leak-kinds line.
if (0 == VG_(strncmp)(*bufpp, "match-leak-kinds:", 17)) {
i = 17;
- while ((*bufpp)[i] && VG_(isspace((*bufpp)[i])))
+ while ((*bufpp)[i] && VG_(isspace)((*bufpp)[i]))
i++;
if (!VG_(parse_enum_set)(MC_(parse_leak_kinds_tokens),
True/*allow_all*/,
{
Int su_szB;
MC_Error* extra = VG_(get_error_extra)(err);
- ErrorKind ekind = VG_(get_error_kind )(err);
+ ErrorKind ekind = VG_(get_error_kind)(err);
switch (VG_(get_supp_kind)(su)) {
case ParamSupp:
SizeT MC_(get_extra_suppression_info) ( const Error* err,
/*OUT*/HChar* buf, Int nBuf )
{
- ErrorKind ekind = VG_(get_error_kind )(err);
+ ErrorKind ekind = VG_(get_error_kind)(err);
tl_assert(buf);
tl_assert(nBuf >= 1);
static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
{
HChar* wcmd;
- HChar s[VG_(strlen(req)) + 1]; /* copy for strtok_r */
+ HChar s[VG_(strlen)(req) + 1]; /* copy for strtok_r */
HChar *ssaveptr;
VG_(strcpy) (s, req);